Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Synthesized experiments are not isolated: a pre-equilibration experiment's setParameter values and its saveConcentrations() snapshot carry into every experiment emitted after it

Chiusa
#830 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

The bug is in pybnf/pset.py lines 1229-1257 and 1096-1098. Start by reading the ADR-0052 docstring about experiment independence. Run the reproduction scripts (repro.py, repro_scan.py) with the tutorial lesson 9 model (inducible_gene.bngl) to confirm the parameter and snapshot leakage. The fix involves adding resetParameters() calls to isolate experiments properly.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug silent-incorrectness

_append_preequilibration_actions (1229-1257) emits resetConcentrations(), then setParameter(...) for the pre-equilibration condition, an unmeasured simulate, setParameter(...) for the measurement condition, [saveConcentrations() for a scan], and the measured action. add_action (1096-1098) separates later experiments with resetConcentrations() only. Nothing ever emits resetParameters(), so the measurement condition's setParameter stays in force for every later experiment in the action list. After a pre-equilibrated scan, saveConcentrations() also redefines what resetConcentrations() resets to, so a later experiment starts from the pre-equilibrated snapshot, not the seed species. bngsim interprets both the same way (net_model.py:870-918). The ADR-0052 docstring says resetConcentrations() gives 'independence from any other experiment's simulation', which does not hold for parameters.

Failure scenario

Tutorial lesson 9 model (inducible_gene.bngl) with both of its experiments in one job, washout declared first: 'experiment: washout, preequilibrate: stim_on, condition: stim_off' then 'experiment: doseresponse, data: dose_response.exp'. The dose-response scan runs with Stimulus_isOn=0 left over from washout, so A_tot = 0 at every dose. The fit completes with best obj 42.63. Swapping the two experiment lines gives obj 1.4e-7. Only declaration order differs. Separately, a pre-equilibrated scan (equilibrate at kf=5, restore kf=1, scan) followed by a plain time course makes the time course start at X=100 instead of X=0.

Reproduction (independent re-run)

  1. CLI fits (pybnf -c, bngl_backend = bngsim, DE, seed 1):
  • AB.conf (washout first): "objective function value of 42.62573194514001", best k_deg = 2.039. 42.625 is exactly half the sum of squares of dose_response.exp, so every dose was predicted as A_tot = 0.
  • BA.conf (the same two lines swapped): 1.427e-07.
  1. repro.py builds the real Configuration and simulates at the true k_deg = 2 on both BNG2.pl (BNGLModel.execute) and bngsim (BngsimModel built on the generated .net, as base.py builds it). pybnf was imported from pybnf/init.py. For the WGD order (washout, then growth, then doseresponse):
  • growth: PyBNF gives [0,0,0,0,0] on both backends; correct is [0, 0.94818, 1.297, 1.42532, 1.47253], i.e. 1.5(1-e^-2t).
  • doseresponse: PyBNF gives [0,0,0,0,0] on both backends; correct is [0.5, 1, 2, 4, 8], i.e. k_prod/k_deg.
  • In the GDW order, growth and doseresponse match the correct values.
  1. repro_scan.py, order SG (a pre-equilibrated washscan scan, then plain growth): growth gives [1.5, 0.55182, 0.203, 0.07468, 0.02747] on both backends; correct is [0, 0.948, 1.297, 1.425, 1.473]. It starts from the saved snapshot A = 1.5 and decays with the stimulus left off, so both the snapshot and the parameter leak are confirmed.

Reachability

Documented edition-2 keys on tutorial lesson 9's inducible_gene.bngl:

condition: stim_on, perturbations: Stimulus_isOn = 1
condition: stim_off, perturbations: Stimulus_isOn = 0
experiment: washout, preequilibrate: stim_on, condition: stim_off, data: washout.exp
experiment: doseresponse, data: dose_response.exp

Any other experiment declared after the preequilibrate: one on the same model inherits Stimulus_isOn=0. After a pre-equilibrated scan (t_end: 1 with an indvar=k_prod data file), it also starts from the saveConcentrations() snapshot. This happens with bngl_backend = bngsim (the auto default picks it) and with BNG2.pl.

Where

pybnf/pset.py:1230 pybnf/pset.py:1232 pybnf/pset.py:1248 pybnf/pset.py:1249

Found in a whole-codebase audit for silently wrong results (2026-09-23); the reproduction above was re-run independently of the original finding.

Lingua principale
Python
Stelle
25
Fork
25
Merge medio
5h 40m
PR unite (30g)
66

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lanl/PyBNF

Tutte le issue di lanl/PyBNF

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.