Skip to content

Preserve the DAE step start during callback interpolation - #4466

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix/rosenbrock-dae-dense-4456
Sep 6, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix/rosenbrock-dae-dense-4456

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Sep 5, 2026 •

Copy link
Copy Markdown
Member

DAE callback reinitialization overwrote uprev with the event state before rebuilding the shortened step's interpolation and processing saveat. Preserve the left endpoint until the normal next-step update. The adaptive regression covers Rodas4, Rodas4P, and Rodas5P, in-place/out-of-place problems, terminating/continuing callbacks, and dense output/saveat; the existing fixed-step regression remains intact.

Addresses the reproducer contributed in #4456 and follows #4411.

Ignore this PR until reviewed by @ChrisRackauckas.

Failing before / passing after

The original PR's exact test script on unmodified master, then with the fix:

Before: Callback-truncated interpolation | 1712 pass, 130 fail, 1842 total
After:  Callback-truncated interpolation | 1842 pass, 1842 total

Both runs used Julia 1.12.7 and the local Rosenbrock project with --compiled-modules=existing. This loading option avoided shared precompile-cache waits; assertions and test groups were unchanged.

The final regression was also run against independent clean-master and controlled-reversal worktrees:

~/.juliaup/bin/julia +1.12 --compiled-modules=existing --project=base-investigation/lib/OrdinaryDiffEqRosenbrock OrdinaryDiffEq.jl/lib/OrdinaryDiffEqRosenbrock/test/callback_truncated_interpolation.jl
~/.juliaup/bin/julia +1.12 --compiled-modules=existing --project=base-reversal/lib/OrdinaryDiffEqRosenbrock OrdinaryDiffEq.jl/lib/OrdinaryDiffEqRosenbrock/test/callback_truncated_interpolation.jl
Before:
Callback-truncated interpolation    |   21 pass,            21 total
Adaptive DAE callback interpolation | 2277 pass, 219 fail, 2496 total

After:
Callback-truncated interpolation    |   21 pass,   21 total
Adaptive DAE callback interpolation | 2496 pass, 2496 total

The reversal worktree differs from master by exactly the deleted update_uprev! call. This is a controlled hunk reversal on current master, not a full historical bisect.

Root cause history

git blame traces the removed reset to 3d9cb3e. Its separate initial-solve state reset is preserved. The normal apply_step! path already updates uprev before the next step.

Local validation

All package-test commands used TMPDIR="$PWD/../tmp" and JULIA_PKG_PRECOMPILE_AUTO=0 from the repository root.

GROUP=Core ~/.juliaup/bin/julia +1.12 --compiled-modules=existing --project=lib/OrdinaryDiffEqRosenbrock -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'
GROUP=Core ~/.juliaup/bin/julia +1.12 --compiled-modules=existing --project=lib/OrdinaryDiffEqCore -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'
GROUP=QA ~/.juliaup/bin/julia +1.12 --compiled-modules=existing --project=lib/OrdinaryDiffEqCore -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'
GROUP=InterfaceIII ~/.juliaup/bin/julia +1.12 --compiled-modules=existing --project -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'
GROUP=QA ~/.juliaup/bin/julia +1.12 --compiled-modules=existing --project -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'
DAE Rosenbrock AD Tests          |   16 / 16 passed
Callback-truncated interpolation | 2517 / 2517 passed
Rosenbrock AD Tests              |   65 / 65 passed
Rosenbrock Convergence Tests     |  195 / 195 passed
Testing OrdinaryDiffEqRosenbrock tests passed

OrdinaryDiffEqCore Core: 117 passed
OrdinaryDiffEqCore QA: 57 passed, 1 pre-existing broken
Testing OrdinaryDiffEqCore tests passed

InterfaceIII: 262 passed, 4 pre-existing broken
Quality Assurance Tests | 109 / 109 passed
Testing OrdinaryDiffEq tests passed

Runic (--check --diff), typos on both changed files, and git diff --check passed.

Validation environment

An initial diagnostic-profiled QA process crashed inside Julia's profiler module loader. A subsequent unprofiled QA run passed inference, JET, and the other Aqua checks but failed the persistent-task precompilation check. That failure also reproduced on clean master with --compiled-modules=existing; the unchanged check with the same 60-second limit passed on both revisions with normal module caching. The original --compiled-modules=existing check also passed after the caches warmed, isolating the failure to cache state rather than repository source. No assertions, tolerances, or existing broken/skip declarations were changed.

The final standard Rosenbrock QA group passed:

TMPDIR="$PWD/../tmp" JULIA_PKG_PRECOMPILE_AUTO=0 GROUP=QA ~/.juliaup/bin/julia +1.12 --project=lib/OrdinaryDiffEqRosenbrock -e 'using Pkg; Pkg.test()'
Allocation Tests | Broken 20, Total 20 (pre-existing)
Inference Tests  | Pass 40, Total 40
JET Tests        | Pass 1, Total 1
Aqua             | Pass 21, Total 21
Testing OrdinaryDiffEqRosenbrock tests passed

CI status (2026-09-05 15:15 UTC)

For commit 09302abd5ac328c2fa6947c4c569a9a9e29e868b, GitHub reports 254 successful checks, zero failures, one skipped workflow matrix entry, and four queued GPU checks. All CPU test matrices, QA, formatting, spelling, documentation, dependency-downgrade tests, and downstream integration tests have passed. Root GPU tests and the Core, LowStorageRK, StabilizedRK, and RKIP sublibrary GPU tests have also passed.

The remaining Rosenbrock, BDF, Default, and Linear GPU checks are waiting for runners. Full CI completion is therefore still pending; these checks have not been disabled or cancelled. Current results: https://github.com/SciML/OrdinaryDiffEq.jl/pull/4466/checks

Not verified locally

Other Julia versions (including prerelease), GPU, downstream packages, and the full monorepo Everything suite were not run locally. No documentation build was run because this change adds no docstrings, documentation, or public API.

Links

🤖 Generated with Codex CLI 0.153.4 (model: gpt-6-astra; session: local transcript /home/crackauc/.codex/sessions/2026/09/05/rollout-2026-09-05T05-55-03-01a070fe-35a9-7de3-8a19-e711a7c4ed0d.jsonl).

Keep uprev at tprev while reinitializing the event endpoint, rebuilding
interpolation, and processing saveat. Cover adaptive mass-matrix DAEs
with terminating and continuing callbacks alongside the existing tests.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.153.4
Agent-Model: gpt-6-astra
Agent-Session: /home/crackauc/.codex/sessions/2026/09/05/rollout-2026-09-05T05-55-03-01a070fe-35a9-7de3-8a19-e711a7c4ed0d.jsonl (local transcript)
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review September 6, 2026 10:20
@ChrisRackauckas
ChrisRackauckas merged commit f0cd640 into SciML:master Sep 6, 2026
261 checks passed
ChrisRackauckas added a commit that referenced this pull request Sep 7, 2026
- DiffEqBase: wrap mass-matrix problems on the finite-difference promote_f path (#4459)
- Preserve the DAE step start during callback interpolation (#4466)
- Release DiffEqBase 7.20.1 (#4474)
- Release OrdinaryDiffEqCore 4.16.1 (#4475)
- Release OrdinaryDiffEqNonlinearSolve 2.9.5 (#4476)
- Run IDSolve's nonlinear solve at the integrator's tolerances (#4468)
- Build W through the allocating path for a sparse GPU Jacobian with a scalar mass matrix (#4452)
- Fix threaded stochastic work-precision isolation (#4462)
- Differentiate wrapped DAEFunctions with chunk size 1, like ODEFunctions (#4464)
- Rebuild MethodOfSteps W after history updates (#4396)



Agent-Harness: Claude Code
Agent-Model: claude-opus-5[1m]
Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
ChrisRackauckas added a commit that referenced this pull request Sep 7, 2026
- Fix SciMLBase reexport QA on Julia LTS (#4450)
- Preserve conditioning in OOP no-init solves (#4438)
- Read the test group from GROUP like the CI passes it (#4447)
- Raise root GPU test timeout (#4449)
- Fix default SDE dt vector lengths (#4454)
- Bump DiffEqDevTools to 3.6.2 (#4461)
- DiffEqBase: wrap mass-matrix problems on the finite-difference promote_f path (#4459)
- Preserve the DAE step start during callback interpolation (#4466)
- Release DiffEqBase 7.20.1 (#4474)
- Release OrdinaryDiffEqCore 4.16.1 (#4475)



Agent-Harness: Claude Code
Agent-Model: claude-opus-5[1m]
Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
ChrisRackauckas referenced this pull request Sep 7, 2026
* Resolve symbolic idxs in the integrator interpolant

`integrator(t; idxs = sym)` passed `idxs` straight to the dense-output
interpolant, which only accepts integer component indices, so any symbolic index
threw `ArgumentError: invalid index` and an observed equation could never be
retrieved. `sol(t; idxs = sym)` has resolved both for a long time.

Symbolic `idxs` now route to `SciMLBase.symbolic_interpolation`, which evaluates
the current step's interpolant and applies the symbolic getter to it. Integer,
`nothing`, and in-place calls are unchanged.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_019wKpyZHy9u4QhR4ePiVmam

* Route symbolic idxs for DelayDiffEq integrators too

`DDEIntegrator` has the same gap `ODEIntegrator` did: `integrator(t; idxs = sym)`
went straight to the dense-output interpolant, which only accepts integer
component indices, so symbolic indexes threw and observed equations were
unreachable.

The predicate moves to the public `SciMLBase.has_symbolic_idxs` rather than
staying an OrdinaryDiffEqCore internal, since DelayDiffEq, Sundials and
ODEInterfaceDiffEq all need the same decision.

`HistoryODEIntegrator` is deliberately left alone: it implements none of the
`SymbolicIndexingInterface` methods a `DEIntegrator` needs, so symbolic indexing
against it is unsupported before and after this change.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_019wKpyZHy9u4QhR4ePiVmam

* Require SciMLBase 3.53 for has_symbolic_idxs

`has_symbolic_idxs` did not make it into the 3.52.0 release, so the floor moves
to the version that carries it.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_019wKpyZHy9u4QhR4ePiVmam

---------

Co-authored-by: ChrisRackauckas-Claude <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
ChrisRackauckas added a commit that referenced this pull request Sep 11, 2026
- Preserve conditioning in OOP no-init solves (#4438)
- Read the test group from GROUP like the CI passes it (#4447)
- Raise root GPU test timeout (#4449)
- Fix default SDE dt vector lengths (#4454)
- Bump DiffEqDevTools to 3.6.2 (#4461)
- DiffEqBase: wrap mass-matrix problems on the finite-difference promote_f path (#4459)
- Preserve the DAE step start during callback interpolation (#4466)
- Release DiffEqBase 7.20.1 (#4474)
- Release OrdinaryDiffEqCore 4.16.1 (#4475)
- Release OrdinaryDiffEqNonlinearSolve 2.9.5 (#4476)



Agent-Harness: Claude Code
Agent-Model: claude-opus-5[1m]
Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.

2 participants