Synthesized experiments are not isolated: a pre-equilibration experiment's setParameter values and its saveConcentrations() snapshot carry into every experiment emitted after it
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 65/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- backend, testing-qa
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
_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)
- 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.
- repro.py builds the real Configuration and simulates at the true k_deg = 2 on both BNG2.pl (
BNGLModel.execute) and bngsim (BngsimModelbuilt 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.
- repro_scan.py, order SG (a pre-equilibrated
washscanscan, 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.
- Ngôn ngữ chính
- Python
- Star
- 25
- Fork
- 25
- Merge trung bình
- 5 giờ 40 phút
- Pull request đã merge (30 ngày)
- 66
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của lanl/PyBNF
-
bug silent-incorrectness
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug silent-incorrectness
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug silent-incorrectness
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
webrecorder/warcio#209 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Jeffy123-zhu/logspecter#20 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày