Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

クローズ
#830 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
65/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
25
フォーク
25
平均マージ
5時間 40分
マージ済み PR(30日)
66

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

lanl/PyBNF のほかの issue

lanl/PyBNF の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。