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
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 25
- Forks
- 25
- Merge medio
- 4 h 5 min
- PR fusionados (30 d)
- 10
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de lanl/PyBNF
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
bug minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
bug tech debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
bug minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
bug silent-incorrectness
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
Todos los issues de lanl/PyBNF
Issues similares
-
Adopt size-ratchet v4.0.3Abiertoarea: ci enhancement perceived difficulty: 1
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Nitjsefnie-Harness-Commons/daedalus#1826 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
vllm-project/vllm-sail#398 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
DiamondLightSource/sm-bluesky#476 ·
Los mantenedores suelen responder en 1 día
-
Quick Installation step 2 installs from the plugin manager, but the plugin isn't published yetAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
Los mantenedores suelen responder en 6 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100