Repository navigation
Allow Newton refresh retries in MethodOfSteps - #4396
Merged
ChrisRackauckas merged 2 commits intoSep 7, 2026
Merged
ChrisRackauckas merged 2 commits into
ChrisRackauckas merged 2 commits into
Conversation
`repeat_step=true` on DelayDiffEq fixed-point recomputes made do_newJW skip J/W even though the history (hence f) had changed, so SDIRK Newton spun in LinearSolve QR (SciML#4389). Recompute with a fresh W. Bind implicit-first stage 1 to uprev only for the Newton solve, then restore the owned scratch so get_tmp_cache cannot write uprev after a failed first stage. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Grok 4.6 <[email protected]> Agent-Harness: Grok Build TUI Agent-Model: grok-4.6 Agent-Session: 01a052a0-1183-7d23-bfe2-539976f69d01 (local Grok Build TUI session)
ChrisRackauckas-Claude
force-pushed
the
fix/sdirk2-methodofsteps-current-regression
branch
from
August 30, 2026 14:31
8d439f1 to
4a969e3
Compare
Keep SDIRK scratch ownership unchanged and use the existing Newton retry logic for fixed-point recomputations. Cover failed first-stage retries and both Robertson RHS forms through t=1 with three controller settings. Merge current upstream master to validate the final patch against its base. 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: 01a07107-0ed2-7aa1-bfd7-561836cc87fd (local session; transcript: /home/crackauc/.codex/sessions/2026/09/05/rollout-2026-09-05T06-04-43-01a07107-0ed2-7aa1-bfd7-561836cc87fd.jsonl)
ChrisRackauckas
marked this pull request as ready for review
September 7, 2026 06:22
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
MethodOfSteps fixed-point recomputations could retry Newton indefinitely: Newton requested a fresh Jacobian after divergence, but
repeat_step=truesuppressed that refresh on every retry. Both in-place and out-of-place recomputations now passfalse, allowing the existing Newton refresh-and-retry logic to run. This addresses the Robertson failure investigated in #4389.The final implementation changes only two call arguments and their explanatory comments. DelayDiffEq advances from 6.3.0 to 6.3.1. The tests enforce the existing owned-scratch invariant after a deliberately failed first stage and a subsequent retry, and run Robertson to
t=1.0for in-place/out-of-place RHS functions with the default controller and two first-step growth settings. A 100,000-RHS-call guard makes nontermination fail promptly.Ignore this PR until reviewed by @ChrisRackauckas.
Failing before / passing after
Julia 1.11.9, one thread. The identical final regression file was copied into the official test dependency environment, whose local package paths pointed to clean base 666e7fc. The after run changed only the two
perform_step!arguments in that checkout. SDIRK's scratch-copy implementation and cache dispatch were unchanged.Before (exit 1):
After (exit 0, 42/42):
The original issue's default-controller options were also run separately: the base exceeded 100,000 RHS calls; the two-argument fix returned
Successatt=1.0with 3,450 calls, 477 accepted steps, and 19 rejected steps.Local validation
All commands below ran locally with Julia 1.11.9. Test commands used
TMPDIR="$PWD/../review-tmp",JULIA_DEPOT_PATH="$PWD/../review-tmp/depot:/home/crackauc/.julia", andJULIA_PKG_PRECOMPILE_AUTO=0from the repository root.Each exited 0:
Runic,
typoson all three changed files, andgit diff --checkexited 0:/home/crackauc/.juliaup/bin/julia +1.11 --startup-file=no --project=/home/crackauc/sandbox/runicenv -e 'using Runic; exit(Runic.main(ARGS))' -- --check lib/DelayDiffEq/src/fpsolve/functional.jl lib/DelayDiffEq/test/regression/dde_sdirk_stage1_tmp_aliasing.jl typos lib/DelayDiffEq/Project.toml lib/DelayDiffEq/src/fpsolve/functional.jl lib/DelayDiffEq/test/regression/dde_sdirk_stage1_tmp_aliasing.jl git diff --checkThe full DelayDiffEq Integrators group also exited 0 using the same environment prefix:
GROUP=Integrators /home/crackauc/.juliaup/bin/julia +1.11 --startup-file=no --compiled-modules=no --threads=1 --project=lib/DelayDiffEq -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=no"])'The full OrdinaryDiffEqSDIRK Core group also exited 0 using the same environment prefix:
GROUP=Core /home/crackauc/.juliaup/bin/julia +1.11 --startup-file=no --compiled-modules=no --threads=1 --project=lib/OrdinaryDiffEqSDIRK -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=no"])'The two broken convergence assertions were pre-existing; no tests were disabled or weakened.
A separate Regression attempt with
--compiled-modules=nohit LinearSolve's QR world-age error. It also reproduces in a standalone 2×2 LinearSolve solve, without DelayDiffEq or OrdinaryDiffEq, and is tracked in SciML/LinearSolve.jl#1282 (comment). The successful Regression command uses normal compilation; no assertions or error handling were changed to bypass the failure.CI
The complete DelayDiffEq sublibrary workflow passed on this commit: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/33964185740. Its logs show the updated regression passing 42/42 on Julia LTS, stable, and prerelease, and QA passing 20/20. All configured Integrators, Interface, Regression, and SDDE jobs passed. The main repository CI workflow, including GPU, also passed: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/33964185826. The downstream workflow also passed: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/33964185677, as did all sublibrary downgrade checks: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/33964185765. Final PR check rollup: 138 successful checks, 3 workflow-skipped jobs, no pending or failed validation checks. These results are for 408f31f.
The existing Dependabot Auto-merge workflow fails at startup because the called workflow requests
checks: readandstatuses: read, while the caller grants neither. No jobs run in that workflow: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/33964185706. This workflow is unchanged by this PR.GPU, Julia prerelease, and downstream jobs were not run locally. No dependency, public API, docstring, or rendered documentation changes are included.
Links
MethodOfSteps(SDIRK2())on Robertson DDE allocates indefinitely after first-step qmax change #4389🤖 Generated with Codex CLI 0.153.4 (model: gpt-6-astra; local session: 01a07107-0ed2-7aa1-bfd7-561836cc87fd). Transcript: /home/crackauc/.codex/sessions/2026/09/05/rollout-2026-09-05T06-04-43-01a07107-0ed2-7aa1-bfd7-561836cc87fd.jsonl