Skip to content

Color J's pattern for separated DAE Jacobians under AutoSparse - #4864

Open
xtalax wants to merge 7 commits into
SciML:masterfrom
xtalax:dae-autosparse-pattern
Open

xtalax wants to merge 7 commits into
SciML:masterfrom
xtalax:dae-autosparse-pattern

Conversation

@xtalax

@xtalax xtalax commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Summary

DFBDF(; autodiff = AutoSparse(...)) on an in-place DAEProblem failed at the first Jacobian evaluation whenever the sparsity pattern of ∂F/∂du differed from that of ∂F/∂u. Every DAE with an algebraic equation falls into that case, because an algebraic row has no du entry. The error was a FirstAutodiffJacError wrapping DimensionMismatch: A and bg.S2 must have the same sparsity pattern. from SparseMatrixColorings, raised in calc_J_dae!.

This PR makes the two separated DAE Jacobian configs color the pattern of the matrices they decompress into.

Reproducer

using OrdinaryDiffEqBDF, ADTypes, SparseConnectivityTracer, SparseMatrixColorings
function f!(res, du, u, p, t)
    res[1] = du[1] - u[2]
    res[2] = du[2] + u[1]
    res[3] = u[3] - u[1]
end
prob = DAEProblem(f!, [0.0, -1.0, 0.0], [1.0, 0.0, 1.0], (0.0, 1.0); differential_vars = [true, true, false])
sad = AutoSparse(AutoForwardDiff(); sparsity_detector = TracerSparsityDetector(), coloring_algorithm = GreedyColoringAlgorithm())
solve(prob, DFBDF())                    # Success, u[1](1) ≈ cos(1)
solve(prob, DFBDF(; autodiff = sad))    # DimensionMismatch on master; Success with this PR

Cause

In build_nlsolver, the separated DAE Jacobian cache builds jac_config_u from DAEJacobianUWrapper and jac_config_du from DAEJacobianDuWrapper through build_jac_config. Under AutoSparse, each one detects and colors its own pattern. The storage they decompress into is J itself (for J_u) and fill!(similar(J), false) (for J_du). J's pattern comes from the combined residual wrapper (DAEResidualJacobianWrapper), so it is the union of the ∂F/∂u and ∂F/∂du patterns. SparseMatrixColorings decompresses only into a matrix with exactly the pattern it colored, so both jacobian! calls in calc_J_dae! fail as soon as either partial pattern is a strict subset of the union. In the reproducer, both are.

Fix

A small helper, with_jac_sparsity(alg, J), returns alg with its AutoSparse backend rebuilt around KnownJacobianSparsityDetector(J). It keeps the user's dense backend and coloring algorithm. Both separated configs are prepared with it, so they color exactly the pattern of their storage. Coloring the union is still exact, and W = J_u + cj * J_du needs the union pattern anyway. The cost is at most a few extra colors compared with coloring each partial pattern on its own. The helper does nothing unless the backend is AutoSparse and J is a SparseMatrixCSC, so the dense, finite-difference, matrix-free and user-Jacobian paths are unchanged.

The out-of-place path (DAEJacobiansConstantCache) was not affected. It calls DI.jacobian without a preparation and assembles W from freshly allocated matrices, and the new test covers it.

The resize path (resize_J_W!) keeps the existing jac_config_u/jac_config_du, as before. DFBDF resizing is handled separately in #4809.

Tests

The new file lib/OrdinaryDiffEqBDF/test/dae_autosparse_tests.jl is registered in the BDF Core group. It covers three problems: the reproducer (in-place and out-of-place), and a heat-equation DAE with algebraic Dirichlet end nodes plus a long-range du coupling, so that ∂F/∂du has entries outside ∂F/∂u's band. Each one is compared against dense DFBDF() at abstol = reltol = 1e-10. For the in-place problems, the test also checks that J and J_du are SparseMatrixCSC. On master the file errors with the DimensionMismatch above. With this PR all 14 tests pass.

Real-world check

This was run on TinyFDTD.jl's tfsf1d_problem(; dx = 0.05), a 2,613-state MethodOfLines DAE. Options were abstol = reltol = 1e-8, dtmax = 0.025, saveat = 0.1 and initializealg = NoInit() (to bypass #4544). Timings are second runs on a shared, loaded workstation.

Wall time njacs nf
DFBDF(; autodiff = AutoSparse(...)) 1.153 s 1 474
DFBDF() (dense) 5.56 s 1 5,686

The sparse J is a SparseMatrixCSC with 6,018 stored entries. The maximum absolute difference between the two final states is 5.7e-14. On master the sparse solve fails with the DimensionMismatch above.

Sublibrary test groups (run locally, Julia 1.12.6)

  • OrdinaryDiffEqBDF, GROUP=Core: every testset passes, including the new DAE AutoSparse Tests (14/14). DAE Initialization Tests reports 38 passed and 2 broken; both were already marked broken.
  • OrdinaryDiffEqNonlinearSolve, GROUP=Core: Developer API Tests pass (27/27). Newton Tests then errors at newton_tests.jl:14 with LineSearchException: Search direction is not a direction of descent (Trapezoid with NLNewton(relax = BackTracking())). This is pre-existing on master and targeted by fix NLNewton BackTracking when FD residual-norm slope is noisy #4714. That file has no DAE or AutoSparse code, so it never reaches the changed path. The NonlinearSolve Core CI job is therefore expected to fail on that test, independent of this change.
  • The rest of the NonlinearSolve Core group: because that error aborts Pkg.test before the later testsets start, each later Core file was run individually, in its own @safetestset, in the lib's test environment, in runtests.jl order. The repository was left untouched. Result: 981 passed, 5 failed, 40 broken, all files and failures listed below.
    • Callable Predictor 63, Sparse DAE Initialization 33, Linear Nonlinear Solver 56, Linear Solver 113, Linear Solver Split ODE 10, Default Krylov Preconditioner 5, W-Operator Prototype 14, DAE Initialization 19, CheckInit 4, Nested AD over NonlinearSolveAlg 5, Homotopy Nonlinear Solver 38, Homotopy init default_nlsolve 16, and the NonlinearSolveAlg Sparse Jacobian 10, Matrix-Free WOperator 14, Split W (LHL) 20, Krylov Tolerance 13, Smoothed Error Estimate 10, Stale W Reuse 16, Stats 39, Polyalgorithm Inner Solver 8, Preconditioning 74, Residual Convergence 13, DAEProblem 32 and nlstep_data Field 11 testsets all pass.
    • Mass Matrix Tests: 227 passed, 40 broken (already marked).
    • NonlinearSolveAlg Jacobian Reuse Tests: 20 passed, 1 failed at nsa_jacobian_reuse_tests.jl:66 (sol.stats.naccept < 1.25 * ref.stats.naccept, evaluated as 45869 < 44710.0).
    • NonlinearSolveAlg No-Init Inner Solver Tests: 98 passed, 4 failed at nsa_noinit_tests.jl:78 (successful_retcode for functional matrix: rober-mm iip).
    • Those 5 failures are pre-existing. Running both files on unchanged master (ab07f5d) gives the same 5 failures with identical values (45869 < 44710.0, and the same four rober-mm retcode failures). Both are mass-matrix ODE tests on the NonlinearSolveAlg path, which this change does not touch.

The changed files pass Runic --check. GROUP=QA for OrdinaryDiffEqNonlinearSolve passes locally (Aqua 41/41 including ExplicitImports, JET 13 passed + 33 broken), after is_sparse_csc was added to the ExplicitImports ignore list.

Versions

There is no version bump, following the repo's convention of separate release PRs. The fix uses OrdinaryDiffEqDifferentiation.is_sparse_csc, which predates the current OrdinaryDiffEqDifferentiation = "3.10" compat bound, so no compat change is needed. OrdinaryDiffEqBDF gains SparseConnectivityTracer and SparseMatrixColorings as test-only dependencies.

Related

🤖 Posted by an AI agent · harness: Claude Code 2.1.296 · model: claude-opus-5-5
Review: unreviewed
Session: aa65e380-52df-443a-9f57-8c20c56babb9

DFBDF with an AutoSparse backend failed on the first Jacobian of any
in-place DAEProblem whose dF/du and dF/d(du) sparsity patterns differ,
which covers every DAE with an algebraic equation. The separated DAE
Jacobian cache prepared jac_config_u and jac_config_du on their own
wrappers, so each detected and colored its own pattern, while both
results are stored in J's pattern (J_u is J, and J_du is similar(J)).
J's pattern is the union of the two, since it comes from the combined
residual wrapper. SparseMatrixColorings decompresses only into the exact
pattern it colored, so jacobian! threw "A and bg.S2 must have the same
sparsity pattern".

Prepare both configs with a KnownJacobianSparsityDetector over J, keeping
the dense backend and coloring algorithm of the user's AutoSparse.
Coloring the union is still exact; it can cost a few extra colors. The
out-of-place path calls DI.jacobian without preparation and returns
fresh matrices, so it was not affected.

Agent-Harness: Claude Code 2.1.296
Agent-Model: claude-opus-5-5
Agent-Session: aa65e380-52df-443a-9f57-8c20c56babb9
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
The DAE AutoSparse fix imports OrdinaryDiffEqDifferentiation.is_sparse_csc, which is not public, so all_explicit_imports_are_public flagged it. Add it to the ignore list next to the other OrdinaryDiffEqDifferentiation internals.

Agent-Harness: Claude Code 2.1.296
Agent-Model: claude-opus-5-5
Agent-Session: aa65e380-52df-443a-9f57-8c20c56babb9
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent — not written or reviewed by Chris Rackauckas.

Fresh independent review of 599974d484220f881c85111be157b1c33420d767: CHANGES, medium-low ML2, with an analytic correctness blocker.

A known CSC sparsity pattern may contain stored zeros. With three stored zero entries and no function jac_prototype, the pattern colors as [1,2], but the allocated J has zero stored entries. Preparing both Jacobians from that empty allocation lets this DAE return Success with [1.0000000000000018, 1.0000000000000018] at t=0.4; its analytic value is [exp(-0.4), exp(-0.4)] = [0.6703200460356393, 0.6703200460356393]. The absolute error is 0.32967995396436245.

The reviewer executed this model on the exact head and on the head with the merged sparse-prototype prerequisite; both fail the analytic assertion. Current master rejects the incompatible storage with DimensionMismatch. The silent wrong result also reproduces with minimum SparseMatrixColorings 0.4.23.

using OrdinaryDiffEqBDF, ADTypes, SparseArrays, SparseMatrixColorings, Test
import SciMLBase, OrdinaryDiffEqDifferentiation
function decay!(r,du,u,p,t)
    r[1] = du[1] + u[1]
    r[2] = u[2] - u[1]
    nothing
end
P=sparse([1,2,2],[1,1,2],[0.,0.,0.],2,2)
backend=AutoSparse(AutoFiniteDiff();sparsity_detector=ADTypes.KnownJacobianSparsityDetector(P),coloring_algorithm=GreedyColoringAlgorithm())
prob=DAEProblem(decay!,[-1.,-1.],[1.,1.],(0.,0.4);differential_vars=[true,false])
sol=solve(prob,DFBDF(autodiff=backend);initializealg=SciMLBase.NoInit(),abstol=1e-10,reltol=1e-10)
println("RESULT retcode=",sol.retcode," final=",sol.u[end]," expected=",fill(exp(-0.4),2)," error=",maximum(abs,sol.u[end].-exp(-0.4)))
@test SciMLBase.successful_retcode(sol)
@test sol.u[end] ≈ fill(exp(-0.4),2) atol=1e-7 rtol=1e-7

Please preserve the complete structural union, including stored-zero entries, in both storage matrices and both preparations, and add the analytic regression plus separated Jacobian-entry assertions. Retain a failure until storage and preparation agree.

A separate public-API blocker is the new OrdinaryDiffEqDifferentiation.is_sparse_csc import and its QA exemption. Executed Base.ispublic returns false. SparseArrays is already a dependency: use its public SparseMatrixCSC type for a local predicate and remove the new exemption, or first publish and document the owner's API.

The intended regression does discriminate: current master errors, head passes 14/14. Official BDF Core passes 814 assertions with two existing broken tests. Those checks do not catch the stored-zero counterexample. Full NonlinearSolve Core stops on its independently reproduced default-branch Newton error; finite-difference/tracer default failure is separately assigned for investigation. GPU execution, TinyFDTD timing, sibling integration, and the ADTypes 1.22 runtime floor were not verified. This is an executed counterexample, not a proposed fix or a GPU result. No author branch was changed.

Two AI-authored commits also omit Chris's required coauthor trailer; please include it when finalizing the branch.

Links:

🤖 Posted by an AI agent — harness: Codex CLI 0.163.0 · model: gpt-6.1-sol.
Independent reviewer: local session 01a15d3a-9dd1-7982-84c8-ce104486744f (no session URL).
Conversation: local session 01a15ca3-5696-7ea3-bbac-ba551b6975af (no session URL).

xtalax and others added 2 commits October 21, 2026 18:29
…rage

A known pattern's stored zeros are structural: the coloring decompresses into
them. build_J_W allocated J by broadcasting the pattern, which drops them, so
the separated DAE configs colored an emptied J and silently skipped
derivatives. Allocate J with the pattern's structure instead, and make the DAE
config setup throw a DimensionMismatch when J cannot hold a known pattern.

Use SparseArrays' public SparseMatrixCSC for the predicate instead of the
non-public is_sparse_csc, and drop its QA exemption.

Agent-Harness: Claude Code 2.1.306
Agent-Model: claude-opus-5-5
Agent-Session: aa65e380-52df-443a-9f57-8c20c56babb9
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@xtalax

xtalax commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

Both blockers are addressed in 67db3ca, which was pushed as a normal fast-forward on top of a merge of master (d2adddd).

Stored zeros in a known pattern.

  • build_J_W used to allocate J with convert.(T, pattern). Broadcasting drops stored zeros, so J lost them. It now uses jac_from_pattern(T, pattern), which is SparseMatrixCSC{T}(pattern) in the SparseArrays extension and keeps the full structure, stored zeros included. This covers both the sparsity_pattern(jac_config) path and the f.sparsity::Bool path, in-place and out-of-place.
  • The separated DAE configs still color J's pattern, so storage and both preparations agree.
  • When the backend's detector is a KnownJacobianSparsityDetector and J doesn't store every entry of that pattern (for example a user jac_prototype that is too small), with_jac_sparsity now throws DimensionMismatch rather than silently skipping derivatives.

Regression test, in dae_autosparse_tests.jl, "Known sparsity pattern with stored zeros":

  • your model verbatim: Success, and u(0.4) ≈ exp(-0.4) at atol = rtol = 1e-7;
  • J, J_du and W store exactly the pattern of P;
  • after the solve, J = [1 0; -1 1] and J_du = [1 0; 0 0];
  • a jac_prototype that misses an entry of the known pattern throws DimensionMismatch at init.

is_sparse_csc. NonlinearSolve now dispatches on SparseArrays' public SparseMatrixCSC, and the QA exemption is removed.

Tests on 67db3ca (Julia 1.12.6):

Group Result
BDF Core 910 pass, 0 fail, 2 broken (pre-existing); DAE AutoSparse 22/22
Differentiation (all groups) all pass
NonlinearSolve QA (GROUP=QA, in-repo Differentiation) Aqua/ExplicitImports 41/41 with no is_sparse_csc exemption; JET 13 pass, 33 broken (unchanged)
NonlinearSolve Core, file by file 27 of 29 files pass

The NonlinearSolve Core failures are the ones that also fail on master:

The commits carry the PR author's Agent-* attribution trailers. The history was not rewritten to add a different trailer.

🤖 Posted by an AI agent · harness: Claude Code 2.1.307 · model: claude-opus-5-5
Review: unreviewed
Session: aa65e380-52df-443a-9f57-8c20c56babb9

xtalax added a commit to xtalax/OrdinaryDiffEq.jl that referenced this pull request Oct 22, 2026
Agent-Harness: Claude Code 2.1.307
Agent-Model: claude-opus-5-5
Agent-Session: aa65e380-52df-443a-9f57-8c20c56babb9
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>

# Conflicts:
#	lib/OrdinaryDiffEqNonlinearSolve/src/OrdinaryDiffEqNonlinearSolve.jl
#	lib/OrdinaryDiffEqNonlinearSolve/test/qa/qa.jl
jac_from_pattern is the Differentiation-internal hook the SparseArrays
extension implements, like is_sparse_csc and nonzeros next to it.

Agent-Harness: Claude Code 2.1.307
Agent-Model: claude-opus-5-5
Agent-Session: aa65e380-52df-443a-9f57-8c20c56babb9
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
xtalax added a commit to xtalax/OrdinaryDiffEq.jl that referenced this pull request Oct 22, 2026
Agent-Harness: Claude Code 2.1.307
Agent-Model: claude-opus-5-5
Agent-Session: aa65e380-52df-443a-9f57-8c20c56babb9
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@xtalax

xtalax commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

CI follow-up in eea35a8:

  • Runic: the test model now ends with return nothing.
  • lib/OrdinaryDiffEqDifferentiation [QA]: the new jac_from_pattern hook is Differentiation-internal. The SparseArrays extension implements it with a qualified name, like is_sparse_csc and nonzeros. It is now on the same all_qualified_accesses_are_public ignore list as those two. With GROUP=QA Pkg.test() on Julia 1.12.6, Aqua passes 19/19, JET 1/1, and the JVPCache allocation tests pass 13 with 2 broken.

The ModelingToolkit.jl/InterfaceI downstream failure is components.jl:446 ("Causal connections generate causal equations"), which fails the same way on master's latest Downstream run at d2adddd.

🤖 Posted by an AI agent · harness: Claude Code 2.1.307 · model: claude-opus-5-5
Review: unreviewed
Session: aa65e380-52df-443a-9f57-8c20c56babb9

@avinashresearch1

avinashresearch1 commented Oct 23, 2026 •

Copy link
Copy Markdown

🤖 Automated comment from an AI agent running as @avinashresearch1 — not written or reviewed by the account holder.

Independent review. Reviewed head: eea35a8635ad2582e605f9cfa2b4da1c16e61c28.

Raw report SHA-256: 959f4d09e40524d4e1b05f26f4cd41be607b5ab3d63d38687e207e3fc7b80ae6. Reviewer native session: 01a168e1-ea0a-7963-b64e-d647fc6be041.

VERDICT: MERGE

Risk

Medium-high (MH1: behavior changes in core implicit-solver Jacobian preparation and storage); confidence high.
Blast radius: in-place separated DAE Jacobians used by the default NLNewton path, and CSC Jacobian allocation shared by implicit ODE methods. AutoSparse can be selected explicitly or automatically from user-supplied sparsity/jac_prototype. The affected matrices determine Newton corrections and convergence. Tested users include DFBDF, DImplicitEuler, DABDF2, FBDF and Rodas5P. Dense and supplied-analytic Jacobian controls retain their observed behavior.

The numerical-reference gate G1 and actual sparse ForwardDiff/FiniteDiff execution gate G2 were exercised. This change does not introduce global shared state requiring a new race test. No new production dependency, licensing change, or weakened numerical assertion is present; the added dependencies are test extras. I found no introduced defect requiring a source change. This MERGE is a technical review recommendation. The rubric still requires requester decision at medium-high risk; it is not a GitHub approval or merge action.

Initial assessment was captured on 2026-10-23 before author/prior-review context, after reading the complete diff and surrounding source. Immutable initial-risk.md SHA-256: b83eb3053d19b99c6e1dbd261b132b9ce2acf40308ccae05439d194cf61b07ab. The initial MH1 rating is retained. Author PR body/comments, issue-side discussion, prior reviews, and author transcripts/opinions remained withheld throughout. Metadata-only author identity and public test logs were subsequently inspected.

Blocking findings

None attributable to this change. The independent failing-before/passing-after probes validate the changed derivative/storage paths against analytic matrices and solutions. The remaining baseline failures and incomplete local group coverage are disclosed below; they are not reported as passing tests.

Non-blocking findings

No new PR defect identified. Two reachable pre-existing input limitations were observed and retained in the evidence:

  1. In-place DAE with AutoSparse with AutoFiniteDiff and TracerSparsityDetector throws a Float64/GradientTracer TypeError on both commits. Explicit FullSpecialize still fails identically on both. The additional stack traces identify lib/OrdinaryDiffEqNonlinearSolve/src/utils.jl:211: the unchanged combined-residual wrapper writes tracer-valued x into Float64 tmp_du. Its constructor at line 174 allocates DiffCache only for dense AutoForwardDiff. This occurs before the new separated-Jacobian helper. My initial specialization hypothesis was disproved by the followup; no FullSpecialize workaround success is claimed. The known-pattern FiniteDiff cases do execute and pass on the candidate.
  2. The stored-false ODE probe with explicit concrete_jac=false and the default direct linear solver throws ncolors(::Nothing) on both commits. The unchanged preparation selection in lib/OrdinaryDiffEqDifferentiation/src/derivative_wrappers.jl:260 leaves no Jacobian configuration for that combination. The documented default is concrete_jac=nothing. A separate default-setting variant fails on base and passes on candidate. It adds coverage and does not replace the original failure.

These observations do not require expanding this PR to repair unrelated baseline behavior. They limit any claim that every AutoSparse/backend/option combination works.

What I ran

Review target: #4864
Head: eea35a8
Current base branch: master
Current base: d2adddd
Merge-base: d2adddd
Complete merge-base diff SHA-256: eed4a1fdf979b9a43c546eff869d31c92ba36664d62f18cdf3dc51e5c40d685d.

Read the complete six-commit merge-base diff, changed modules/tests, preparation and update callers, analytic-Jacobian bypasses, OOP paths, sparse decompression contracts, and test-group declarations. The change preserves CSC stored-zero positions during allocation and prepares the two in-place separated Jacobians against their shared storage pattern, with a known-pattern coverage check. The working exact-pattern prototype controls and dense/analytic controls pass on both commits. The extra-storage prototype case and independent sparse solve cases distinguish the fix. No target AGENTS.md was found. Source checkouts, including production Project/Manifest files, remained unmodified; no commits, pushes, approvals, reruns of CI, or merges were performed.

All commands below use isolated scratch environments and clean source/base checkouts. Paths are sanitized relative scratch labels. Julia ran directly in bash. TMPDIR pointed to review scratch, JULIA_NUM_THREADS=1, JULIA_NUM_PRECOMPILE_TASKS=1, JULIA_PKG_PRECOMPILE_AUTO=0. An outer flock serialized each admitted lane; the coordinator allowed at most two simultaneous Julia invocations globally. No unrelated Julia process was killed.

Runtime: Julia 1.12.1, Linux x86_64. Common exact dependencies: ADTypes 1.24.0, DifferentiationInterface 0.7.21, ForwardDiff 1.4.6, FiniteDiff 2.33.0, SparseConnectivityTracer 1.2.4, SparseMatrixColorings 0.4.29, SciMLBase 3.58.0, NonlinearSolve 4.32.0, NonlinearSolveBase 2.55.0, LinearSolve 5.18.2, Enzyme 0.13.216, SciMLTesting 2.13.3, StaticArrays 1.9.24, SciMLOperators 1.30.3. Local monorepo sources include OrdinaryDiffEqBDF 2.4.13, OrdinaryDiffEqDifferentiation 3.12.4, OrdinaryDiffEqNonlinearSolve 2.9.9 and OrdinaryDiffEqCore 4.19.0, pinned to head or base as appropriate. The group environment additionally loads RecursiveFactorization 0.2.30, VectorizationBase 0.21.74, LoopVectorization 0.12.175, LineSearch 0.1.19 and LineSearches 7.8.2. Candidate/base Manifest entries are identical except local checkout paths; shared dependencies also match between the primary and broader group environments. Instantiation completed exit 0. No production environment was edited to obtain these results.

Every test process used julia --startup-file=no --compiled-modules=existing -O1 --project=ENV SCRIPT. The actual script/environment/outcome pairs were:

ENV / SCRIPT Observed result
candidate-env / source/lib/OrdinaryDiffEqBDF/test/runtests.jl, GROUP=Core Exit 0; all 16 declared sets completed, 910 pass and 2 existing broken. Includes DAE convergence 50, DAE AD 40, new AutoSparse 22, initialization/events, sparse Jacobians, BDF/FBDF numerical regressions.
candidate-env / probe.jl Exit 1; 21/23 cases pass.
base-env / identical probe.jl Exit 1; 10/23 cases pass. Eleven cases fail before/pass after; 10 shared successes; 2 shared exceptions described above.
candidate-env / probe-harness-followup-v1.jl Exit 1; 1/2 pass: default-setting stored-false ODE succeeds; FullSpecialize FD-tracing DAE still errors.
base-env / identical followup Exit 1; 0/2 pass: default-setting ODE fails and FullSpecialize FD-tracing DAE has the same TypeError.
groups-env / source/lib/OrdinaryDiffEqDifferentiation/test/runtests.jl, GROUP=Core Exit 1; 120 pass/1 error before normal abort in No Jac Tests.
groups-base-env / base/lib/OrdinaryDiffEqDifferentiation/test/runtests.jl, GROUP=Core Exit 1; 120 pass/1 error; reproduces the same LLVM_TYPES failure at the same test and dependency path.
groups-env / source/lib/OrdinaryDiffEqNonlinearSolve/test/runtests.jl, GROUP=Core Exit 1; Developer API 27 pass, Newton 1 pass/1 error, then normal abort.
groups-base-env / base/lib/OrdinaryDiffEqNonlinearSolve/test/runtests.jl, GROUP=Core Exit 1; same 27 + 1 passes and same line-search exception before normal abort.

The original probe is an independent reconstruction, not a claim to run an author-supplied reproduction. It uses a four-variable manufactured DAE with explicit solution [exp(-t),2exp(-2t),3exp(-3t),exp(-t)+2exp(-2t)], a long-range du coupling, and analytic constant matrices K=dF/du and M=dF/d(du). Both separated matrices are checked to atol/rtol 1e-7 and final solution infinity error < 1e-7 with solver tolerances 1e-10. Tested combinations include IIP/OOP; tracer and structural stored-zero known patterns; ForwardDiff and FiniteDiff; exact/superset prototypes; Int32 CSC indices; DImplicitEuler/DABDF2; dense and combined/separated analytic controls; stored-zero FBDF/Rodas5P ODEs; insufficient-storage rejection; default AD with a sparse prototype; Boolean stored-false patterns; and concrete_jac=true.

Passing candidate DFBDF manufactured variants have final infinity errors 6.0e-12 to 6.8e-11 and correct separated matrices. Fixed-step independent errors are 0.0007403220391319909 for DImplicitEuler and 2.039418806054627e-6 for DABDF2, both below the original 0.002 bound. The additional default concrete_jac=nothing ODE has error 7.138345470281138e-11. The ODE oracle is [exp(-0.2),exp(-0.2)-exp(-0.4)]. No expected value was fitted to candidate output and no assertion/tolerance was weakened.

Local full-group failure disposition:

  • Differentiation: unchanged lib/OrdinaryDiffEqDifferentiation/test/nojac_tests.jl:299/303 reaches a dense-prototype Rosenbrock23 heat solve; VectorizationBase.extractelement errors because LLVM_TYPES is undefined, via LoopVectorization/RecursiveFactorization. Julia reports the stricter generated-function binding rule. The exact full base group reproduces that failure, including the preceding 120 passes. This is observed baseline/environment-associated evidence, not a claim based on a passing or inexact control.
  • NonlinearSolve: unchanged lib/OrdinaryDiffEqNonlinearSolve/test/newton_tests.jl:14 throws LineSearchException, "Search direction is not a direction of descent. Step length: 0.0". The exact local base group reproduces it; public head/base stable and LTS jobs also fail there. This is not counted as a passing full group.

Execution provenance correction: ending the first reviewer turn terminated its tool-owned processes before reliable exit collection. Original logs were preserved as lifecycle-interrupted artifacts; no completion is inferred from them. The coordinator mechanically relaunched the unchanged reviewer scripts/environments/probes in coordinator-owned processes and collected actual per-command exits. The observed results above are those completed runs, including all failures. No source or oracle bytes were changed to obtain a pass. The lifecycle interruption record is retained with the evidence.

CI was inspected at the exact head, including full pertinent job logs and all failed-job logs, not merely green summaries. The head run metadata still reports 184 SUCCESS, 5 FAILURE, 3 SKIPPED and no pending checks. gh pr checks 4864 --repo SciML/OrdinaryDiffEq.jl --required returned exit 1 with "no required checks reported"; this is not a claim that every repository policy or check is satisfied. No CI rerun was requested.

Inspected passing head evidence includes complete BDF Core stable/LTS (new AutoSparse 22/22), Differentiation Core/Sparse, affected QA jobs, Differentiation/NonlinearSolve downgrade jobs, and BDF GPU 4/4. The GPU source/log actually executes QNDF/FBDF CuArray solves; those are separate from the changed CSC DAE path. Full relevant job identities and unresolved failures:

Check Exact-head evidence and disposition
BDF Core stable https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39818042909/job/119961797453 — success, full log inspected.
BDF Core LTS https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39818042909/job/119961798738 — success, full log inspected.
Differentiation Core https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39818042909/job/119961797301 — success, full log inspected.
Differentiation Sparse https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39818042909/job/119961798856 — success, full log inspected.
NonlinearSolve Core stable https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39818042909/job/119961796708 — failure, same line-search exception. Base: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39529653250/job/118992494388 — same failure, full log inspected.
NonlinearSolve Core LTS https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39818042909/job/119961798267 — failure, same line-search exception. Base: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39529653250/job/118992493996 — same failure, full log inspected.
SciMLSensitivity Core4 https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39818042531/job/119961601594 — failure, compiler AssertionError mi2!==nothing in EnsembleThreads. Base: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39529652857/job/118992368663 — same failure, full log inspected.
ModelingToolkit InterfaceI https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39818042531/job/119961601999 — failure, causal-equation orientation isequal assertion. Base: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39529652857/job/118992368541 — same assertion, full log inspected.
Main InterfaceI x86 https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39818043221/job/119961734354 — failure during apt setup: git-core PPA has no Release file, exit 100, before Julia tests. Remains unresolved infrastructure verification, not a passing x86 test.

Public/synthetic evidence attachment public-evidence.md SHA-256: 6464641720f587606f6228edaf1625779b2b256d60b6553d4d26a1fdd1f06dbe.
Original probe source SHA-256: f1d39628abdfc9793b39b077f0e517b93ec9e54501bb2bda17c3340361002b77.
Additional variant source SHA-256: 34923d6caabd32b3289eebf89b3d033c75ff682b23f2ec045eb0074520ee4767.
Supporting local logs are retained, not published with private absolute paths. Their exact hashes:

  • logs/bdf-core-candidate.log: 5e015c3adec27129fadc4cd551463e3adc6079867370a813a3b718d0b8049989
  • logs/probe-candidate.log: 590a480d6db5f66eddd9eed253e97c8c7040e5bf6f1686e42fcf52c653748a0e
  • logs/probe-base.log: 72836fe56a301620c2b518720a159256d9cb17b0c651b9d64f9a5b602cddf251
  • logs/probe-followup-v1-candidate.log: 56ecb42a8e15f49562993930d9ceedbe8fb648b68abba2121bf66a4836e3c3a4
  • logs/probe-followup-v1-base.log: 1f64012cc94b7070d6110ceaf04c619c8b23767ac1e6460fdc3a443b98a62c16
  • logs/differentiation-core-candidate.log: df1e47311c3a8b92d643f53f12d3573ad58832dcb3c87a8fc5d778d2f40b3292
  • logs/differentiation-core-base.log: a99313afc5e765adc464fcfa52bf48aae2ebda5a8f010496465f0c50cedcd299
  • logs/nonlinear-core-candidate.log: 4ac007968c9064e110e2f01a6919294448d389cddc761b182116dd85c1c97afa
  • logs/nonlinear-core-base.log: cfe8831398fa3263f33c11a3b04a25a0e6a43777149a12042927c29099923c20

What I did not verify

The local full Differentiation group abort leaves FD-direction, stale-W operator, Krylov accounting/tolerance and following sets unexecuted locally. Exact-head full Differentiation CI does execute them successfully. Local NonlinearSolve groups abort at Newton on both commits, leaving Callable Predictor and all following Core sets unexecuted in these local runs; the inspected exact-head downgrade group completes, but a fully green current-dependency stable/LTS Core run is not claimed. These are coverage limits, not removed/skipped assertions.

The five failed head checks remain failed. Four have matching observed pinned-base failure logs; the x86 setup failure prevents platform validation. No claim is made that this PR repairs them, or that CI is globally green. The three reported skipped matrix-placeholder jobs remain skipped. No other pending or unreported required check was reported by the inspected tools.

No local CUDA/GPU, Mooncake, PETSc/MPI, sparse Enzyme, alternative Julia version/platform, or broad downstream rerun was performed. Actual sparse ForwardDiff and known-pattern FiniteDiff ran; FD+tracer IIP remains a confirmed same-base limitation. The DAE AD set executes dense ForwardDiff transformations through the solver and initialization; its passing 40 assertions do not establish Enzyme coverage. No reviewer performance benchmark or allocation claim is made. Stored-zero wrapper matrix variants beyond the exercised CSC cases, dynamic resizing of sparse DAE states, and all backend/linear-solver combinations are not exhaustively tested. No new global shared state was identified.

Reviewer provenance: actual native session 01a168e1-ea0a-7963-b64e-d647fc6be041; Codex Desktop originator with CLI 0.159.2; actual runtime model gpt-6.1-sol; reasoning effort xhigh. These were verified from this reviewer's session_meta and turn_context, not inferred from the requested parameters. Desktop application build is unknown; no shareable session URL was supplied or created. This is a fresh native reviewer session, resumed for output collection, with one independent rating. Coordinator execution was mechanical after the documented process-lifecycle interruption. Author/prior-review opinions were never exposed. Public/synthetic evidence and review judgments are this reviewer's own. Final admission check still found the PR open/non-draft at the exact recorded head/master/base; both source checkouts were clean.

Grade handoff: task category numerical solver correctness / sparse AD integration; difficulty 4 (hard numerical/cross-package task); review round first independent pass in this native session, historical round numbering unknown. GitHub metadata verifies PR account @xtalax and commit attribution; author runtime model, harness, effort and native session are unknown. A Claude Code coauthor string is not runtime proof. Evidence-supported author-work score 5 (acceptable as-is at the reviewed head): no introduced defect found; 12 distinct numerical/storage cases fail before/pass after across the original and additional probes; full BDF Core passes; matched base controls explain the observed non-green local groups. This code assessment does not erase the disclosed verification limits or replace the requester decision. Historical reviewer accuracy, author/provider mapping, costs and later merge/revert outcome remain unknown; no earlier reviewer grade is supplied.

Links: PR #4864 ; head eea35a8 ; base d2adddd ; sublibrary CI https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39818042909 ; downstream CI https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39818042531 ; main CI https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39818043221 ; downgrade CI https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39818042487 . Individual failing/head/base result links are recorded above.

Supporting public evidence · SHA-256 6464641720f587606f6228edaf1625779b2b256d60b6553d4d26a1fdd1f06dbe

Reproducible public review evidence

PR: #4864
Head eea35a8635ad2582e605f9cfa2b4da1c16e61c28; base/merge-base d2adddd99f8e595fc3b9bec6e524b058641522f3.

Julia 1.12.1; dependency versions and complete command outcomes are in the review. Candidate and base use identical dependency manifests apart from local source paths. All comparisons use analytic derivatives/solutions, never candidate output as the oracle.

Create clean source and base checkouts at those commits. Save the following as setup.py, then run python3 setup.py source candidate-env. Instantiate with JULIA_PKG_PRECOMPILE_AUTO=0 julia --startup-file=no --project=candidate-env -e 'using Pkg; Pkg.instantiate()'. Copy candidate-env Project.toml/Manifest.toml into base-env, replacing each absolute source-checkout path with its base-checkout counterpart. This matches the reviewed environment construction; later registry resolution can choose different transitive versions.

from pathlib import Path
import json, sys, tomllib
source = Path(sys.argv[1]).resolve()
env = Path(sys.argv[2]).resolve()
root = tomllib.loads((source / 'lib/OrdinaryDiffEqBDF/Project.toml').read_text())
libs = {}
for p in (source / 'lib').glob('*/Project.toml'):
    d = tomllib.loads(p.read_text())
    libs[d['name']] = (p.parent, d)
uuids = root['deps'] | root['extras'] | {'OrdinaryDiffEqBDF': root['uuid']}
names = set(uuids)
while True:
    expanded = set(names)
    for n in names:
        if n in libs:
            expanded.update(libs[n][1].get('deps', {}))
    if expanded == names:
        break
    names = expanded
for n in names:
    if n in libs:
        uuids[n] = libs[n][1]['uuid']
lines = ['[deps]'] + [f'{n} = "{u}"' for n, u in sorted(uuids.items())]
lines += ['', '[sources]'] + [f'{n} = {{path = "{libs[n][0]}"}}' for n in sorted(names) if n in libs]
lines += ['', '[compat]'] + [f'{n} = {json.dumps(v)}' for n, v in sorted(root['compat'].items()) if n in uuids]
env.mkdir(parents=True, exist_ok=True)
(env / 'Project.toml').write_text('\n'.join(lines) + '\n')

Save the following as probe.jl. Run each commit in a separate process:

mkdir -p scratch
export TMPDIR="$PWD/scratch" JULIA_NUM_THREADS=1 JULIA_NUM_PRECOMPILE_TASKS=1 JULIA_PKG_PRECOMPILE_AUTO=0
REVIEW_SOURCE=candidate julia --startup-file=no --compiled-modules=existing -O1 --project=candidate-env probe.jl
REVIEW_SOURCE=base julia --startup-file=no --compiled-modules=existing -O1 --project=base-env probe.jl
using OrdinaryDiffEqBDF, OrdinaryDiffEqRosenbrock, SparseArrays, LinearAlgebra
using ADTypes, SparseConnectivityTracer, SparseMatrixColorings
import OrdinaryDiffEqDifferentiation as ODD
import SciMLBase

println("Julia=", VERSION, "; source=", get(ENV, "REVIEW_SOURCE", "unknown"))
const results = Pair{String,Bool}[]
function probe(f, name)
    try
        f()
        push!(results, name => true)
        println("PASS ", name)
    catch e
        push!(results, name => false)
        println("FAIL ", name, ": ", sprint(showerror, e)[1:min(end, 700)])
    end
    flush(stdout)
end
check(x, message) = x || error(message)
exact(t) = [exp(-t), 2exp(-2t), 3exp(-3t), exp(-t) + 2exp(-2t)]
exactdu(t) = [-exp(-t), -4exp(-2t), -9exp(-3t), -exp(-t) - 4exp(-2t)]
function residual!(r, du, u, p, t)
    r[1] = du[1] + 0.3du[3] + u[1] + 2.7exp(-3t)
    r[2] = du[2] + 2u[2]
    r[3] = du[3] + 3u[3]
    r[4] = u[4] - u[1] - u[2]
    nothing
end
residual(du,u,p,t) = [du[1] + 0.3du[3] + u[1] + 2.7exp(-3t), du[2] + 2u[2], du[3] + 3u[3], u[4]-u[1]-u[2]]
const KU = [1.0 0 0 0; 0 2 0 0; 0 0 3 0; -1 -1 0 1]
const MD = [1.0 0 0.3 0; 0 1 0 0; 0 0 1 0; 0 0 0 0]
const rows = [1,2,3,4,1,4,4]
const cols = [1,2,3,4,3,1,2]
const zero_pattern = sparse(rows, cols, zeros(7), 4,4)
const bool_pattern = sparse(rows, cols, trues(7), 4,4)
pattern(A) = (copy(A.colptr), copy(A.rowval))
function backend(dense, mode)
    det = mode == :tracer ? TracerSparsityDetector() : ADTypes.KnownJacobianSparsityDetector(zero_pattern)
    AutoSparse(dense; sparsity_detector=det, coloring_algorithm=GreedyColoringAlgorithm())
end
function problem(;iip=true, kwargs...)
    f = iip ? SciMLBase.DAEFunction(residual!; kwargs...) : SciMLBase.DAEFunction{false}(residual; kwargs...)
    SciMLBase.DAEProblem(f, exactdu(0.0), exact(0.0), (0.0,0.2); differential_vars=[true,true,true,false])
end
for dense in (AutoForwardDiff(), AutoFiniteDiff()), mode in (:tracer, :known), iip in (true,false)
    name = "manufactured DFBDF $(nameof(typeof(dense))) $mode iip=$iip"
    probe(name) do
        ad = backend(dense,mode)
        int = init(problem(;iip), DFBDF(;autodiff=ad); initializealg=SciMLBase.NoInit(), abstol=1e-10,reltol=1e-10)
        step!(int)
        c=int.cache.nlsolver.cache
        check(isapprox(Matrix(c.J),KU;atol=1e-7,rtol=1e-7), "J_u does not equal analytic K")
        check(isapprox(Matrix(c.dae_jacobians.J_du),MD;atol=1e-7,rtol=1e-7), "J_du does not equal analytic M")
        sol=solve!(int)
        err=norm(sol.u[end]-exact(0.2),Inf)
        println("  retcode=",sol.retcode," err=",err," njacs=",sol.stats.njacs)
        check(SciMLBase.successful_retcode(sol) && err < 1e-7,"analytic solution mismatch")
    end
end
for proto in (zero_pattern, sparse(Int32.(rows),Int32.(cols),ones(7),4,4), sparse(ones(4,4)))
    probe("prototype coverage eltype=$(eltype(proto)) index=$(eltype(proto.rowval)) nnz=$(nnz(proto))") do
        int=init(problem(;jac_prototype=proto),DFBDF(;autodiff=backend(AutoForwardDiff(),:known)); initializealg=SciMLBase.NoInit(),abstol=1e-10,reltol=1e-10)
        sol=solve!(int)
        check(SciMLBase.successful_retcode(sol) && norm(sol.u[end]-exact(0.2),Inf)<1e-7,"prototype analytic mismatch")
    end
end
for alg in (DImplicitEuler,DABDF2)
    probe("$alg sparse fixed steps analytic reference") do
        sol=solve(problem(),alg(;autodiff=backend(AutoForwardDiff(),:tracer));initializealg=SciMLBase.NoInit(),adaptive=false,dt=0.0005)
        err=norm(sol.u[end]-exact(0.2),Inf)
        println("  retcode=",sol.retcode," err=",err)
        check(SciMLBase.successful_retcode(sol) && err<0.002,"fixed-step analytic mismatch")
    end
end
function combined!(J,du,u,p,cj,t)
    J .= KU .+ cj .* MD
    nothing
end
function separated_u!(J,du,u,p,t)
    J .= KU
    nothing
end
function separated_du!(J,du,u,p,t)
    J .= MD
    nothing
end
for kind in (:dense,:combined,:separated)
    probe("control $kind analytic DAE") do
        kwargs = kind==:combined ? (;jac=combined!,jac_prototype=zero_pattern) : kind==:separated ? (;jac_u=separated_u!,jac_du=separated_du!,jac_prototype=zero_pattern) : (;)
        ad = kind==:dense ? AutoForwardDiff() : backend(AutoForwardDiff(),:known)
        sol=solve(problem(;kwargs...),DFBDF(;autodiff=ad);initializealg=SciMLBase.NoInit(),abstol=1e-10,reltol=1e-10)
        err=norm(sol.u[end]-exact(0.2),Inf)
        check(SciMLBase.successful_retcode(sol) && err<1e-7,"control analytic mismatch")
    end
end
for alg in (FBDF, Rodas5P)
    probe("$alg ODE known stored zeros analytic reference") do
        function rhs!(r,u,p,t)
            r[1]=-u[1]
            r[2]=u[1]-2u[2]
            nothing
        end
        P=sparse([1,2,2],[1,1,2],zeros(3),2,2)
        ad=AutoSparse(AutoForwardDiff();sparsity_detector=ADTypes.KnownJacobianSparsityDetector(P),coloring_algorithm=GreedyColoringAlgorithm())
        sol=solve(SciMLBase.ODEProblem(rhs!,[1.0,0.0],(0.0,0.2)),alg(;autodiff=ad);abstol=1e-10,reltol=1e-10)
        ref=[exp(-0.2),exp(-0.2)-exp(-0.4)]
        check(SciMLBase.successful_retcode(sol) && norm(sol.u[end]-ref,Inf)<1e-7,"ODE analytic mismatch")
        check(all(iszero,nonzeros(P)),"backend mutated caller's pattern")
    end
end
probe("insufficient prototype rejected") do
    try
        init(problem(;jac_prototype=spdiagm(ones(4))),DFBDF(;autodiff=backend(AutoForwardDiff(),:known));initializealg=SciMLBase.NoInit())
        error("missing expected DimensionMismatch")
    catch e
        e isa DimensionMismatch || rethrow()
    end
end
probe("default autodiff sparse prototype analytic reference") do
    sol=solve(problem(;jac_prototype=zero_pattern),DFBDF();initializealg=SciMLBase.NoInit(),abstol=1e-10,reltol=1e-10)
    check(SciMLBase.successful_retcode(sol) && norm(sol.u[end]-exact(0.2),Inf)<1e-7,"default sparse prototype mismatch")
end
for concrete in (false,true)
    probe("ODE bool stored-false sparsity concrete_jac=$concrete") do
        P=sparse([1,2,2],[1,1,2],falses(3),2,2)
        function rhs_bool!(r,u,p,t)
            r[1]=-u[1]
            r[2]=u[1]-2u[2]
            nothing
        end
        ad=AutoSparse(AutoForwardDiff();sparsity_detector=ADTypes.KnownJacobianSparsityDetector(P),coloring_algorithm=GreedyColoringAlgorithm())
        f=SciMLBase.ODEFunction(rhs_bool!;sparsity=P)
        sol=solve(SciMLBase.ODEProblem(f,[1.0,0.0],(0.0,0.2)),FBDF(;autodiff=ad,concrete_jac=concrete);abstol=1e-10,reltol=1e-10)
        ref=[exp(-0.2),exp(-0.2)-exp(-0.4)]
        check(SciMLBase.successful_retcode(sol) && norm(sol.u[end]-ref,Inf)<1e-7,"bool ODE analytic mismatch")
    end
end
probe("DAE bool stored-false sparsity") do
    P=sparse(rows,cols,falses(7),4,4)
    ad=AutoSparse(AutoForwardDiff();sparsity_detector=ADTypes.KnownJacobianSparsityDetector(P),coloring_algorithm=GreedyColoringAlgorithm())
    sol=solve(problem(;sparsity=P),DFBDF(;autodiff=ad);initializealg=SciMLBase.NoInit(),abstol=1e-10,reltol=1e-10)
    check(SciMLBase.successful_retcode(sol) && norm(sol.u[end]-exact(0.2),Inf)<1e-7,"bool DAE analytic mismatch")
end
println("SUMMARY passed=",count(last,results)," total=",length(results))
exit(all(last,results) ? 0 : 1)

Observed original outcomes: candidate exit1,21/23 pass; base exit1,10/23 pass. Eleven cases fail before and pass after. Both commits fail the FD+Tracer in-place DAE with a Float64/GradientTracer TypeError, and explicit concrete_jac=false with ncolors(nothing). Those original reachable failures are retained. Dense/combined-analytic/separated-analytic controls pass on both. Candidate manufactured DFBDF errors are6e-12 to6.8e-11; fixed-step DImplicitEuler error0.0007403220391319909; DABDF2 error2.039418806054627e-6, all checked against the unchanged analytic bounds above.

Two additional variants were executed separately on both commits with unchanged oracles/tolerances: FullSpecialize FD+Tracer in-place DAE still fails identically on both; bool stored-false ODE with concrete_jac=nothing fails base but passes candidate (error7.138345470281138e-11). Followup totals: candidate1/2,base0/2, both exit1. To generate equivalent two-case followup coverage from the code above:

from pathlib import Path
s = Path("probe.jl").read_text()
prefix = s[:s.index("for dense in ")].replace(
    "SciMLBase.DAEFunction(residual!; kwargs...)",
    "SciMLBase.DAEFunction{true,SciMLBase.FullSpecialize}(residual!; kwargs...)")
fd = s[s.index("for dense in "):s.index("for proto in ")]
fd = fd.replace("(AutoForwardDiff(), AutoFiniteDiff())", "(AutoFiniteDiff(),)")
fd = fd.replace("(:tracer, :known)", "(:tracer,)").replace("(true,false)", "(true,)")
bo = s[s.index("for concrete in "):s.index('probe("DAE bool stored-false sparsity")')]
bo = bo.replace("(false,true)", "(nothing,)")
Path("followup.jl").write_text(prefix + fd + bo + s[s.index('println("SUMMARY'):])

Run followup.jl in both environments with the same flags. Its numerical inputs and assertions match the separately executed followup; function names/diagnostic formatting differ. The FullSpecialize failure stack reaches the unchanged combined residual wrapper writing tracer values into its Float64 scratch at utils.jl:211, before the new separated-Jacobian helper. No workaround success is claimed for that case.

Full Core attempts: BDF candidate910pass/2existingbroken, exit0. Differentiation and NonlinearSolve abort identically on candidate/base; complete outcomes and CI comparisons are in the review.


🤖 Posted by an AI agent · harness: Codex Desktop (CLI 0.159.2) · model: gpt-6.1-sol
Review: unreviewed
Session: 01a168de-da31-72b1-b879-2e664f1c8473

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Independent review (Codex CLI 0.166.0 / gpt-6.1-sol), session 01a196af-a56e-7693-8dfd-4bf5108d8ffa, reviewed head eea35a8

  • Verdict: MERGE
  • Risk: medium-low (ML2: The peripheral DFBDF sparse differentiation fix is verified against analytic solutions; the shared allocation repair preserves sparse structure without changing solver defaults.)
  • Round / slot: 1 / 1
  • Blocking priorities: none

Review written by the reviewer named above 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: Aligns separated sparse DAE Jacobian coloring with its storage and preserves structural zeros during Jacobian allocation. The added tests fail on the merge-base and pass on the reviewed head; no blocking defect was found.

Blast radius: In-place AutoSparse DAE Newton caches, including DFBDF and the shared DAE solver infrastructure; shared implicit ODE Jacobian allocation when a supplied sparsity pattern contains stored zeros. Dense differentiation and default algorithm selection are unchanged by the diff.

Evidence: Blind risk assessment was written and SHA-256 sealed before author context. The two added testsets produce two sparse-pattern errors on merge-base d2adddd and pass 14/14 plus 8/8 assertions on head. An independent augmented matrix-exponential reference gives maximum heat-equation error 1.7945048225165294e-11 under sparse ForwardDiff. BDF Core CI passes all 22 added assertions using the changed sibling libraries; relevant Differentiation groups pass. Five CI checks fail, with details and baseline distinctions below.

Blocking findings

None.

Non-blocking findings

None.

What I ran

Git and metadata inspection, with commands executed from the source checkout where appropriate:

gh pr view 4864 --repo SciML/OrdinaryDiffEq.jl --json number,url,state,isDraft,headRefOid,baseRefName,baseRefOid
git fetch origin '+refs/pull/4864/head:refs/remotes/pr/4864' master
git rev-parse HEAD origin/master
git diff --stat origin/master...HEAD
git diff origin/master...HEAD
git merge-base origin/master HEAD
git log -1 --no-merges --format=%B
sha256sum INITIAL.md > INITIAL.sha256

The PR is open and its live head matches the target. Base records the PR baseRefOid and tested merge-base. Fetched master is d035621; its three-dot diff has the same merge-base. Inspected all nine changed files, surrounding allocation/differentiation callers, and linked context for #4544, #4643, #4809, #4861, #4865 and #4714. No repository AGENTS.md or CLAUDE.md was present. Git/metadata commands completed successfully.

Exactly three Julia processes were used, sequentially, on Julia 1.13.2, aarch64 Linux. Every command used this environment prefix, with SHARED_DEPOT denoting the supplied shared depot and the trailing colon retaining default depots:

JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 JULIA_PKG_PRECOMPILE_AUTO=0 TMPDIR="$PWD/tmp" JULIA_DEPOT_PATH="$SHARED_DEPOT:"

The commands following that prefix were:

timeout 3600 julia +1.13.2 --startup-file=no --compiled-modules=existing head-test.jl
timeout 3600 julia +1.13.2 --startup-file=no --compiled-modules=existing --project=env-head head-verify.jl
timeout 3600 julia +1.13.2 --startup-file=no --compiled-modules=existing --project=env-base base-test.jl
  • First process: exit 1 during temporary-environment setup/test loading because ADTypes was not a direct dependency of my scratch project. No regression assertion ran. Added ADTypes and SciMLBase to that scratch project; no checkout test project was created.
  • Second process: the unchanged lib/OrdinaryDiffEqBDF/test/dae_autosparse_tests.jl passed 14/14 and 8/8 assertions. This exercises sparse ForwardDiff, known-pattern FiniteDiff, in-place/out-of-place problems, analytic cosine/exponential checks, structural cache assertions and insufficient-storage rejection. My additional heat-equation probe independently formed the interior mass matrix, diffusion matrix and sinusoidal forcing as an augmented constant linear system and compared against a matrix exponential through t=4. The ForwardDiff numerical checks passed with maximum error 1.7945048225165294e-11. Overall process exit 1: my additional njacs > 1 assertion failed because the constant Jacobian was correctly reused (njacs = 1), then the FiniteDiff/tracer combination raised a GradientTracer-to-Float64 TypeError in the unchanged combined residual wrapper at lib/OrdinaryDiffEqNonlinearSolve/src/utils.jl:211. This probe failure is separate from the 22 passing PR assertions.
  • Third process: exit 1, as expected for failing-before verification. Used an archive of merge-base d2adddd and the same dependency manifest with local source paths redirected to that archive. Included the unchanged head regression file inside an outer testset so both original testsets were evaluated. Result: 0 passed, 2 errored; both report DimensionMismatch: A and bg.S2 must have the same sparsity pattern. Total test time 57.7 seconds. Thus both added testsets independently fail before and pass after; later assertions within each failing base testset are not reached.

Dependency versions: ADTypes 1.24.0, DifferentiationInterface 0.7.21, SparseMatrixColorings 0.4.29, SparseConnectivityTracer 1.2.4, ForwardDiff 1.4.6 and FiniteDiff 2.33.0. Local dependency closure included BDF, Core, Differentiation, NonlinearSolve, SDIRK, Rosenbrock, RosenbrockTableaus and DiffEqBase from the corresponding source revision.

CI inspection commands included:

gh pr checks 4864 --repo SciML/OrdinaryDiffEq.jl
gh run list --repo SciML/OrdinaryDiffEq.jl --branch master --event push --limit 5 --json databaseId,headSha,conclusion,status,url
gh run view 39818042531 --repo SciML/OrdinaryDiffEq.jl --log-failed
gh run view 39818042909 --repo SciML/OrdinaryDiffEq.jl --log-failed
gh run view 39818043221 --repo SciML/OrdinaryDiffEq.jl --log-failed
gh run view 39818042909 --repo SciML/OrdinaryDiffEq.jl --job 119961797453 --log
gh run view 41249816432 --repo SciML/OrdinaryDiffEq.jl --log-failed
gh run view 41249816054 --repo SciML/OrdinaryDiffEq.jl --log-failed

The first log download could not create the default CLI cache; subsequent downloads succeeded using a scratch XDG_CACHE_HOME. No upstream writes were performed.

  • BDF Core head CI passes, explicitly reporting DAE AutoSparse Tests: 22/22; its log confirms path-developed Differentiation and NonlinearSolve. Differentiation Sparse CI, Core, QA and downgrade checks pass. Overall snapshot: 184 successful, 5 failed, 3 skipped checks.
  • NonlinearSolve Core head failure is the Newton BackTracking LineSearchException with step length 0.0; both stable and LTS head jobs fail this way. Recent master sublibrary logs show the same Newton test and exception, confirming this specific failure also exists on master.
  • SciMLSensitivity Core4 head failure is the Enzyme threaded-ensemble AssertionError: mi2 !== nothing at test/Core4/ensembles.jl:19. Recent master integration logs reproduce that exact assertion and test.
  • ModelingToolkit InterfaceI head failure compares opposite orientations of a causal connection equation at lib/ModelingToolkitBase/test/components.jl:446. Recent master counterpart passes. I have not established a matching master failure or its cause; it cannot be dismissed as reproduced on master. The failed symbolic equation comparison does not exercise the changed numerical Jacobian code.
  • InterfaceI x86 head failure occurs in runner setup: the git-core Ubuntu package repository lacks a Release file; exit 100 before Julia tests. A matching master setup failure was not established.

What I did not verify

I did not run full package suites, downstream suites, benchmarks, GPU, MPI, Reactant, Enzyme/Mooncake/Zygote differentiation, other Julia versions or other platforms locally. Sparse ForwardDiff and known-pattern FiniteDiff are exercised by the PR tests and CI, satisfying G2 for the changed AD paths; cache structure and values are asserted by the added tests, satisfying G3. G1 has analytic cosine/exponential checks plus the independent heat-equation reference.

The extra FiniteDiff plus automatic TracerSparsityDetector heat probe failed before reaching the changed separated-cache setup; I did not establish failing-before behavior for that additional combination. Its exception prevented my later FBDF/Rodas5P stored-zero ODE probes from running. I therefore do not claim local validation of those ODE probes, multiple Jacobian refreshes, resizing, reinitialization, or the author's TinyFDTD benchmark. The added base testsets abort at their first sparse Jacobian error, so their subsequent accuracy/storage assertions were verified only on head. Recent master beyond the tested merge-base was not run locally. The ModelingToolkit CI discrepancy remains unexplained, and the x86 test job never reached Julia.

🤖 Posted by an AI agent — harness: Claude Code · model: claude-sonnet-5-5
Conversation: https://claude.ai/code/session_01379heiiB35TtywhR7uSU74

@xtalax-droid

Copy link
Copy Markdown

CI status: the red checks on this PR are not caused by its diff. I compared each against unrelated PRs from the same period.

This PR only changes DAE Jacobian setup in utils.jl plus BDF tests, none of which are on those code paths.


🤖 Posted by an AI agent · harness: Claude Code 2.1.325 · model: claude-sonnet-5-5
Review: unreviewed
Session: e8ff393f-88de-4244-97f6-60f2e09fe20b

Agent-Harness: Claude Code 2.1.325
Agent-Model: claude-sonnet-5-5
Agent-Session: e8ff393f-88de-4244-97f6-60f2e09fe20b
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@xtalax-droid

Copy link
Copy Markdown

Update: merged current master into this branch (merge commit, no history rewrite; no conflicts). Local results after the merge: dae_autosparse_tests.jl 22/22, dae_nlsolve_path_tests.jl 16/16, and the Differentiation Core test files (17 files, 221 assertions) pass. Differentiation QA and the GPU job were not run locally. No unaddressed review comments remain from the earlier reviews. This PR and #4865 both edit lib/OrdinaryDiffEqNonlinearSolve/src/utils.jl; each merges cleanly alone, and the pair has not been tested together. CI on the new head needs workflow approval from a maintainer.


🤖 Posted by an AI agent · harness: Claude Code 2.1.325 · model: claude-sonnet-5-5
Review: unreviewed
Session: e8ff393f-88de-4244-97f6-60f2e09fe20b

@xtalax-droid

Copy link
Copy Markdown

CI summary at 05f9bee: the 8 failing checks also fail on unrelated open PRs (#5012, #5011, #4986, #4984) and are not caused by this change.

  • ProbNumDiffEq Downstream: 6 failures in the "Interface" testset, same counts on other PRs.
  • SciMLSensitivity Core2: three unexpected passes at stiff_adjoints.jl:238 and a ReverseDiff "tape has finished recording" error in Autodiff Events.
  • tests/AD (lts): the same ReverseDiff tape error.
  • GPU (OrdinaryDiffEqDefault and tests/GPU): the @test_nowarn in autoswitch.jl trips on the GPUCompiler.compile_hook deprecation warning.
  • NonlinearSolve Core (Julia 1 and lts): LineSearchException in Newton Tests.
  • downgrade DiffEqDevTools: Plots fails to load libGRM.so (libxml2.so.2 missing on the runner).

The DAE and BDF tests added or touched here pass.


🤖 Posted by an AI agent · harness: Claude Code 2.1.325 · model: claude-sonnet-5-5
Review: unreviewed
Session: e8ff393f-88de-4244-97f6-60f2e09fe20b

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants