Result.check() does not check forward sensitivities: a tolerance move per column, a difference quotient, and AMICI where it is installed
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 12/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- testing-qa
Research direction
Start from Result.check() and _rerun.py, which already repeat sensitivity settings. The design needs three tiers: a per-column tolerance move, a difference quotient, and an optional AMICI cross-check via parity_checks/amici_parity/_amici_sens.py. Done means a sensitivity verdict, named not_resolved columns, closed-form tests such as A' = -kA, and bngsim check exiting 6 on a diff.
Written by the indexing model from the issue text.
Description
Result.check() (#1707) judges a run's species and observables. It does not judge its forward sensitivities. A run with sensitivity_params= or sensitivity_ic= passes check() on its trajectory alone, while its dY/dθ columns go unchecked.
What is already there:
rerun()repeats a run's sensitivity settings (sensitivity_params,sensitivity_ic,sensitivity_method;_rerun.py), so the tolerance and grid reruns already compute the sensitivities.- It refuses runs whose seed it cannot reproduce:
carry_sensitivitiesanddeclare_ic_sensitivity. - So the reruns compute what is needed, and nothing compares it.
Proposal: a sensitivity check, in three tiers
- Tolerance move, on by default for a sensitivity run. The same rerun at
rtol/10,atol/10is judged per sensitivity column, as species are now.- Each column needs a scale of its own. A raw
dY/dθmixes units across parameters, so use its peak, or the scaled(θ/y)·dY/dθthat #1883 proposes for the digest. - It also needs a resolution rule like
not_resolved. CVODES's sensitivity error test uses its own atol per column (#177, #213), so a column near zero, or one held by the error floor, must be named as not resolved, not failed. - Mind
check()'s lesson: no global share cut. A small column beside a large one has to be judged at its own scale.
- Each column needs a scale of its own. A raw
- Difference quotient (
"all"): perturb each parameter, run again, and compare against the forward sensitivities.- Size the step for noise as #76 and #123 do; the notes on the FD oracle apply.
- Both sides use the same model reader, so this checks the sensitivity solve, the RHS and the seeds, not the reading. That is where most sensitivity bugs here have been (#1799, #1801, #1805, #1825).
- The FD reference is half the jump at a switch time (#368). A run whose switch times move with the parameters must skip or widen near them, not report a difference.
- Cost is one rerun per parameter, so
budget=must bound it, withtimeoutfor the parameters that do not fit, as now.
- AMICI as a second engine (
"all", and only whereimport amicialready works). Otherwise skip with a note, assecond_engineskips without libRoadRunner.- Reuse
parity_checks/amici_parity/_amici_sens.pyand its dispositions (AMICI_KNOWN_ISSUES.md). - Not an extra: AMICI compiles C++ per model (SWIG, a C++ toolchain, BLAS; about 20 s cold, 150–220 s for large models). It needs Python 3.12 or later. The release on PyPI (1.2.0) has the event regression that made the parity pin a main-branch commit (
AMICI_PIN.json), and PyPI metadata cannot carry that pin. - The report should name the AMICI version and say the result was compared with a release the parity suite does not pin.
- Reuse
Out of scope
- Steady-state sensitivities (#1474) and fit gradients; a later tier could reuse the same per-column rule.
- Making AMICI a dependency or an extra.
Done when
check()on a forward-sensitivity run reports asensitivityverdict per tier.- A per-column worst case and
not_resolvedcolumns are named. - Tests use closed-form sensitivities as the oracle, for example
A' = -kA, wheredA/dk = -t·A0·e^{-kt}. - A mutation pass shows each tier can fail.
bngsim check(#1891) exits 6 on a sensitivity diff, with no further change.
Part of #1710
- Dominant language
- Python
- Stars
- 3
- Forks
- 6
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 295
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lanl/bngsim
-
testing
Difficulty 1/5 Under an hour Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
bug correctness concern
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
bug latent bug low priority
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
benchmarks/README: 'perl BNG2.pl model.bngl' runs the whole protocol, not just generate_networkOpendocumentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
software-mansion-labs/Diplomat#20 ·
Maintainers usually reply within 1 day
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPossibly taken @lijy91 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainers usually reply within 1 day
-
View Counts discarded due to field name mismatchPossibly taken @rsiva0400 claimed this today. Opensite-bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Model version publishes the new UK firm entity as a personPossibly taken @vahid-ahmadi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PolicyEngine/policyengine.py#764 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
spcl/HPCAgent-Bench#264 ·
Maintainers usually reply within 1 day