Skip to content

Add LinearSolve 5 compatibility across NonlinearSolve sublibraries - #1043

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:ls5-compat-sublibs
Jul 11, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:ls5-compat-sublibs

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Summary

LinearSolve 5.0.0 is registered, but every NonlinearSolve.jl monorepo sublibrary (outside NonlinearSolveBase) still caps LinearSolve at 4, so the full stack cannot resolve LinearSolve 5. This PR widens the LinearSolve [compat] ceiling to include 5 in every remaining Project.toml, and bumps each changed package's version accordingly. Lower bounds are preserved — only the ceiling widens.

Packages bumped

Package LinearSolve compat (old → new) version (old → new)
NonlinearSolve (root) 3.48, 4 → 3.48, 4, 5 4.20.4 → 4.21.0
NonlinearSolveFirstOrder 2.36.1, 3, 4 → 2.36.1, 3, 4, 5 2.1.3 → 2.2.0
NonlinearSolveQuasiNewton 2.36.1, 3, 4 → 2.36.1, 3, 4, 5 1.13.3 → 1.14.0
docs env 2, 3, 4 → 2, 3, 4, 5 (no version field)
test/gpu env 3.48, 4 → 3.48, 4, 5 (no version field)

These are the only Project.tomls in the monorepo with a LinearSolve [compat] entry other than NonlinearSolveBase. The other sublibraries (BracketingNonlinearSolve, SimpleNonlinearSolve, NonlinearSolveSpectralMethods, SCCNonlinearSolve, NonlinearSolveHomotopyContinuation, SciMLJacobianOperators, NonlinearSolveSciPy) have no direct LinearSolve compat and reach it transitively through NonlinearSolveBase, so they need no change. The version bumps are minor per SemVer (widened compat range = new feature); no inter-package compat widening is required — all downstream caps on the bumped packages (4.19, 4.8, 4.10, 4, 2, 2.1.2, 1.12, 1) already admit the new versions.

Coordination

The full LinearSolve 5 stack requires all three of:

No code change

No package reads LinearSolution.cache (the 4→5 break, #1083). NonlinearSolve consumes LinearSolve solve results only via linres.retcode and linres.u (in NonlinearSolveBaseLinearSolveExt), which are stable across LinearSolve 3/4/5. grep for .cache in src found only internal struct fields (Broyden low-rank Jacobian, JᵀJ operators), never a read off a solve result. So this is compat + version only.

Local verification

Verified in a scratch temp env with all local monorepo packages dev'd by path, plus #1039's NonlinearSolveBase compat applied locally as a dev patch (4.3, 5), since #1039 isn't merged yet.

Full-stack resolution + precompile on LinearSolve 5.0.0:

26 dependencies successfully precompiled in 101 seconds. 288 already precompiled.
==== RESOLVED. LinearSolve version in manifest: ====
LinearSolve => 5.0.0
==== PRECOMPILE OK ====

Representative solves on LinearSolve 5.0.0 (all Success):

Using LinearSolve v5.0.0
NewtonRaphson : retcode=Success u=[1.4142135623730951, 1.4142135623730951]
TrustRegion   : retcode=Success u=[1.4142135623730951, 1.4142135623730951]
Broyden       : retcode=Success u=[1.4142135623730947, 1.4142135623730947]
Homotopy      : nroots=2 retcodes=[Success, Success] first_u=[-1.414213562373095, -2.121320343559643]
ALL_SUCCESS = true

Still resolves on LinearSolve 4.3.0 (4.x not broken):

==== RESOLVED. LinearSolve version in manifest: ====
LinearSolve => 4.3.0
==== PRECOMPILE OK ====

Note: This PR should be ignored until reviewed by @ChrisRackauckas.

🤖 Generated with Claude Code

Widen the LinearSolve [compat] ceiling to include 5 in every monorepo
Project.toml that still capped it at 4, so the full stack can resolve
LinearSolve 5.0. Lower bounds are preserved (only the ceiling widens).

Compat + version bumps (minor, per SemVer for a widened compat range):
- NonlinearSolve (root):        LinearSolve 3.48, 4 -> 3.48, 4, 5   v4.20.4 -> v4.21.0
- NonlinearSolveFirstOrder:     LinearSolve 2.36.1, 3, 4 -> +5      v2.1.3  -> v2.2.0
- NonlinearSolveQuasiNewton:    LinearSolve 2.36.1, 3, 4 -> +5      v1.13.3 -> v1.14.0
- docs env:                     LinearSolve 2, 3, 4 -> 2, 3, 4, 5
- test/gpu env:                 LinearSolve 3.48, 4 -> 3.48, 4, 5

NonlinearSolveBase is handled by SciML#1039 (LinearSolve 4.3, 5) and is not
touched here. No code changes: no package reads LinearSolution.cache
(the 4->5 break); LinearSolve results are consumed only via retcode/u.

Co-Authored-By: Claude Fable 5 <[email protected]>
Co-Authored-By: Chris Rackauckas <[email protected]>
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review July 11, 2026 23:10
@ChrisRackauckas
ChrisRackauckas merged commit cb7c006 into SciML:master Jul 11, 2026
25 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