Skip to content

Newton-Krylov integrators default to Hegedüs warm start (require LinearSolve 5.1)#3991

Merged
ChrisRackauckas merged 3 commits into
SciML:masterfrom
ChrisRackauckas-Claude:newton-krylov-warm-start-default
Jul 23, 2026
Merged

Newton-Krylov integrators default to Hegedüs warm start (require LinearSolve 5.1)#3991
ChrisRackauckas merged 3 commits into
SciML:masterfrom
ChrisRackauckas-Claude:newton-krylov-warm-start-default

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Jul 23, 2026

Copy link
Copy Markdown
Member

Important

Draft — please ignore until reviewed by @ChrisRackauckas.

Companion to SciML/LinearSolve.jl#1100 (now merged and released as LinearSolve v5.1.0), which added WarmStart + the WarmStart.Auto default to KrylovJL. This makes the integrator-aware default unconditionally live on LinearSolve 5.1.

What

OrdinaryDiffEqDifferentiation.default_krylov_warm_start(linsolve) resolves a Krylov solver left at LinearSolve.WarmStart.Auto (the KrylovJL default) to WarmStart.Hegedus, applied on the Newton nonlinear-solver path (NLNewton/NonlinearSolveAlg). Implicit integrators using KrylovJL_GMRES()/KrylovJL_FGMRES() now reuse the previous solution (Hegedüs-scaled) across the correlated linear solves of a Newton iteration.

  • Rosenbrock / W-methods untouched: they never call the resolver, so their Auto solver stays a cold start (warm starting is unsafe there — no outer Newton iteration absorbs the within-tolerance stage-solve perturbation; benchmarks showed 7–13× slowdowns and step-rejection loops).
  • Explicit choices respected: WarmStart.None/Previous/Hegedus are never overridden — only Auto is resolved.

Requires LinearSolve 5.1 (no guard, no dormancy)

WarmStart is a LinearSolve 5.1 feature. Rather than guard on isdefined(LinearSolve, :WarmStart) and be silently dormant on older LinearSolve, the WarmStart-using libraries now require LinearSolve = "5.1" and the guard is removed, so the default is always live. Every other monorepo sublibrary that declared a LinearSolve compat is moved to "5.1" as well: they all depend transitively on OrdinaryDiffEqNonlinearSolve/Differentiation, so they can never resolve with LinearSolve < 5.1 anyway — keeping a 3/4 lower bound would be dead metadata and would re-break the Downgrade CI (which floors deps to their minimum). Test sub-environments updated to match. This is effectively the OrdinaryDiffEq LinearSolve-5 migration, done here because the require-5.1 floor depends on it.

Minor version bumps for each sublibrary whose compat changed.

Verification (local, LinearSolve 5.1.0)

  • Fresh resolution pins LinearSolve 5.1.0 with the two libraries requiring "5.1" — the registered NonlinearSolveBase/DiffEqBase/etc. chain already allows LinearSolve 5, so nothing caps it at 4.
  • Resolver unit test (test/warm_start_default_tests.jl, Differentiation Core group): 7/7 pass — Auto→Hegedus, explicit values preserved, non-Krylov unchanged, other fields survive remake.
  • FBDF(linsolve = KrylovJL_GMRES()) and Rodas5P(linsolve = KrylovJL_GMRES()) both solve Success; the resolver returns Hegedus for Auto with the guard removed.
  • Earlier engagement check (ILU Brusselator): FBDF fires warm start (433 engagements), Rodas5P does not (0), explicit None on FBDF is cold (0), explicit Hegedus on Rodas5P is honored (1528).

CI validates the full umbrella resolution + all sublibrary test groups on LinearSolve 5.1.

🤖 Generated with Claude Code

Resolves a Krylov linear solver left at the new LinearSolve.WarmStart.Auto
default to WarmStart.Hegedus on the Newton nonlinear-solver path, so implicit
integrators using KrylovJL_GMRES()/KrylovJL_FGMRES() reuse the previous solution
(Hegedus-scaled) across the correlated linear solves of a Newton iteration.
Rosenbrock/W-method integrators never call the resolver, so their Auto solver
stays a cold start -- warm starting is unsafe there (no outer Newton iteration
absorbs the within-tolerance stage-solve perturbation, which can trigger
step-rejection feedback loops). Explicit WarmStart.None/Previous/Hegedus are
always respected.

The resolver is guarded on isdefined(LinearSolve, :WarmStart), so it is a no-op
on LinearSolve < 5.1 and this compiles unchanged there. Bumps the LinearSolve
compat of the two touched sublibraries to allow 5; umbrella-wide activation
additionally requires the OrdinaryDiffEq LinearSolve 5 compat migration across
the remaining sublibraries.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

CI note: the downgrade-sublibraries failures (Differentiation, FIRK) are pre-existing on master — the Downgrade/Downgrade Sublibraries workflows are red across recent master commits (d2577da, 4b3cafd, 754b504), unrelated to this PR. This change keeps the same LinearSolve compat floor (3.75.0), so it doesn't affect downgrade resolution, and both the resolver and its test are guarded on isdefined(LinearSolve, :WarmStart) so they degrade to a no-op on LinearSolve 3.75. The failure is the known julia-downgrade-compat-vs-path-[sources] resolution issue, not a real floor incompatibility. (Triaging the master failure separately.)

The checks that actually exercise this PR — the OrdinaryDiffEqDifferentiation/OrdinaryDiffEqNonlinearSolve sublib test groups and Runic — are the ones to watch.

🤖 Generated with Claude Code

Two stale minimum-version declarations were mutually unsatisfiable, which is
what the Downgrade Sublibraries CI hits:

- LinearSolve floor 3.75.0 was inconsistent with the NonlinearSolveBase 2.34.1
  floor, which itself requires LinearSolve >= 4.3.0. Raised to 4.3.0.
- OrdinaryDiffEqNonlinearSolve declared SciMLOperators >= 1.24.3 while its path
  dependency OrdinaryDiffEqDifferentiation requires >= 1.24.4. Raised to 1.24.4.

Neither drops any actually-installable configuration. The warm-start resolver
remains guarded on isdefined(LinearSolve, :WarmStart), so it still no-ops on
LinearSolve 4.x and activates on 5.1+.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ChrisRackauckas-Claude
ChrisRackauckas-Claude force-pushed the newton-krylov-warm-start-default branch from 579e6de to fe761ce Compare July 23, 2026 13:09
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

CI verdict — the checks that exercise this PR are green:

  • Runic (format + suggestions): pass
  • OrdinaryDiffEqDifferentiation Core tests (Julia 1 / lts / pre): pass — these run the new warm_start_default_tests.jl
  • OrdinaryDiffEqNonlinearSolve Core: pending (same class)

Remaining red checks are all pre-existing on master, not introduced here:

  • QA (Differentiation, NonlinearSolve): the SciMLTesting public API is rendered in docs check flags pre-existing public-but-undocumented internal helpers (wrapprecs, dolinsolve, build_J_W, update_W!, …). Confirmed failing on master (sublibrary run 30005108996). The new default_krylov_warm_start is deliberately not public, so it is not in the flagged list and adds nothing to this debt.
  • downgrade-sublibraries: chronic (never green on master, tracked under Downgrade CI tests have been failing since workflow was added #2972/Re-enable downgrade tests #2977). This PR fixes the two floor conflicts that live in the files it touches (LinearSolve 3.75→4.3, SciMLOperators 1.24.3→1.24.4); any remaining transitive floor conflict is the broader monorepo cleanup.

🤖 Generated with Claude Code

@ChrisRackauckas-Claude ChrisRackauckas-Claude changed the title Default Newton-Krylov integrators to Hegedüs warm starting Newton-Krylov integrators default to Hegedüs warm start (require LinearSolve 5.1) Jul 23, 2026
Makes the Newton-Krylov Hegedus warm-start default unconditionally live instead
of silently dormant:

- OrdinaryDiffEqNonlinearSolve and OrdinaryDiffEqDifferentiation require
  LinearSolve = "5.1" (where WarmStart exists), and default_krylov_warm_start
  drops its isdefined(LinearSolve, :WarmStart) guard.
- Every other monorepo sublibrary that declared a LinearSolve compat is moved to
  "5.1" as well. These all depend (transitively) on NonlinearSolve/Differentiation,
  so they can never resolve with LinearSolve < 5.1 anyway; keeping a 3/4 lower
  bound would be dead metadata and would re-break the Downgrade CI (which floors
  deps to their minimum). Test sub-environments updated to match.
- Minor version bumps for each sublibrary whose compat changed.

Verified: fresh resolution pins LinearSolve 5.1.0; resolver unit test passes
(7/7); FBDF and Rodas5P solve with a default KrylovJL_GMRES(); the resolver maps
Auto -> Hegedus with the guard removed.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ChrisRackauckas-Claude
ChrisRackauckas-Claude force-pushed the newton-krylov-warm-start-default branch from f21783d to e7c538a Compare July 23, 2026 15:19
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review July 23, 2026 15:22
@ChrisRackauckas
ChrisRackauckas merged commit 56ffb52 into SciML:master Jul 23, 2026
19 of 22 checks passed
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