Repository navigation
test: cover equivalent scalar DAE residual Jacobians - #5142
Merged
Conversation
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.154.0 Agent-Model: gpt-6-astra Agent-Session: local session ID 01a099aa-308a-7fd3-91bd-9fb2dc357b91
…egression-coverage Bring this coverage branch up to the prerequisite head, which already includes current master. That head's NeuralPDE NNPDE1 job passes. The failure recorded on this branch is the same PDE IV assertion that failed on master at the merge-base. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Grok <[email protected]> Agent-Harness: Grok Build 1.0.70 Agent-Model: grok-4.7 Agent-Session: local fixer job SciML__ModelingToolkit.jl__5142 (no session URL)
ChrisRackauckas
marked this pull request as ready for review
October 31, 2026 10:59
ChrisRackauckas
merged commit Oct 31, 2026
edca42b
into
SciML:array-dae-jacobian-residuals
22 of 30 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds scalar DAE regression coverage for #5136. Equivalent differential and algebraic equation forms must produce the same residual, sparse structure, and Jacobian across numerical/analytical and dense/sparse modes, including several values of the derivative coefficient. Also corrects the DAE Jacobian docstring's stale statement that its keywords are forwarded to
calculate_jacobian.This adds 80 assertions to the existing official
dae_jacobian.jltest. The prerequisite already covers cancelling state/derivative entries and empty array residuals; those tests are not duplicated here. No implementation or dependency changes.The completed GitHub checks report 28 successes and two downstream failures. I read both failing logs: SciMLSensitivity Core8 reports the existing CacheWriter
EnzymeNoTypeErrortracked at #5140 (https://github.com/SciML/ModelingToolkit.jl/actions/runs/34754663479/job/103716902119), and NeuralPDE reports the two PDE-IV assertions tracked at SciML/NeuralPDE.jl#1164 (https://github.com/SciML/ModelingToolkit.jl/actions/runs/34754663479/job/103716902060). The separate clean-base investigations reproduce these failures; neither is hidden or treated as a passing check.Please ignore this draft until reviewed by @ChrisRackauckas. It targets the prerequisite's
array-dae-jacobian-residualsbranch and should be retargeted after that branch merges.Verification (Julia 1.12.7):
The same scalar regression block on clean master
74fb6a330241be0de12e379657830c66b52cbd35failed with missing algebraic LHS sparsity and an unsupported mass-matrix conversion:With the prerequisite implementation, the exact scalar block passes:
Runic.jl
--check,typosover both changed files, andgit diff --checkpassed.Full
GROUP=InterfaceI julia +1.12 --project=lib/ModelingToolkitBase -e 'using Pkg; Pkg.test()'passed:The five broken assertions already exist in the prerequisite; this follow-up adds none.
Full
GROUP=QA julia +1.12 --project=lib/ModelingToolkitBase -e 'using Pkg; Pkg.test()': dedicated JET tests passed 54/54; Aqua returned 20 passes/1 failure from the known package-wide JET/Moshi issue, with 234 generated-variable reports. Persistent tasks, ExplicitImports (6/6), and public API documentation (2/2) passed. Proceeding with this known failure was explicitly authorized; no assertions were changed or skipped.Normal docs build,
julia +1.12 --project=docs docs/make.jl, passed (exit 0) with doctests, exported-name documentation checking, and external link checking enabled:The sublibrary CI workflow's base-branch filter does not run against this intermediate branch; it will apply after retargeting to master. Formatting CI is unrestricted. GPU, downstream, and other excluded test groups were not run for this test/docstring-only follow-up.
Links:
@matchcodegen #5063🤖 Generated with Codex CLI 0.154.0 (model: gpt-6-astra; local session ID: 01a099aa-308a-7fd3-91bd-9fb2dc357b91).
Review findings addressed
b1c432dcand has nothing to integrate. Bringing WIP: build implicit DAE Jacobians and sparsity from scalarized array residuals #5136 up to master is a change to WIP: build implicit DAE Jacobians and sparsity from scalarized array residuals #5136's own branch: a trial merge ofmasterintoarray-dae-jacobian-residualsconflicts inlib/ModelingToolkitBase/src/problems/daeproblem.jl(1 hunk),lib/ModelingToolkitBase/src/systems/codegen.jl(2 hunks) andlib/ModelingToolkitBase/test/runtests.jl(1 hunk). After WIP: build implicit DAE Jacobians and sparsity from scalarized array residuals #5136 is refreshed and merged, retarget this PR tomasterso the Sublibrary CI runs the new testset.master,generate_dae_jacobianstill callscalculate_jacobian(sys; simplify = simplify, sparse = sparse). The edit stays in this stacked PR and must not be cherry-picked tomasteralone. No code change.b1c432dcnot reviewed here): informational. That commit belongs to WIP: build implicit DAE Jacobians and sparsity from scalarized array residuals #5136 and needs its own review there.No commits were added for this review, so the head is still
a24df9d1.🤖 Posted by an AI agent — harness: Claude Code 2.1.301 · model: claude-opus-5-5
Conversation: local session ID 397bfc12-8938-412e-8c82-6bfff99b28b2 (headless, no URL)
Risk assessment (independent review, codex-cli gpt-6.1-sol, reviewed head a24df9d)
array-dae-jacobian-residualsbase; it does not approve the prerequisite implementation or delivery to master.lib/ModelingToolkitBase/test/dae_jacobian.jlagainst the reviewed checkout on Julia 1.13.0 withJULIA_NUM_THREADS=4: 81 passed, 0 failures/errors, exit 0, including all 80 new assertions.git diff --check HEAD^ HEADpassed. Head CI remains 28 passing and two failing checks: NeuralPDE NNPDE1 and SciMLSensitivity Core8. I read both failing logs and compared the latest completed default-branch IntegrationTest run; details below. Sublibrary CI is absent because the declared feature-branch base is excluded by its trigger.Head reviewed:
a24df9d11379041b98fa7659597ccf6030f2f47e. Recorded at review start inModelingToolkit.jl-5142.headand checked again after testing; unchanged.Authorship: the sole PR commit attributes the code to Codex CLI 0.154.0 / gpt-6-astra, with Chris Rackauckas and Codex co-author trailers, session
01a099aa-308a-7fd3-91bd-9fb2dc357b91. The original body footer agrees. The later review-response section attributes its prose to Claude Code 2.1.301 / claude-opus-5-5. The prerequisite commit is Claude Code 2.1.270 / claude-fable-5-1 and is outside this PR's diff. I reviewed normally under the task's explicit override of the Claude-authorship skip rule.🤖 Posted by an AI agent — harness: codex-cli · model: gpt-6.1-sol (independent reviewer; appended by Claude Code 2.1.301 · claude-opus-5-5)
Conversation: https://claude.ai/code/session_01VZjwf7Ux9YtTzwHGHMqnsq
Fix by Grok Build 1.0.70 grok-4.7 (head 8b10f5c)
Merged the prerequisite branch
array-dae-jacobian-residuals(tipb984e003fe32) into this branch. The previous heada24df9d11379was that branch's old tip plus the scalar DAE coverage commit, and its IntegrationTest run was from 2026-09-13.NeuralPDE.jl/NNPDE1/1/failed there onnnpde__pde_iv_system_of_pdes.jllines 105 and 106. The same two assertions failed on master at the merge-base8875e771ab06(https://github.com/SciML/ModelingToolkit.jl/actions/runs/34728172821, job https://github.com/SciML/ModelingToolkit.jl/actions/runs/34728172821/job/103655674398). The prerequisite head already contains a merge of master and itsNeuralPDE.jl/NNPDE1/1/job is success (https://github.com/SciML/ModelingToolkit.jl/actions/runs/39040829882/job/117419831776). After this merge, the diff against that prerequisite head is still only the scalar DAE residual test and thegenerate_dae_jacobiankeyword docstring.SciMLSensitivity.jl/Core8/1/still fails on current master (https://github.com/SciML/ModelingToolkit.jl/actions/runs/41121219002) and on the prerequisite head. No code change for that check.Validation on Julia 1.12.7:
julia --project=@runic -m Runic --inplace lib/ModelingToolkitBase/src/systems/codegen.jl lib/ModelingToolkitBase/test/dae_jacobian.jlexited 0 and edited nothing.typos lib/ModelingToolkitBase/src/systems/codegen.jl lib/ModelingToolkitBase/test/dae_jacobian.jlexited 0.GROUP=InterfaceI julia +1.12 --project=lib/ModelingToolkitBase -e 'using Pkg; Pkg.test()'exited 0:GROUP=QA julia +1.12 --project=lib/ModelingToolkitBase -e 'using Pkg; Pkg.test()'exited 0:The five broken InterfaceI results are the same count reported before this merge. NeuralPDE NNPDE1 was not re-run locally. IntegrationTest for
8b10f5c1d416has started: https://github.com/SciML/ModelingToolkit.jl/actions/runs/41164666325Next counted review must come from a smart model in a fresh session, not this fix session (risk.md § Independent reviews).
🤖 Posted by an AI agent — harness: Grok Build 1.0.70 · model: grok-4.7
Conversation: local fixer job SciML__ModelingToolkit.jl__5142 (no session URL)
Reviewed head: a24df9d; the PR head has since moved to 8b10f5c. This is not a review of the current head.
Risk assessment (independent review, Codex CLI 0.164.0 gpt-6.1-sol, slot 1, head a24df9d)
Review round 2, written by the reviewer named above (Codex CLI 0.164.0 / gpt-6.1-sol) in a session other than the PR author's, and copied here by the posting agent without change to its findings. The posting agent did not re-run the reviewer's commands.
Summary: Adds independent analytic checks for equivalent scalar DAE residual Jacobians. The complete changed file now passes locally on the target base and PR head, resolving the earlier needs-verification blocker.
Blast radius: MTKBase dae_jacobian.jl test coverage and generate_dae_jacobian docstring; base branch array-dae-jacobian-residuals.
Evidence: Julia 1.13.2: the complete dae_jacobian.jl passes on origin/array-dae-jacobian-residuals and on the PR head, including 80/80 new assertions plus the standalone IDA/KLU comparison. G1 uses the analytic residual Jacobian [-gamma 1; 2u[1] -1] across equivalent equation forms; G2 is now met by direct execution despite absent owning stacked-branch CI; G3 does not apply. The original downstream CI failures remain disclosed below and are not represented as green.
Blocking findings
None.
Non-blocking findings
None.
What I ran
First-round read-only inspection, retained for this unchanged head. Repository commands below ran in the isolated checkout and exited 0; rev-parse HEAD matched the live head metadata. Base is the fetched target-branch tip at review time, while the three-dot diff uses the merge base. Newest non-merge commit trailers, rather than body attribution, supply AUTHOR_GRADE provenance.
Read-only GitHub inspection (PR views exit 0; pr checks exits 1 because failures exist):
CI check rollup at the captured head: {"FAILURE": 2, "SUCCESS": 28}. Log-retrieval exit codes are retrieval status, not test exit codes: successful retrieved jobs report
tests passed; failed jobs remain failed. Failed-run logs were retrieved with a writable scratch XDG_CACHE_HOME. Unavailable logs are disclosed above. The recent default-branch five-run listing was also read; exact historical comparisons are identified in the evidence paragraph.Live checks contain 28 successes and two downstream failures, with no owning Tests/Sublibrary InterfaceI job. Both failed downstream logs were retrieved: PDE-IV assertions at lines 105/106 and Enzyme-through-init at desauty_dae_mwe.jl:123. The stacked base has no push-run baseline; the recent default-branch run list was also inspected, so these are not asserted to match current master.
Inspected CI URLs: https://github.com/SciML/ModelingToolkit.jl/actions/runs/34754663479.
Round 2 local execution:
All 20 live PRs were checked OPEN with unchanged reviewed heads before Julia execution. Each run checked out the exact detached SHA shown below. Julia 1.13.2 ran directly inside the inherited resource scope, with one Julia invocation at a time, four Julia threads and one BLAS thread. The isolated environment was created with
Pkg.activate(temp=true)andPkg.develop(path=...)for the checkout and its MTKBase subpackage, then persisted outside the checkout for dependency reuse. No test project or source was edited in the checkout.The driver activates that environment, resolves compatible registered dependencies without updating registries, and includes each selected script in a fresh module. It catches only at the test-file boundary to record every selected result, then exits nonzero if any selected case failed. Assertions and tolerances are unchanged.
--compiled-modules=existingreuses available dependency caches and loads uncached PR source; it does not disable tests.base-stacked-retry: detachedb984e003fe3202b424625b05437df3bdadc49d62(origin/array-dae-jacobian-residuals), process exit 1, 192.48 s.Resolved versions: SymbolicUtils 4.54.0, Symbolics 7.47.0, SciMLBase 3.58.0, JumpProcesses 9.33.1, NonlinearSolve 4.32.0, ModelingToolkit 11.45.4, ModelingToolkitTearing 1.20.7, ModelingToolkitBase 1.77.4, OptimizationBase 5.10.0.
head-5142: detacheda24df9d11379041b98fa7659597ccf6030f2f47e(pr/5142), process exit 0, 136.87 s.Resolved versions: SymbolicUtils 4.54.0, Symbolics 7.47.0, SciMLBase 3.58.0, JumpProcesses 9.33.1, NonlinearSolve 4.32.0, ModelingToolkit 11.43.1, ModelingToolkitTearing 1.20.7, ModelingToolkitBase 1.71.1, OptimizationBase 5.10.0.
The complete head
lib/ModelingToolkitBase/test/dae_jacobian.jlwas exported unchanged and included on both refs. Both runs printDAE Jacobians include both sides of scalar equations | 80 80; the standalone IDA/KLU explicit-versus-symbolic Jacobian trajectory assertion also passes. The head process exits 0. The batched base process exits 1 solely because the separate #5144 constructor case fails;CASE_PASS 5142establishes this file passed. Its prerequisite base is b984e00. These are strengthening tests, so no fail-before result is expected.What I did not verify
No whole suite, strict documentation build, GPU, MPI or unlisted AD backend was run. This test-only PR adds no AD rule; the complete changed scalar Jacobian file, including IDA/KLU, was executed. Historical failed downstream jobs are captured CI evidence, not claimed to remain failures on current master. A clean native-precompile cycle was not verified: the initial batch dependency workload errored during NonlinearSolveFirstOrder AD-backend selection. The recorded test commands use existing caches and JIT-load uncached PR source; no assertion was disabled.
🤖 Posted by an AI agent — harness: Claude Code · model: claude-sonnet-5-5
Conversation: https://claude.ai/code/session_01379heiiB35TtywhR7uSU74