Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem 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

Đã đóng
#830 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ả

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.

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của lanl/PyBNF

Tất cả issue của lanl/PyBNF

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.