On the bngsim network-free path, a bifurcate() action is skipped without any message, so the simulations after it start from the seed species instead of the state the bifurcate left
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
Start with pybnf/bngsim_model/classification.py:308-313 and pybnf/bngsim_model/nf_model.py:291-360, then compare the bifurcate handling in pybnf/bngsim_model/net_model.py:1002-1011. Reproduce the supplied bifm.bngl and bngsim.conf cases with both backends and inspect existing tests around action classification and bridge execution. Done means unsupported accepted actions are reported or rejected consistently, with coverage for bifurcate and the related catch-all behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
A network-free BNGL model (method=>"nf") whose actions block runs bifurcate(...) and then a scored simulate(...) is sent to bngsim's network-free simulator under the default bngl_backend = auto, and also under bngl_backend = bngsim. That simulator has no code for bifurcate. It skips the action without printing anything or writing to the log, and runs the rest of the block as if the action were not there. BNG2.pl runs the bifurcate, and the next simulate continues from the state it left. PyBNF should either run the bifurcate or refuse the model when the configuration loads. In the example below, the scored time course starts at 0 molecules instead of about 180, and the objective at the same parameter values is 61358 instead of 1811.
Example
bifm.bngl (birth p, death k, steady state p/k = 200; the bifurcate ends at k = 0.5, its starting value, so it changes only the state):
begin model
begin parameters
k 0.5
p p__FREE
end parameters
begin molecule types
A()
end molecule types
begin seed species
A() 0
end seed species
begin observables
Molecules A_tot A()
end observables
begin reaction rules
0 -> A() p
A() -> 0 k
end reaction rules
end model
begin actions
bifurcate({parameter=>"k",par_min=>0.5,par_max=>2,n_scan_pts=>4,method=>"nf",t_end=>20,n_steps=>2,suffix=>"bif"})
simulate({method=>"nf",t_end=>5,n_steps=>5,suffix=>"tc"})
end actions
tc.exp:
# time A_tot
0 200
1 200
2 200
3 200
4 200
5 200
bngsim.conf (the box on p is narrow only so that every evaluation uses p = 100):
model = bifm.bngl : tc.exp
bngl_backend = bngsim
objfunc = sos
fit_type = de
uniform_var = p__FREE 99.999 100.001
population_size = 4
max_iterations = 1
random_seed = 1
output_dir = out_bngsim
delete_old_files = 0
Run pybnf -c bngsim.conf, then the same conf with bngl_backend = bionetgen (BNG2.pl with NFsim, BioNetGen 2.9.3). For evaluation gen0ind0 (p = 100.001), Simulations/gen0ind0/bifm_gen0ind0_tc.gdat holds:
| t | 0 | 1 | 2 | 3 | 4 | 5 | sos |
|---|---|---|---|---|---|---|---|
bngsim (auto or bngsim) |
0 | 75 | 148 | 166 | 172 | 167 | 61358 |
| BNG2.pl | 177 | 194 | 205 | 174 | 183 | 184 | 1811 |
The best objectives are 58203 (bngsim) and 991 (BNG2.pl). With bngl_backend = auto the run is identical to the bngsim run (objective 58203). On BNG2.pl the bifurcate's last scan point ends at 178 molecules (its _bifurcation_A_tot.scan), close to the steady state p/k = 200, and tc starts from there. On bngsim, tc starts from the seed amount, 0. Neither the console nor the bnf_*.log file mentions the skipped action.
Why
The configuration-time check classifies bifurcate with a network-free method as a network-free simulation action (pybnf/bngsim_model/classification.py:308-313), so the model is accepted for the network-free bridge (pybnf/algorithms/base.py:705). BngsimNfModel.execute (pybnf/bngsim_model/nf_model.py:291-360) handles parameter_scan, simulate, setParameter, setConcentration, addConcentration, saveParameters and resetParameters. Every other line falls through to logger.debug("BngsimNfModel: skipping unsupported action: %s", line) (nf_model.py:359-360) and the loop continues. The .net bridge's loop does handle bifurcate (pybnf/bngsim_model/net_model.py:1002-1011). BNG2.pl runs a bifurcate as a forward and a backward parameter scan with reset_conc forced to 0 (BioNetGen 2.9.3, Perl2/BNGAction.pm:1520-1553), so the model keeps the state of the last scan point, and the next simulate starts from it.
The same catch-all is also reached by a setConcentration whose quoted value contains a space (#877). Any line that reaches it is one the configuration check accepted and the bridge cannot run, so the skip is never correct.
Possible fix
Make the catch-all at nf_model.py:359-360 raise a PybnfError that names the action. Make the classifier treat bifurcate with a network-free method as unsupported by the bridge: auto then falls back to BNG2.pl, and bngsim refuses at load. (The .net bridge has the same debug-level catch-all at net_model.py:1013-1014. As far as I can tell nothing the classifier accepts reaches it today, but raising there too would stop the two from drifting apart.)
Related: #877 (the other action that reaches this skip), #941 and #880 (other places where bngsim and BNG2.pl disagree after a scan)
Found while fixing the PEtab issues #892–#908 (2026-09-25); reproduced on main at 5ecb1f69.
- Lingua principale
- Python
- Stelle
- 25
- Fork
- 25
- Merge medio
- 4h 5m
- PR unite (30g)
- 10
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lanl/PyBNF
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
bug minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
bug tech debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
bug silent-incorrectness
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Adopt size-ratchet v4.0.3Apertaarea: ci enhancement perceived difficulty: 1
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
Nitjsefnie-Harness-Commons/daedalus#1826 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
vllm-project/vllm-sail#398 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
DiamondLightSource/sm-bluesky#476 ·
I maintainer di solito rispondono entro 1 giorno
-
Quick Installation step 2 installs from the plugin manager, but the plugin isn't published yetAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
I maintainer di solito rispondono entro 6 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100