Repository navigation
tests: pin the steady state the two unmended quotients reach from a jump; warn on another SUNDIALS (#1335) - #1352
Conversation
…ump; warn on another SUNDIALS (lanl#1335) KINSOL's difference quotient (method="newton", jacobian="fd") and the steady-state march's colored sparse one (forced KLU) have no mend for a step across a jump, and nothing pinned that they need none. They now start on a threshold and 1e-9 either side of it, and beside a species held at 0, and are checked against closed forms on each path, each test asserting the path it took. All pass on main: no wrong answer, as lanl#1302 found. dq_jacobian.hpp reproduces the vendored CVODE 7.2's dense quotient. A configure against a system SUNDIALS of another release now says so, and docs/installation.md documents it, in place of a CI leg.
|
Thanks. We reviewed this independently, Opus 5.5 and Fable 5.1, each on our own build of c4e8d10 (already on main c0877fa), on macOS arm64 with KLU on. We found no defect in what it changes:
Three medium points are about what the new tests claim against what they run. Four low ones follow. What we checked is first, so it needn't be redone. What we checked
1. The KINSOL threshold rows don't form KINSOL's quotient near the jump
The held-at-zero rows do reach KINSOL beside the held species. Started on the threshold directly, KINSOL passes: We'd suggest the threshold rows use that call, so they pin KINSOL's own quotient. 2. "KINSOL, KLU" is the burst on KLU, then KINSOL denseKINSOL's polish always builds a So this row isn't "KINSOL on KLU", as the section comment and the body describe it. On all 8 models it gives the same result bits and the same counters as "KINSOL, dense", and differs only in Underneath, and pre-existing: with 3. The rows can't see a broken colored quotientAs pins of the march's colored quotient, they have little power:
The solver's counts do see the negated quotient, though. Against the restored build:
A per-row budget on Low
Not checked: a real system SUNDIALS of another release (we edited the version file instead), a mutation of KINSOL's own vendored difference quotient, and Linux or Windows beyond CI. |
… release check best-effort (lanl#1335) Review follow-up on the steady-state rows: - The threshold and held-at-zero rows reach KINSOL from the given state (newton_burst=False), as the default newton's burst carried them into the root's basin first. The KLU row is named for what it runs, a burst on the colored quotient and then KINSOL's dense polish. - The colored-march rows also hold the march to 350 RHS evaluations: it takes at most 236 with the right quotient and at least 414 with it negated, where every threshold row still lands on its root. - The roots are held to 1e-12, with the reason: each is exact here. - CMake: a missing or tag-less VENDOR.json skips the release check with a note instead of failing the configure, and an unset system version is named as unreported. The changelog and installation.md say major.minor, and solvers.md points to the installation note.
|
Following up on our review above: we've pushed its items 1–7 as one commit on top, e699834, and are merging now that CI is green. The configure warning and the docs note stand as you wrote them. The commit changes what the tests run and assert, makes the check best-effort, and says major.minor in the docs. What the commit changes
What we checked
Not changed here: with |
Closes #1335.
#1335 lists three paths that #1302 (#1002) left without a test or a decision. No wrong answer was known on any of them, and this PR finds none. It pins each one and documents the third.
1 and 2: the two steady-state quotients with no jump mend
#1302 mends a difference-quotient row whose step crosses a jump for runs (dense and colored) and for the dense steady-state march. Two quotients were left as they were:
method="newton"withjacobian="fd". A declined law sendsnewtonto the march instead, so that path is reached only with"fd".New tests in
test_difference_quotient_jump.pyrun each path, plus KINSOL on KLU, from:X' = s − kx·k(X)·Xwithk = 0.04above 5 and0.02at or below. With s = 0.08 the one steady state is X = 4, below the threshold; with s = 0.4 it is X = 10, above;Each is checked against its closed form (
< 1e-4relative, the file'sOK), and the held species against exactly 0.Each test also asserts the path it took:
method_used,linear_solver(dense/klu) andsolver_jacobian_source == "finite-difference". Prototyping showed why that matters: with a declined law,method="newton"silently converges by the march instead, and would have "tested" KINSOL without touching it.The KLU paths skip on a KLU-off build, with the reason
conftest.pyalready declares.These pin the current behaviour rather than fix a defect. They are the "nothing pins that" #1335 asks for, and they agree with #1302's 72 and 24 variants that found no wrong answer.
3: SUNDIALS other than the vendored 7.2
include/bngsim/dq_jacobian.hppreproducescvLsDenseDQJacof the vendored SUNDIALS (v7.2.1) bit for bit. With-DBNGSIM_USE_SYSTEM_SUNDIALS=ONand another release, it is still a valid quotient, but not necessarily that release's own. #1335 asks for a CI leg or a documented refusal. This does the documented half:CMakeLists.txt: in the system-SUNDIALS branch, compareSUNDIALS_VERSION's major.minor withVENDOR.json'sauthoritative_release_tag, and warn on a mismatch:docs/installation.md: the same note besideBNGSIM_USE_SYSTEM_SUNDIALS.Verified by running the block in
cmake -PwithSUNDIALS_VERSIONset to each of these:The default (vendored) configure does not enter the branch. Every CI leg uses the vendored path, so the full configure is exercised there.
A warning, not a refusal: a system SUNDIALS of another 7.x is supported (
find_package(SUNDIALS 7.0 …)), and refusing it would drop HPC builds that link a site SUNDIALS.Measured
test_difference_quotient_jump.pywith the new cases, plustest_skip_audit.py,test_ci_run_list_coverage.pyandtest_docs_api_examples.py: 120 passed.