Check whether the bngsim SBML backend's sensitivity warm-up (#543) serves a stale chain rule when a condition or fitted value writes a derived parameter (lanl/bngsim#708)
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Read pybnf/bngsim_sbml_model.py, focusing on _warm_engine_template and _set_engine_value_if_present, then compare the proposed SBML case with #937's sensitivity test. Build an initialAssignment model with a condition or fitted value targeting the derived parameter, and compare gradients with and without the warm against independent scipy integration. Done means the stale-chain-rule behavior is confirmed or ruled out and, if affected, the required sensitivity-construction change is identified.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The bngsim SBML backend warms its cached engine template with a sensitivity Simulator (#543, _warm_engine_template in pybnf/bngsim_sbml_model.py). Every per-action clone then inherits that compiled sensitivity RHS, because the action's own Simulator does not ask for codegen=True. If an action then writes a derived parameter on the clone, one whose value bngsim computes from other parameters (an SBML parameter set by an initialAssignment, for instance), the inherited sensitivity RHS keeps the chain rule it was compiled with, and bngsim does not check (lanl/bngsim#708). The gradient would then be wrong, with no error.
This is not measured here; it needs checking. #937 measured and fixed exactly this on the .net backend: on k2 = 2*k1 with k2 pinned by a condition, inheriting gave max|dA/dk1| = 1.43 against a closed form of 0. There, every sensitivity construction now passes codegen=True. #937 listed the SBML backend under "Not examined".
The path
_warm_engine_templatebuildsbngsim.Simulator(template, method='ode', **sensitivity_kwargs)on the process-cached template once, so the template carries a sensitivity artifact (_template_is_warm).- Each action clones the template and builds its own
Simulatorwithoutcodegen=True, so bngsim reuses the inherited artifact (sensitivity artifacts are reusable across sensitivity runs; only a plain one is refused, lanl/bngsim#209). _set_engine_value_if_presentcallsengine_model.set_param(name, value)on the clone for every global parameter a fitted value or a condition targets, derived ones included.
The warm's docstring reports tensors "bit-identical either way" on the Smith and yeast models. Those checks did not include a condition or fitted value that overrides a derived parameter, which is the only case #708 affects.
How to check
A positive control in the shape of #937's test_a_sensitivity_run_is_not_served_a_stale_chain_rule: an SBML model with k2 set by an initialAssignment 2*k1, driving A -> B. Add a condition (or fitted value) that pins k2, then compare the gradient d(A)/d(k1) under that condition against finite differences of an independent integration (scipy), with and without the warm.
One complication: lanl/PyBNF#865 drops a condition that sets an initialAssignment target whenever a free parameter feeds an initialAssignment, which may mask this in some configurations. The check should cover a configuration #865 does not drop, or run after #865 is fixed.
If affected
Do what #937 did: pass codegen=True on every sensitivity construction, accepting bngsim's structural cache-key cost per action (lanl/bngsim#820 would make that cheap). Alternatively, wait for lanl/bngsim#708's fix (recompute and compare the key on artifact reuse). The plain-run warm is unaffected either way: a plain RHS reads parameter values at run time.
- Ngôn ngữ chính
- Python
- Star
- 25
- Fork
- 25
- Merge trung bình
- 4 giờ 5 phút
- Pull request đã merge (30 ngày)
- 10
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
Độ 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
-
bug minor
Độ 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
-
bug tech debt
Độ 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 minor
Độ khó 2/5 1-3 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
-
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 74/100
software-mansion-labs/Diplomat#20 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaCó thể đã có người làm @lijy91 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
View Counts discarded due to field name mismatchCó thể đã có người làm @rsiva0400 đã nhận hôm nay. Đang mởsite-bug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Model version publishes the new UK firm entity as a personCó thể đã có người làm @vahid-ahmadi đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
PolicyEngine/policyengine.py#764 ·
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 70/100
spcl/HPCAgent-Bench#264 ·
Maintainer thường phản hồi trong vòng 1 ngày