Skip to content

Zero a sparse DAE J_du through its stored values (CuSparse jac_prototype) - #4865

Open
xtalax wants to merge 6 commits into
SciML:masterfrom
xtalax:dae-gpu-sparse-jdu
Open

xtalax wants to merge 6 commits into
SciML:masterfrom
xtalax:dae-gpu-sparse-jdu

Conversation

@xtalax

@xtalax xtalax commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Summary

A GPU DAEProblem with a CuSparseMatrixCSR jac_prototype fails in alg_cache, before the first step, with any DAE BDF method:

CanonicalIndexError: setindex! not defined for CuSparseMatrixCSR{Float64, Int32}
  error_if_canonical_setindex < setindex! < _setindex! < fill! < build_nlsolver < alg_cache < _ode_init

Cause

build_nlsolver (lib/OrdinaryDiffEqNonlinearSolve/src/utils.jl) allocated the separated DAE Jacobian as J_du = fill!(similar(J), false), in both the user-Jacobian branch and the AD-wrapper branch. cuSPARSE defines no fill! for its matrices, so Base falls back to per-entry setindex!, which cuSPARSE does not support either. (zero(J) is no substitute: on a CuSparseMatrixCSR it returns a CPU SparseMatrixCSC.)

Fix

J_du is now built once, before the branch, as

J_du = is_sparse(J) ? set_all_nzval!(similar(J), false) : fill!(similar(J), false)

is_sparse and set_all_nzval! already exist in OrdinaryDiffEqDifferentiation; the SparseArrays-extension method of set_all_nzval! writes nonzeros(A) .= val for any AbstractSparseMatrix, so it covers cuSPARSE and keeps the prototype's pattern. For a CPU SparseMatrixCSC the result is unchanged (same pattern, zero values). Dense J_du still goes through fill!.

The other similar(J) sites on the DAE path (build_J_W in OrdinaryDiffEqDifferentiation) either do not fill, or already branch on is_sparse and use set_all_nzval!, so nothing else needed changing.

Because is_sparse and set_all_nzval! are OrdinaryDiffEqDifferentiation internals, they are added to the all_explicit_imports_are_public ignore list in lib/OrdinaryDiffEqNonlinearSolve/test/qa/qa.jl, next to the other Differentiation names already there.

Tests

  • CPU regression test (lib/OrdinaryDiffEqBDF/test/dae_nlsolve_path_tests.jl, Core group): a minimal AbstractSparseMatrix wrapper with no setindex!, standing in for CuSparseMatrixCSR, used as the jac_prototype of a DAEFunction, both with a user jac and with AD (DFBDF(autodiff = AutoFiniteDiff())). It checks that init succeeds and that J_du has the prototype's type and pattern with zero stored values. On master both cases error with the same CanonicalIndexError ... fill! < build_nlsolver < alg_cache; with the fix, 8/8 pass.
  • GPU test (lib/OrdinaryDiffEqBDF/test/gpu/bdf_solvers.jl, GPU group): DFBDF() on du + u = 0 with a CuSparseMatrixCSR jac_prototype (CUDSS added to the GPU test env for the sparse LU). Run locally on an RTX 4080 SUPER: on master it errors with CanonicalIndexError: setindex! not defined for CuSparseMatrixCSR{Float64, Int32}; with the fix it passes 3/3 (retcode Success, CuArray result, matches exp(-1) to rtol = 1e-3). The existing QNDF/FBDF GPU tests still pass.
  • Reproducer (a 64-state du + u = 0 with a CuSparseMatrixCSR prototype, DFBDF(autodiff = AutoFiniteDiff()), NoInit): on master the stock run fails in fill! < build_nlsolver < alg_cache; with the fix it gets past alg_cache and, with residual rows in state order, solves with u(1) = 0.3678785505378462 (exact 0.36787944117144233).
  • OrdinaryDiffEqBDF Core (GROUP=Core Pkg.test()): passes (808 pass, 2 broken, 0 fail).
  • OrdinaryDiffEqNonlinearSolve Core, run file by file from a scratch environment with the in-repo sibling sublibraries dev'd: 1012 pass, 5 fail, 1 error, 40 broken. All six are pre-existing on master:
    • the error is newton_tests.jl:14 (LineSearchException), tracked in fix NLNewton BackTracking when FD residual-norm slope is noisy #4714;
    • the failures are nsa_jacobian_reuse_tests.jl:66 (45869 < 44710.0) and four at nsa_noinit_tests.jl:78 (functional matrix: rober-mm iip). Re-running those two files with this PR's source change reverted gives the identical five failures, with the same evaluated values. Neither file goes through the DAE NLNewton branch this PR changes.
  • OrdinaryDiffEqNonlinearSolve QA (GROUP=QA Pkg.test()): passes (Aqua 41/41 including ExplicitImports; JET 13 pass, 33 broken).
  • Runic: clean on all changed files.

Relationship to other PRs

Not addressed

When the linear solve returns NaN (for example cuDSS lu with its default configuration on a W with a zero diagonal), Newton never converges and DFBDF keeps shrinking dt without stopping at dtmin, until cj = α/(γ dt) overflows to Inf. J_u + cj * J_du in dae_jacobian2W! then densifies to a CuMatrix (Inf * 0 is not zero-preserving) and the failure surfaces as a scalar-indexing error in copyto!(::CuSparseMatrixCSR, ::CuMatrix). This PR leaves that dt-collapse behaviour alone.

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

xtalax and others added 2 commits October 13, 2026 18:55
`build_nlsolver` allocated the separated DAE Jacobian as
`J_du = fill!(similar(J), false)`. A `CuSparseMatrixCSR` has no `fill!`,
so Base fell back to `setindex!` and `alg_cache` threw a
`CanonicalIndexError` for any GPU `DAEProblem` with a cuSPARSE
`jac_prototype`. Sparse `J_du` is now zeroed with `set_all_nzval!`, which
keeps the prototype's pattern; dense `J_du` still uses `fill!`.

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>
…rt QA check

Both are OrdinaryDiffEqDifferentiation internals, imported alongside the
other Differentiation names already on the ignore list.

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

ChrisRackauckas-Claude commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

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

Fresh review of current head 263fc634dd3aba78bae43d735371ced1a13f57d2: no blocking source findings, low risk, high confidence within the exercised scope. Final CI comparison finds no test regressions across the four failing checks; this is a qualified handoff to the parent agent under its inherited-red policy, with attribution metadata still to finalize. The author adopted the exact public SparseArrays correction below after merging current master. The private-API findings on the older head are resolved on this reviewed head.

The fresh reviewer first recorded its own source assessment, then executed a coherent graph with all nine in-repository packages at this commit on Julia 1.12.6:

Check Actual result
Official BDF GROUP=Core 896 pass, 2 existing broken; exit 0
Independent coupled analytic DAE/cache controls 168/168; exit 0
Same final regression file on unmodified base d2adddd99f8e595fc3b9bec6e524b058641522f3 Existing 16 pass; both new user/AD Jacobian cases throw CanonicalIndexError for NoSetindexSparse; exit 1
Same file on current head Existing 16 plus new 8 pass, 24/24; exit 0

The 16 independent configurations cover dense and CSC storage with a stored structural zero, combined/separated user Jacobians, ForwardDiff/FiniteDiff, and default/NoInit initialization. They verify the analytic trajectory (maximum error below 5.93e-11), successful retcode, correct derivative Jacobian, untouched prototype and the same J_du object through step!/solve!. All source, Project and Manifest hashes remained stable during tests; both source worktrees are clean and all controllers/children ended. No skips or weakened assertions were introduced. The PR changes no public names/signatures or production dependencies; its GPU test adds the MIT-licensed CUDSS wrapper.

Current-head GPU evidence: the BDF GPU job passed 7/7, Julia 1.13.2/CUDA 6.4.2/CUDSS 0.8.1. Its tested merge tree exactly equals the reviewed head tree. The subset contains two QNDF checks, two FBDF checks, and three new diagonal DFBDF DAE checks using CuSparseMatrixCSR and disabled scalar indexing. This does not cover arbitrary nonlinear DAEs, every sparse format, user-Jacobian GPU paths, GPU cache reuse/reinitialization or all devices; no local GPU was available.

The reviewer also read current BDF/NonlinearSolve QA and BDF Core logs: they pass with their existing broken counts. QA, LTS, downgrade and downstream groups were not rerun locally. Final whole-PR CI is 171 successful, 4 failed, 3 skipped, none pending. All four failing checks match their default-branch counterpart's actual failure signatures: release/LTS Newton line search, Sensitivity Core4 Enzyme mi2, and MTK InterfaceI causal components. The complete final comparison covers every failing job URL. The Newton failure is tracked in the existing issue and its fix. This is an inherited-red handoff, not an all-green CI claim.

Failing check PR log Default log Shared failure
NonlinearSolve Core, LTS PR Default Newton line search; 4 pass, 1 error
NonlinearSolve Core, release PR Default Newton line search; 4 pass, 1 error
Sensitivity Core4 PR Default Enzyme mi2 !== nothing; 15 pass, 1 error, 2 broken
MTK InterfaceI PR Default components.jl:446; 1590 pass, 1 fail, 3 broken

The broader root GPU job also succeeds with 173 passes and 12 existing broken, on the same tested merge tree as the reviewed head. Its raw output and source graph were checked; the GPU scope limitations above still apply. The final NonlinearSolve downgrade job also succeeds, including its 32-pass DAEProblem testset.

Metadata finalization: the adoption commit declares Claude Code 2.1.306 / claude-opus-5-5 but omits the required Chris Rackauckas coauthor trailer. The parent/author must finalize attribution and preserve the linked Codex public-patch provenance; source-review clearance does not waive that requirement.

Risk assessment

  • Risk: low for the current five-file, 68-addition/4-deletion change.
  • Blast radius: in-place DAE Newton derivative-Jacobian allocation and its CPU/GPU tests; public names/signatures and production dependencies are unchanged.
  • Evidence: genuine base/head discrimination, official 896-pass Core run, 168 independent controls, exact-tree GPU7/7 plus broader173/12 existing broken, and final four-check default comparison.
  • Independent review: fresh Codex CLI 0.163.0 / gpt-6-astra, low risk/high confidence, no blocking findings; local session 01a15fa7-dd76-7b53-8bad-1f86d749a0cb (no session URL).
  • Merge: qualified parent handoff under inherited-red policy: low risk/high confidence and no observed test regressions; attribution metadata remains to finalize. No approval or merge performed by this session.
Earlier-head finding, exact proposed patch and its prior CPU validation

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

Independent review of head0a3f4b19: CHANGES / high H4 under the supplied public-API policy. No numerical defect was established in the executed paths; the allocation change itself fits low L6. The blockers are the new private dependency calls and exemptions, plus a private SparseArrays call in the fixture:

  • OrdinaryDiffEqDifferentiation.is_sparse and set_all_nzval! are not public. The independent QA control reports public_import=false, stale=false and raises NonPublicExplicitImportsException when precisely the two new exemptions are omitted. Keeping these exceptions conceals a real new dependency-policy violation. Use small public SparseArrays operations locally, or make the owner interfaces public, documented and versioned first.
  • SparseArrays.getcolptr is not public either. The new fixture can expose the public nzrange interface and compare per-column stored-index ranges while retaining its type, row-pattern and zero-value assertions.

An exact proposed patch follows. It removes the two imports/exemptions, uses the same sparse-value broadcast locally through public interfaces, and replaces the fixture's private method/access. The proposal now has executed CPU, QA-body, and formatting validation on this exact head and on current-master integration, detailed below. GPU execution of the proposal remains unverified. SparseArrays is already a declared runtime dependency.

--- a/lib/OrdinaryDiffEqNonlinearSolve/src/OrdinaryDiffEqNonlinearSolve.jl
+++ b/lib/OrdinaryDiffEqNonlinearSolve/src/OrdinaryDiffEqNonlinearSolve.jl
@@ -1,6 +1,7 @@
 module OrdinaryDiffEqNonlinearSolve
 
 using ADTypes: ADTypes, AutoForwardDiff, AutoFiniteDiff
+using SparseArrays: AbstractSparseMatrix, nonzeros
 using CommonSolve: init, solve, solve!, step!
 
 import SciMLBase
@@ -68,7 +69,7 @@
 import OrdinaryDiffEqDifferentiation: update_W!, is_always_new, build_uf, build_J_W,
     WOperator, StaticWOperator, wrapprecs, default_krylov_warm_start,
     build_jac_config, dolinsolve, set_linear_reltol!,
-    resize_jac_config!, jacobian2W!, jacobian!, calc_J, is_sparse, set_all_nzval!
+    resize_jac_config!, jacobian2W!, jacobian!, calc_J
 
 import StaticArraysCore: StaticArray
 
--- a/lib/OrdinaryDiffEqNonlinearSolve/src/utils.jl
+++ b/lib/OrdinaryDiffEqNonlinearSolve/src/utils.jl
@@ -953,8 +953,12 @@
             # Build separated DAE Jacobian cache if applicable
             if isdae
                 # cuSPARSE matrices have no `fill!`, so sparse J_du is zeroed through its stored values
-                J_du = is_sparse(J) ? set_all_nzval!(similar(J), false) :
-                    fill!(similar(J), false)
+                J_du = similar(J)
+                if J isa AbstractSparseMatrix
+                    nonzeros(J_du) .= false
+                else
+                    fill!(J_du, false)
+                end
                 if islinear(f) || SciMLBase.has_jac(f) ||
                         (SciMLBase.has_jac_u(f) && SciMLBase.has_jac_du(f))
                     # User provides Jacobian(s) — no wrappers, but still need J_du storage
--- a/lib/OrdinaryDiffEqNonlinearSolve/test/qa/qa.jl
+++ b/lib/OrdinaryDiffEqNonlinearSolve/test/qa/qa.jl
@@ -62,7 +62,7 @@
                 # OrdinaryDiffEqDifferentiation:
                 :build_J_W, :build_jac_config, :build_uf, :dolinsolve,
                 :is_always_new, :jacobian!, :jacobian2W!, :resize_jac_config!,
-                :update_W!, :wrapprecs, :is_sparse, :set_all_nzval!,
+                :update_W!, :wrapprecs,
                 # ForwardDiff / StaticArraysCore internals.
                 :Dual, :StaticArray,
             ),
--- a/lib/OrdinaryDiffEqBDF/test/dae_nlsolve_path_tests.jl
+++ b/lib/OrdinaryDiffEqBDF/test/dae_nlsolve_path_tests.jl
@@ -42,7 +42,7 @@
 Base.similar(M::NoSetindexSparse, ::Type{T}) where {T} = NoSetindexSparse(similar(M.A, T))
 SparseArrays.nonzeros(M::NoSetindexSparse) = nonzeros(M.A)
 SparseArrays.rowvals(M::NoSetindexSparse) = rowvals(M.A)
-SparseArrays.getcolptr(M::NoSetindexSparse) = SparseArrays.getcolptr(M.A)
+SparseArrays.nzrange(M::NoSetindexSparse, j::Integer) = nzrange(M.A, j)
 SparseArrays.nnz(M::NoSetindexSparse) = nnz(M.A)
 
 @testset "DAE J_du for a sparse jac_prototype without setindex!" begin
@@ -60,7 +60,8 @@
             J_du = integrator.cache.nlsolver.cache.dae_jacobians.J_du
             @test J_du isa NoSetindexSparse{Float64}
             @test rowvals(J_du) == rowvals(pattern)
-            @test SparseArrays.getcolptr(J_du) == SparseArrays.getcolptr(pattern)
+            @test [nzrange(J_du, j) for j in axes(J_du, 2)] ==
+                [nzrange(pattern, j) for j in axes(pattern, 2)]
             @test all(iszero, nonzeros(J_du))
         end
     end

Original-head evidence from the fresh reviewer:

  • Full BDF Core: 808 passed,2 existing broken, exit 0.
  • Exact eight-assertion regression errors on current master (CanonicalIndexError) and passes 8/8 here. Storage/solve probes pass 109/109 on the head and refreshed integration; another 5/5 automatic sparse checks pass on current master plus this change.
  • Supplied direct QA body passes 18/18 plus 1 own-method ambiguity check; removing the new exceptions exposes the private imports above. This was not a full official QA/JET rerun.
  • Actual existing GPU CI log at this exact head reports BDF Solvers GPU | 7 7, with CUDA 6.4.2/CUDSS 0.8.1 and local sublibrary paths. This is CI evidence, not reviewer-local CUDA execution, and does not validate the proposed patch.

No full NonlinearSolve Core/JET/downstream/runtime-floor rerun or combined4861/4864/4865 execution. Integration must preserve4861's matrix-free guard and4864's sparsity configuration. The reviewer read historical related-PR bodies after provisional risk, so this is not a fully blind rating; the publicness finding is backed by an executed negative control.

Executed validation of the public-interface proposal

The four-file patch above is unchanged (SHA-256 a2c3632bd747319c3ebfcbea03b98ac2341a1b161f748ffdc599cdd87b27cabc). Executed with Julia 1.12.7, -O0 --startup-file=no --compiled-modules=existing, four Julia/precompile threads and one BLAS/OMP thread:

Check Exact reviewed head + proposal Current master + PR + proposal
Existing BDF Core runner, all 14 testsets 808 passed, 2 existing broken 877 passed, 2 existing broken
Regression, storage and analytic solver controls 125/125 125/125
Public SparseArrays binding checks 7/7 7/7
Existing NonlinearSolve QA body 18/18 plus ambiguity check 1/1 18/18 plus ambiguity check 1/1
Runic / diff spelling 5 Julia files / exit 0 5 Julia files / exit 0

Integration uses d2adddd plus the original PR diff and this proposal. The 125 controls comprise 24 repeated official assertions, 96 storage/pattern/zero checks across four algorithms, two scalar types and three storage kinds, and five analytic dense/sparse user-Jacobian solve checks. The integration runtime command exits 0.

An additional five-assertion FD/CSC probe passes on integration. On the historical reviewed head, that probe errors before assertions with FieldError: type DAEFunction has no field mass_matrix, so the combined historical runtime command exits 1 after its passing Core/control summaries. The identical probe was also executed on the byte-identical unpatched historical head and throws the identical error. This is an inherited prerequisite failure, not a passing historical FD result; all assertions remain enabled.

These are CPU patch-validation results, not a new independent merge rating. QA executes the existing QA body directly, not full official Pkg.test QA/JET. Dependency floors, downstream, the joint matrix-free/colored/sparse-GPU stack, and GPU execution of this proposal remain unverified. The original-head GPU result below does not transfer to changed source. Author adoption and a fresh review of any revised head are still required.

Validation: Codex CLI 0.163.0, model gpt-6.1-sol, local session 01a15cab-4877-7682-9c4e-147cebaecd19 (no session URL); recovery Codex CLI 0.163.0, model gpt-6-astra, local session 01a15da7-8f33-7880-9dd7-f9c69dd5b7b6 (no session URL).

Independent reviewer: Codex CLI 0.163.0, model gpt-6.1-sol; local session 01a15d43-e97d-7c63-bad7-bcb568a205ca (no session URL exposed).

Links:

🤖 Posted by an AI agent — harness: Codex CLI 0.163.0 · model: gpt-6.1-sol
Conversation: local session 01a15ca3-5696-7ea3-bbac-ba551b6975af (no session URL exposed).

Links

🤖 Fresh independent review: Codex CLI 0.163.0, model gpt-6-astra, local session 01a15fa7-dd76-7b53-8bad-1f86d749a0cb (no session URL).
Public-API patch and posting: Codex CLI 0.163.0, model gpt-6.1-sol, local session 01a15ca3-5696-7ea3-bbac-ba551b6975af (no session URL).

xtalax and others added 2 commits October 21, 2026 18:30
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>
Replace the OrdinaryDiffEqDifferentiation internals is_sparse and
set_all_nzval! with an AbstractSparseMatrix check and a broadcast into
nonzeros, and drop their QA public-API exemptions. The test fixture
forwards the public nzrange instead of the non-public getcolptr.
CuSparseMatrixCSR subtypes AbstractSparseMatrix through
GPUArrays.AbstractGPUSparseArray and its nonzeros is the device nzVal
vector, so the zeroing stays a GPU broadcast with no scalar indexing.

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 21, 2026

Copy link
Copy Markdown
Member Author

Applied the public-API patch from the review above, unchanged (it applied cleanly; SHA-256 of the extracted diff matches a2c3632b…), in 263fc63. Current master was merged first (29a750f), with no conflicts.

  • J_du is now zeroed with J isa AbstractSparseMatrix ? (nonzeros(J_du) .= false) : fill!(J_du, false), using SparseArrays directly. The is_sparse/set_all_nzval! imports and their two QA exemptions are removed.
  • The NoSetindexSparse fixture forwards nzrange instead of getcolptr, and the test compares per-column nzranges.

CuSparse: the dispatch is the same as before. The old set_all_nzval! method was (A::AbstractSparseMatrix, val) -> nonzeros(A) .= val. With CUDA 6.4.2, CuSparseMatrixCSR <: AbstractCuSparseMatrix <: GPUArrays.AbstractGPUSparseArray <: SparseArrays.AbstractSparseArray, and GPUArrays defines nonzeros(::AbstractGPUSparseArray) = g.nzVal. So the new branch is still a device broadcast into a CuVector, with no scalar indexing. I did not run a new GPU test locally; GPU CI on this head will cover it.

Local CPU results (Julia 1.12.6, with in-repo DiffEqBase, Core, Differentiation, NonlinearSolve, BDF, SDIRK, Rosenbrock and FIRK dev'd into a scratch environment): 378 passed, 40 broken (pre-existing @test_broken), 0 failed, 0 errored. This covered BDF dae_nlsolve_path_tests.jl and dae_sparse_jacobian_tests.jl; NonlinearSolve sparse_dae_initialization_tests.jl, nsa_sparse_tests.jl, nsa_dae_tests.jl and mass_matrix_tests.jl; and NonlinearSolve test/qa/qa.jl without the exemptions. Runic --check is clean on the changed files.

🤖 Posted by an AI agent · harness: Claude Code 2.1.306 · 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
@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: 263fc634dd3aba78bae43d735371ced1a13f57d2.

Raw report SHA-256: 89bd95e4d6b00e8347c3c5b20a28975935d92a73137e085a75249540596fc5fc. Reviewer native session: 01a168e2-3102-7a80-ae01-4ccf820a3d54.

VERDICT: CHANGES

Risk

Medium-high (MH1: shared core in-place DAE initialization behavior in the default NLNewton path); confidence high for the CPU/storage assessment, limited for independently exercised CUDA behavior.

Blast radius: DAE algorithms using OrdinaryDiffEqNonlinearSolve with sparse Jacobian prototypes, including DFBDF and related BDF algorithms. The change replaces whole-matrix zeroing of separated J_du storage with zeroing of its stored values. It does not change an integration formula or public signature. Dense and working CPU sparse trajectories were identical in the independent controls. H2 is not asserted because no deliberate default numerical-result change was found. The core initialization reach makes MH1 applicable even though this is a small, demonstrated error fix.

Initial assessment captured before author/prior-review context: initial-risk.md, SHA256 d6116913783ff312e6523d97445dd5baef1b1d46206ffdd4ad23d118fa066001. It was written and hashed after the neutral rubric, metadata-only target check, diff and surrounding source, before any author body/comments or prior opinions. That initial medium-high/MH1 assessment is unchanged. Author and prior-review opinions remained withheld throughout.

G1 is satisfied for the executed CPU paths by an independent matrix-exponential reference. The assigned independent CUDA validation remains incomplete under G2; the positive exact-head GPU CI execution is recorded separately below. The recommendation requests verification and establishes no production code defect. Medium-high risk also requires requester decision under the rubric.

Blocking findings

  1. [P2, verification] Complete independent execution of the changed CUDA DAE path (G2). Locations: lib/OrdinaryDiffEqNonlinearSolve/src/utils.jl:956 and lib/OrdinaryDiffEqBDF/test/gpu/bdf_solvers.jl:37. Reachable target: DAEProblem with CuSparseMatrixCSR jac_prototype, including automatic and user-provided Jacobians, with scalar indexing disabled. The complete declared GPU payload was attempted against both pinned commits using Julia 1.12.1, CUDA 6.4.1 and CUDSS 0.8.1; both abort in the unchanged QNDF GPU test before the new DAE test. The independent sparse CUDA probe also aborts before reaching the changed initialization. A fresh standalone command, julia --startup-file=no --compiled-modules=existing --project=env-head probes/gpu-smoke-v2.jl, loads only CUDA/Test, passes CUDA.functional, then fails CUDA.zeros(Float64,6) with InvalidIRError for unsupported dynamic invocation of LLVM.Interop.pointerset (exit 1). Earlier failures also include pointerref. This establishes a local validation/toolchain limitation, not a PR regression, and does not establish its underlying root cause. The contract still to verify independently is zero J_du stored values without scalar indexing or structural changes, successful sparse DAE solving against an analytic oracle, and a faithful GPU baseline control. Required correction: execute the exact new sparse GPU test and independent analytic/structure probes on a working CUDA toolchain for the pinned head and base and record the results. The exact-head public CI already executes its seven GPU assertions successfully; it does not replace the independent run required by this assignment. No source correction is identified by this finding.

Non-blocking findings

None. The implementation uses the public SparseArrays.AbstractSparseMatrix/nonzeros interfaces and an existing declared dependency. The changed CPU initialization regression distinguishes the old scalar setindex! path from the new stored-value path. Existing numerical assertions were retained, and the added GPU test has a closed-form solution oracle.

What I ran

Review date: 2026-10-23. Public PR: #4865

Target and source integrity:

  • Head: 263fc634dd3aba78bae43d735371ced1a13f57d2.
  • Base branch: master; base and merge-base: d2adddd99f8e595fc3b9bec6e524b058641522f3.
  • git diff BASE...HEAD SHA256: b0890e2bfafd7f182a52d552ddb2b158a2c211ba128bb00b0f3bb34ce0f16238.
  • Read the entire final diff and non-merge commit patches, shared build_nlsolver/build_J_W logic, separated Jacobian refresh and W reconstruction, sparse extension, documented DAEFunction contracts, changed tests, declared test groups and workflows. No target AGENTS.md was found. No production source, Project or Manifest was edited.
  • git diff --check BASE...HEAD exited 0. Final detached head/base checkouts are clean. Final metadata refresh still reports the exact head/base, OPEN and non-draft; no commit substitution occurred.

Commands below use sanitized relative scratch labels. All Julia invocations used an explicit isolated --project, direct bash execution, TMPDIR within review scratch, JULIA_NUM_THREADS=1, JULIA_NUM_PRECOMPILE_TASKS=1 and JULIA_PKG_PRECOMPILE_AUTO=0. Test runs were serialized within this review. Initially the shared lock was used; the coordinator explicitly assigned a second serialized lane. No Pkg.test(), source fixes, commits, pushes, CI reruns or GitHub approval actions were performed.

Environment: Julia 1.12.1; local BDF 2.4.13, Core 4.19.0, Differentiation 3.12.4, NonlinearSolve library 2.9.9, DiffEqBase 7.21.4, SDIRK 2.9.8, DiffEqDevTools 3.6.3. External packages: SciMLBase 3.58.0, LinearSolve 5.18.2, NonlinearSolve 4.32.0, NonlinearSolveBase 2.55.0, ADTypes 1.24.0, ForwardDiff 1.4.6, DifferentiationInterface 0.7.21, Enzyme 0.13.216, LineSearches 7.8.2, CUDA/CUDACore 6.4.1, CUDSS 0.8.1, GPUArrays 11.5.16, GPUCompiler 2.10.0, KernelAbstractions 0.9.45, SciMLTesting 2.13.3 and SparseArrays 1.12.0. Head/base environments use the same external dependency metadata; the base Manifest was copied changing local source paths only. Manifest SHA256: head f403d2a429aab728bcd219ab6da988eb41dfd66fc47c0f63a227aaa8c6cba513, base e358ec5e7cbc0218321ef52d2828d626c192232545942e6830f06aba1b8a8dcd.

Executed groups and controls:

  1. Complete BDF Core group: GROUP=Core julia --startup-file=no --compiled-modules=existing -O1 --project=env-head probes/run-head.jl includes head/lib/OrdinaryDiffEqBDF/test/runtests.jl as its first phase. The phase exits 0: 896 passed, 2 existing broken, including DAE convergence, differentiation, events, initialization, nonlinear paths, sparse Jacobians, inference, BDF convergence/regression/time reversal, FBDF filters, Nordsieck and LHL tests. The changed nonlinear-path file passes 24/24; existing sparse DAE tests pass 12/12. Original runner overall exit 1 reflects other separately recorded failed phases, not failure of this Core phase.
  2. Faithful supplied CPU regression on base: GROUP=Core julia --startup-file=no --compiled-modules=existing -O1 --project=env-base probes/run-base.jl includes the exact head dae_nlsolve_path_tests.jl. Existing 16 assertions pass; the two new analytic/AD NoSetindexSparse cases fail CanonicalIndexError in the old whole-matrix fill! at base utils.jl:958 and utils.jl:971; phase exit 1. This is exact supplied fail-before/pass-after evidence. It does not claim a GPU fail-before/pass-after.
  3. Independent numerical and structural controls: EXPECT_PRESERVED_PATTERN=true julia --startup-file=no --compiled-modules=existing -O1 --project=env-head probes/cpu-reference-v3.jl and the identical command with env-base: both exit 0, 88/88 assertions each. Twelve cases cover dense and sparse Float64 DFBDF with combined/separate analytic Jacobians, ForwardDiff and finite differences; sparse DImplicitEuler, DABDF2 and DNordsieckBDF; and sparse Float32 finite differences. The independent oracle is exp(-M\A)u0 for an explicitly specified linear residual Mdu+A*u. J_du initially has zero stored values, retains all ten sparse entries and their pattern, does not alias J, and does not mutate the prototype. All solutions have Success retcodes. Every initialization and numerical output line is identical between head and base. Maximum errors: DFBDF Float64 approximately 9.07e-11 (sparse finite differences 5.42e-11), DImplicitEuler 1.03e-5, DABDF2 5.62e-7, DNordsieckBDF 1.21e-8 and Float32 2.83e-6. All meet the predetermined, unchanged bounds in the attached probe.
  4. Complete NonlinearSolve Core group attempted on head and base: each corresponding runner includes its repository runtests.jl with GROUP=Core. Both abort in Newton Tests with LineSearchException, search direction not a direction of descent; phase exit 1. These are actual matching base controls, not a passing control presented as proof of a baseline issue. The rest of that group did not execute locally. Exact head/base CI has matching diagnostics on Julia 1 and lts.
  5. Complete declared GPU payload attempted on both commits: the runner includes the exact head test/gpu/bdf_solvers.jl in the isolated dependency environment, avoiding source-tree environment writes. Both phase exits are 1 in unchanged QNDF due to the kernel compilation failure described above. The intended independent Float32/Float64 CSR/CSC analytic-reference probe was also attempted; all eight cases error before the changed path. Device detection is not counted as solver execution.
  6. Standalone GPU environment control: julia --startup-file=no --compiled-modules=existing --project=env-head probes/gpu-smoke-v2.jl, using normal default optimization instead of -O1, exits 1. H100 PCIe and A100 devices are available, but basic CUDA.zeros fails without OrdinaryDiffEq loaded. Local LLVM 18.1.7, CUDA runtime 13.4.0, driver 610.57.4 for CUDA 13.3; the cause of the compiler failure was not repaired or attributed to the PR.

CI inspected, including full relevant job logs and failed logs:

Validation history and artifact integrity:

The first reviewer-owned execution was interrupted when a checkpoint ended its tool-owned processes; no completion was inferred. The coordinator mechanically relaunched unchanged scripts in root-owned processes. Original runner exits were 1/1 as the phase errors above require. Original independent fixtures omitted NoInit, and a Pkg import inside a closure caused a reviewer world-age error. Version 2 corrected those imports: numerical/structure assertions ran and passed 76/76 on each commit, with twelve remaining missing successful_retcode-import errors per commit; those suites exited 1. Version 3 changes only that explicit import and passes 88/88 on both commits. The standalone GPU smoke still exits 1. No equation, oracle, assertion, expected value or tolerance was relaxed; original, interrupted and corrected logs remain separate.

The coordinator reported collected outer statuses: original launcher 1, v2 launcher 1, final focused v3 launcher 0. Their script hashes are respectively 0f960fa8930bb45eb34806df8f510765191ae4751171bb084bbb44f54869226e, 2e5085498547978be694633575bb8018eeed7a3880cd0fb51a71799139d456db and 635b9879e43f57f3ac5edaf738d1a59310c2b0a5a19bacccbf2b5ca9cc92afd6. Per-command exits and actual output were independently inspected by this reviewer.

Public synthetic source, portable preparation, commands and key observed output are attached as public-evidence.md, SHA256 23ca0f7b59d69b3ce5947f1194b370a3f37162f406cb158261d9e8064250760c. Key raw-log SHA256: head numerical 72fd8d55fcef2bc818d7d105c070e83147e20ee11d56e3970ffd9b78a27ece47, base numerical 3f89f589800be81e2abab25e1e9a6a44dab4a924d90c971b5135d6ca444368bb, CUDA-only smoke f7de68f6576f64b2c7578f2b80b1b8c2551072a04196b1c98732b99642ea4c0b, complete BDF Core 1eb45d6e378e0de92dd593ef554435ffe8dfd09c786b7de46e2d290147633d31, faithful CPU baseline 3583d81e3cf746f8530f54d888f12fea05a7a2b559e98a1085056d9630520f16. Raw logs/environments are retained locally; they are not public attachments because they include machine paths.

What I did not verify

  • Independent execution of the changed CUDA DAE initialization/solve and the CSR/CSC Float32/Float64 user/AD probes; faithful GPU fail-before/pass-after. The local CUDA-only kernel failure prevents reaching them. The exact-head GPU CI test did execute successfully, but broader independent CUDA cases remain needs-verification under the assignment's G2 requirement.
  • Completion of the local NonlinearSolve Core group after the matching base/head Newton failure. Full BDF Core did complete.
  • Local reruns of the heavyweight ModelingToolkit/SciMLSensitivity downstream groups, or causal root fixes for their matching base CI failures. No claim that every failed check has been resolved.
  • Which checks are formally branch-protection required: the required-status-check API returned 404. All observed failed, pending and skipped checks are accounted for; unreported required-check configuration remains unknown.
  • Local Julia lts/pre, other operating systems, other GPU platforms and numerical/performance cases beyond the listed tests. Local package versions differ slightly from CI; no claim of identical CI environment reproduction or measured performance improvement.

Reviewer provenance

Actual native session: 01a168e2-3102-7a80-ae01-4ccf820a3d54; Codex Desktop, native session_meta cli_version 0.159.2, originator Codex Desktop, runtime turn_context model gpt-6.1-sol, effort xhigh. These values were read from the native session metadata and rechecked after resume; requested parameters were not treated as proof. The inherited CODEX_SESSION_ID refers to a parent session, so the verified native session_meta.id/CODEX_THREAD_ID identifies this review. Session URL: none published/unknown. No private transcript was shared.

Context-exposure order: neutral rubric and supplied public scope/commits; metadata-only PR check; complete diff/surrounding code; dated initial risk plus recorded hash; independent source/tests/CI investigation. Author body/comments, prior reviews and author risk opinions were never read. An initial metadata-extraction command incidentally emitted developer-instruction content embedded in session_meta; it exposed no author/prior-review opinion, and the initial assessment records that event. Coordinator follow-ups supplied execution/lifecycle status and requested mechanical recovery, not conclusions about the code. These resumptions are one reviewer session and one review round.

Grade handoff

Verified public PR account: @xtalax; actual agent author/model/harness provenance of the work is unknown. Task category: numerical solver bug fix / sparse CPU and CUDA DAE storage initialization. Task difficulty: 3, a moderate cross-package sparse-dispatch and regression-validation task; no integration-method redesign. Review round: 1, first independent assessment of this pinned head, with reviewer fixture repairs retained in the same round.

Author-work numeric grade: unknown overall, withheld pending required independent CUDA validation. The reviewed CPU fix and supplied tests meet their demonstrated contract; no author code defect or source repair was identified. The reviewer's import errors, interruption and local CUDA toolchain problem are not author-work errors and should not lower an author grade by inference. Reviewer accuracy, earlier-reviewer agreement/missed/false-positive outcomes, model costs and any later merge/revert outcome remain unknown; no earlier review was read or graded.

Links

PR: #4865
Head diff: d2adddd...263fc63
Head BDF Core: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39648363246/job/119390050413
Head BDF Core lts: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39648363246/job/119390050227
Head GPU: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39648363246/job/119390048312
Head NL Core: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39648363246/job/119390050421
Head NL Core lts: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39648363246/job/119390050913
Head MTK failure: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39648362734/job/119389843052
Head Sensitivity failure: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39648362734/job/119389843305
Base NL Core: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39529653250/job/118992494388
Base NL Core lts: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39529653250/job/118992493996
Base MTK failure: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39529652857/job/118992368541
Base Sensitivity failure: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/39529652857/job/118992368663

🤖 Posted by an AI agent · harness: Codex Desktop 0.159.2 · model: gpt-6.1-sol
Review: unreviewed
Session: 01a168e2-3102-7a80-ae01-4ccf820a3d54

Supporting public evidence · SHA-256 23ca0f7b59d69b3ce5947f1194b370a3f37162f406cb158261d9e8064250760c

Public evidence: OrdinaryDiffEq PR 4865

Reviewed head 263fc634dd3aba78bae43d735371ced1a13f57d2; base/merge-base d2adddd99f8e595fc3b9bec6e524b058641522f3. Final diff SHA256 b0890e2bfafd7f182a52d552ddb2b158a2c211ba128bb00b0f3bb34ce0f16238.

Portable preparation

Create detached head and base checkouts of those commits. Use Julia 1.12.1. Create isolated env-head/env-base directories with the union of BDF and NonlinearSolve test dependencies. This is the preparation logic used; paths are portable placeholders:

from pathlib import Path
import tomllib
for label in ("head", "base"):
    root = Path(label).resolve()
    env = Path("env-" + label)
    env.mkdir(exist_ok=True)
    packages = {}
    for path in (root / "lib").glob("*/Project.toml"):
        data = tomllib.loads(path.read_text())
        packages[data["name"]] = (path.parent, data)
    deps, compat = {}, {}
    for name in ("OrdinaryDiffEqBDF", "OrdinaryDiffEqNonlinearSolve"):
        path, data = packages[name]
        deps[name] = data["uuid"]
        deps.update(data["deps"])
        deps.update({n: data["extras"][n] for n in data["targets"]["test"]})
        compat.update(data["compat"])
    gpu = tomllib.loads((Path("head") / "lib/OrdinaryDiffEqBDF/test/gpu/Project.toml").read_text())
    deps.update(gpu["deps"])
    compat.update(gpu["compat"])
    while True:
        old = set(deps)
        for name in list(deps):
            if name in packages:
                deps.update({n:u for n,u in packages[name][1]["deps"].items() if n in packages})
        if old == set(deps): break
    lines = ["[deps]"] + [f'{n} = "{u}"' for n,u in sorted(deps.items())]
    lines += ["", "[compat]"] + [f'{n} = "{v}"' for n,v in sorted(compat.items()) if n in deps or n == "julia"]
    lines += ["", "[sources]"] + [f'{n} = {{path = "{packages[n][0]}"}}' for n in sorted(deps) if n in packages]
    (env / "Project.toml").write_text("\n".join(lines) + "\n")

Resolve/instantiate head with automatic precompile disabled; make the base Manifest a copy replacing only the checkout root, then instantiate base. The actual comparison confirmed identical dependency metadata except local paths/project hash. Pin or inspect versions before reproducing: SciMLBase 3.58.0, LinearSolve 5.18.2, NonlinearSolve 4.32.0, ADTypes 1.24.0, ForwardDiff 1.4.6, DifferentiationInterface 0.7.21, LineSearches 7.8.2, CUDA 6.4.1, CUDSS 0.8.1, Enzyme 0.13.216. Other package versions are in the raw review. Re-resolving a registry later can select different versions.

mkdir -p scratch logs
export TMPDIR="$PWD/scratch"
export JULIA_NUM_THREADS=1 JULIA_NUM_PRECOMPILE_TASKS=1 JULIA_PKG_PRECOMPILE_AUTO=0 GROUP=Core EXPECT_PRESERVED_PATTERN=true
julia --startup-file=no --project=env-head -e 'using Pkg; Pkg.resolve(); Pkg.instantiate(); Pkg.status()'
# Copy the resolved Manifest to env-base, changing head source paths to base, then:
julia --startup-file=no --project=env-base -e 'using Pkg; Pkg.instantiate(); Pkg.status()'

Exact supplied regression and complete declared group

julia --startup-file=no --compiled-modules=existing -O1 --project=env-head head/lib/OrdinaryDiffEqBDF/test/runtests.jl
julia --startup-file=no --compiled-modules=existing -O1 --project=env-base head/lib/OrdinaryDiffEqBDF/test/dae_nlsolve_path_tests.jl

Actual head Core result: 896 pass, 2 existing broken, phase exit 0. Changed nonlinear-path file: 24/24. Existing sparse DAE file: 12/12.

The exact candidate nonlinear-path file on base: existing 16/16 pass; both new user jac and AD jac cases error with CanonicalIndexError: setindex! not defined for NoSetindexSparse. Stack points to base build_nlsolver whole-matrix fill!, utils.jl:958 and utils.jl:971. Its phase exit is 1. This is faithful CPU fail-before/pass-after, rather than a reconstructed reproduction.

Independent numerical and structure probe

Save as cpu-reference-v3.jl; this is the final executed synthetic source:

using OrdinaryDiffEqBDF, OrdinaryDiffEqCore, OrdinaryDiffEqNonlinearSolve
using SciMLBase, ADTypes, SparseArrays, LinearAlgebra, Test
using SciMLBase: NoInit, successful_retcode

println("source_BDF=", pathof(OrdinaryDiffEqBDF))
println("source_NonlinearSolve=", pathof(OrdinaryDiffEqNonlinearSolve))
println("Julia=", VERSION)

# Independent oracle: the matrix exponential of the linear system's generator.
function reference_probe(T, representation, jacmode, Alg)
    n = 4
    A = T[2 -1 0 0; -1 3 -1 0; 0 -1 3 -1; 0 0 -1 2]
    M = Diagonal(T[1, 2, 3, 4])
    u0 = T[1, 0.5, 0.25, 0.125]
    du0 = -(M \ (A * u0))
    residual!(r, du, u, p, t) = (mul!(r, A, u); r .+= M * du; nothing)
    proto = representation == :sparse ? sparse(A + M) : Matrix(A + M)
    frozen = deepcopy(proto)
    function combined!(J, du, u, p, gamma, t)
        J .= A + gamma * M
        nothing
    end
    function jac_u!(J, du, u, p, t)
        J .= A
        nothing
    end
    function jac_du!(J, du, u, p, t)
        J .= M
        nothing
    end
    f = jacmode == :combined ? DAEFunction(residual!; jac=combined!, jac_prototype=proto) :
        jacmode == :separate ? DAEFunction(residual!; jac_u=jac_u!, jac_du=jac_du!, jac_prototype=proto) :
        DAEFunction(residual!; jac_prototype=proto)
    prob = DAEProblem(f, du0, u0, (zero(T), one(T)))
    backend = jacmode == :finite ? AutoFiniteDiff() : AutoForwardDiff()
    alg = Alg(; autodiff=backend)
    tol = T == Float32 ? 1f-5 : 1e-9
    integ = init(prob, alg; initializealg=NoInit(), abstol=tol, reltol=tol)
    cache = integ.cache.nlsolver.cache
    Jdu = cache.dae_jacobians.J_du
    println("init ", (T,representation,jacmode,Alg), " Jdu_nnz=", issparse(Jdu) ? nnz(Jdu) : length(Jdu), " prototype_nnz=", issparse(proto) ? nnz(proto) : length(proto))
    @test all(iszero, issparse(Jdu) ? nonzeros(Jdu) : Jdu)
    @test Jdu !== cache.J
    @test proto == frozen
    if representation == :sparse && get(ENV, "EXPECT_PRESERVED_PATTERN", "false") == "true"
        @test Jdu.colptr == proto.colptr
        @test rowvals(Jdu) == rowvals(proto)
    end
    sol = solve!(integ)
    oracle = exp(-(Matrix(M) \ A)) * u0
    err = maximum(abs, sol.u[end] - oracle)
    println("solve ", (T,representation,jacmode,Alg), " retcode=", sol.retcode, " maxerr=", err)
    @test successful_retcode(sol)
    accuracy = Alg == DImplicitEuler ? 1e-4 : Alg == DABDF2 ? 1e-5 : 100tol
    @test isapprox(sol.u[end], oracle; atol=accuracy, rtol=accuracy)
    @test proto == frozen
    return nothing
end

@testset "Independent CPU linear DAE oracle" begin
    for rep in (:dense,:sparse), jac in (:combined,:separate,:forward,:finite)
        @testset "$rep $jac" reference_probe(Float64,rep,jac,DFBDF)
    end
    for Alg in (DImplicitEuler,DABDF2,DNordsieckBDF)
        @testset "$Alg" reference_probe(Float64,:sparse,:combined,Alg)
    end
    @testset "Float32" reference_probe(Float32,:sparse,:finite,DFBDF)
end
julia --startup-file=no --compiled-modules=existing -O1 --project=env-head cpu-reference-v3.jl
julia --startup-file=no --compiled-modules=existing -O1 --project=env-base cpu-reference-v3.jl

Both exit 0, 88/88 assertions, all twelve solutions have Success retcodes. Every initialization and numerical output line is identical between commits. Sparse initial J_du retains all 10 stored entries, row indices and column pointers; all stored values are zero; the prototype remains unchanged. Errors against the independently computed matrix exponential:

Case Maximum absolute error (both commits)
DFBDF, Float64, dense analytic combined/separate/AD and sparse analytic combined/separate/AD 9.06869579431202e-11
DFBDF, Float64, dense finite differences 9.064621275811646e-11
DFBDF, Float64, sparse finite differences 5.4183046938049984e-11
DImplicitEuler, sparse combined analytic 1.0306022738770793e-5
DABDF2, sparse combined analytic 5.619201808304553e-7
DNordsieckBDF, sparse combined analytic 1.20622203336751e-8
DFBDF, Float32, sparse finite differences 2.8312206e-6

Predetermined accuracy bounds remain unchanged. First-order DImplicitEuler uses 1e-4 and second-order DABDF2 1e-5; others use 100 times their integration tolerance. No result was used to select or relax these bounds.

Local CUDA gap and actual public CI execution

Local complete GPU payload attempts on both commits abort in the unchanged QNDF test. The independent sparse GPU probe aborts before reaching the changed DAE initialization. A fresh CUDA-only default-optimization diagnostic confirms the limitation independently of OrdinaryDiffEq:

using CUDA, Test
CUDA.versioninfo()
CUDA.allowscalar(false)
@testset "GPU environment smoke with default compiler optimization" begin
    @test CUDA.functional()
    x = CUDA.zeros(Float64, 6)
    @test Array(x) == zeros(6)
    x .+= 2.0
    @test Array(x) == fill(2.0, 6)
end
julia --startup-file=no --compiled-modules=existing --project=env-head gpu-smoke-v2.jl

Exit 1: CUDA.functional passes, then CUDA.zeros fails InvalidIRError, unsupported dynamic invocation of LLVM.Interop.pointerset. The analogous original failures include pointerref. H100 PCIe and A100 devices are visible. Local Julia 1.12.1/LLVM 18.1.7, CUDA/CUDACore 6.4.1, GPUCompiler 2.10.0, GPUArrays 11.5.16; runtime 13.4.0, driver 610.57.4 for CUDA 13.3. This does not establish the underlying toolchain root cause and provides no changed-GPU-path validation.

The exact-head GPU CI job actually executed 7/7 assertions, including the new sparse DFBDF solution check, with CUDA 6.4.2/CUDSS 0.8.1 and checked-out local candidate solver packages. This positive CI evidence is separate from the incomplete independent local CUDA execution.

Reviewer harness history

The initial reviewer-owned attempt was interrupted when its checkpoint ended; it is not counted as completed. The coordinator reran unchanged scripts. Original independent CPU fixture missed NoInit; the original environment phase imported Pkg inside a closure and hit world age. Version 2 repairs those imports and executes all numerical/structure assertions, but misses explicit successful_retcode: 76 pass +12 import errors on each commit, not a passing suite. Version 3 adds that import and yields 88/88, exit 0 on both commits. No source fix, changed expected value, skip or tolerance relaxation occurred. Original and corrected results are separately retained.

🤖 Posted by an AI agent · harness: Codex Desktop 0.159.2 · model: gpt-6.1-sol
Review: unreviewed
Session: 01a168e2-3102-7a80-ae01-4ccf820a3d54


🤖 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

@xtalax-droid

Copy link
Copy Markdown

Thanks for the independent review of head 263fc634. The review identifies no source defect; its only finding is that the changed CUDA DAE path could not be run locally, because CUDA.zeros(Float64, 6) already fails with InvalidIRError (LLVM.Interop.pointerset) on the reviewer's toolchain without OrdinaryDiffEq loaded.

For that gap, the exact-head GPU CI passes: BDF GPU job (7/7, including the new sparse DFBDF solution check, CUDA 6.4.2 / CUDSS 0.8.1) and the self-hosted GPU job. The head has not changed since the reviewed commit.


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

@xtalax-droid

Copy link
Copy Markdown

CI status: the red checks on this PR are shared with unrelated PRs and are not caused by its diff.

This PR only changes how J_du is zeroed in utils.jl, which the Newton relaxation path does not reach.


🤖 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 result after the merge: dae_nlsolve_path_tests.jl 24/24. The CUDA path was not run locally; the GPU CI job passed on the previous head. This PR and #4864 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 e85c30d: seven of the 8 failing checks (ProbNumDiffEq, SciMLSensitivity Core2, OrdinaryDiffEqDefault GPU, NonlinearSolve Core on Julia 1 and lts, tests/AD lts, tests/GPU) are the same failures seen on unrelated PRs (#5012, #5011, #4986).

The eighth, OrdinaryDiffEqBDF Core on Julia 1, fails in resize_tests.jl ("BDF state resizing", FBDF and QNDF on a non-DAE ODE). This change only touches the DAE branch of build_nlsolver, which that test does not take, and the same test passes on #4864 at the same base. It looks like a flake and a re-run of that job would confirm it.


🤖 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