Skip to content

Fix Rosenbrock interpolation after callback truncation - #4411

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix-rosenbrock-truncated-dae-interpolation
Aug 28, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix-rosenbrock-truncated-dae-interpolation

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Ignore until reviewed by @ChrisRackauckas.

What changed and why

Callback truncation asks addsteps! to reconstruct Rosenbrock interpolation stages for the shortened final step. The out-of-place path evaluated the first stage at a scratch state instead of uprev, while the mutable mass-matrix path seeded its stage accumulator with du and therefore added an extra M * du. This changes those two expressions and adds a fixed-step callback regression covering Rodas4, Rodas4P, and Rodas5P for in-place/out-of-place mass-matrix DAEs and an out-of-place ODE.

Verification

Failing before the fix

TMPDIR="$HOME/tmp" julia +1.10 --project=lib/OrdinaryDiffEqRosenbrock lib/OrdinaryDiffEqRosenbrock/test/callback_truncated_interpolation.jl

Test Summary:                    | Pass  Fail  Total
Callback-truncated interpolation |   15     6     21
  Mass-matrix DAE                |   15     3     18
  Out-of-place ODE               |          3      3

The DAE midpoint should be 0.65; the unfixed Rodas4/Rodas4P/Rodas5P results were 0.37279301599954645, 0.18292522392043037, and 0.7915660962809313. The out-of-place ODE midpoint errors were also reproduced for all three algorithms.

Passing with the fix

TMPDIR="$HOME/tmp" julia +1.10 --project=lib/OrdinaryDiffEqRosenbrock lib/OrdinaryDiffEqRosenbrock/test/callback_truncated_interpolation.jl

Test Summary:                    | Pass  Total   Time
Callback-truncated interpolation |   21     21  34.3s
TMPDIR="$HOME/tmp" GROUP=Core julia +1.10 --project=lib/OrdinaryDiffEqRosenbrock -e "using Pkg; Pkg.test()"

DAE Rosenbrock AD Tests          |  16/16 passed
Callback-truncated interpolation |  21/21 passed
Rosenbrock AD Tests              |  64/64 passed
Rosenbrock Convergence Tests     | 195/195 passed
Testing OrdinaryDiffEqRosenbrock tests passed
TMPDIR="$HOME/tmp" GROUP=QA julia +1.10 --project=lib/OrdinaryDiffEqRosenbrock -e "using Pkg; Pkg.test()"

Inference Tests | 40/40 passed
JET Tests       |  1/1 passed
Aqua            | 19/19 passed
Testing OrdinaryDiffEqRosenbrock tests passed

Runic (--check --diff), typos, and git diff --check also passed.

Original LyoPronto reproducer

Using LyoPronto commit b907e35dbefbc010a2f742dddadc0f480a7a529f, 1,001 dense-output samples over the final callback-truncated step had zero overshoot and zero increasing intervals for Rodas4, Rodas4P, and Rodas5P.

Not verified

GPU and downstream-package test groups were not run. No documentation build was run because the change does not touch documentation or public API.

🤖 Generated with Codex API (model: unknown; session: unknown).

Rebuild combined Rosenbrock stages from the actual previous state and avoid adding the derivative twice in mass-matrix stage accumulation. Add callback-truncation regressions for mass-matrix DAEs and out-of-place ODEs.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Agent-Harness: Codex API (version unknown)
Agent-Model: unknown
Agent-Session: unknown
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review August 28, 2026 05:16
@ChrisRackauckas
ChrisRackauckas merged commit 272d040 into SciML:master Aug 28, 2026
136 of 140 checks passed
ChrisRackauckas added a commit that referenced this pull request Sep 11, 2026
- Fix definite assignment in ROCK stages (#4321)
- Correct NonlinearSolve downgrade dependency floors (#4394)
- Fix ensemble work-precision error storage (#4390)
- Add explicit benchmark tag semantics (#4402)
- fix: require cache-aware nonlinear solver in PDIRK (#4406)
- fix: accept SciML caches in nlsolve! (#4407)
- Support generic callback event storage (#4398)
- test: account for Hairer4 BLAS variation (#4410)
- Fix Rosenbrock interpolation after callback truncation (#4411)
- Fix weak Platen methods for scalar Wiener processes (#4413)



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