Skip to content

Require LinearSolve 5.6 for rank-deficient least-squares fallback - #1261

Merged
ChrisRackauckas merged 3 commits into
SciML:masterfrom
ChrisRackauckas-Claude:fix/firstorder-linearsolve-minimum
Sep 13, 2026
Merged

ChrisRackauckas merged 3 commits into
SciML:masterfrom
ChrisRackauckas-Claude:fix/firstorder-linearsolve-minimum

Conversation

@ChrisRackauckas-Claude

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

Copy link
Copy Markdown
Member

Require LinearSolve 5.6 for FirstOrder's default rank-deficient least-squares solves. With the previous minimum 5.4, an unpivoted QR failure leaves the solution at zero; the first release containing the upstream pivoted-QR fallback is 5.6.0. This adds a two-assertion Newton–Raphson regression and bumps FirstOrder to 2.6.2.

This is a separate compatibility prerequisite for the bounded-method drafts. It preserves shared linear-solver selection and adds no dependency or custom factorization fallback. LinearSolve and NonlinearSolve are MIT licensed.

Verification

The regression solves NonlinearLeastSquaresProblem((u, p) -> [u[1] + u[2] - 0.6, 0.0, 0.0], zeros(2)) with NewtonRaphson() and checks both the return code and residual. Local environments develop the checkout's FirstOrder, Base, and JacobianOperators sublibraries and pin LinearSolve to the version under test.

Before, on the unmodified base runtime with LinearSolve 5.4.0:

julia +1.10 --project=scratch/base-linear-min -e 'using Test; @testset "Rank-deficient overdetermined NLLS" include("linear-compat/lib/NonlinearSolveFirstOrder/test/least_squares_tests__item5.jl")'
Expression: norm(sol.resid) < 1.0e-8
Evaluated: 0.6 < 1.0e-8
Test Summary:                      | Fail  Total  Time
Rank-deficient overdetermined NLLS |    2      2  6.6s

After changing the compatibility requirement and pinning LinearSolve 5.6.0, the same command and assertions pass:

Test Summary:                      | Pass  Total     Time
Rank-deficient overdetermined NLLS |    2      2  2m34.0s

The full FirstOrder Core group also passed with the new minimum (3,334 assertions summed across printed testsets):

GROUP=Core julia +1.10 --project=scratch/base-linear-min -e 'using Pkg; Pkg.test("NonlinearSolveFirstOrder")'
Rank-deficient overdetermined NLLS | 2 2 1.2s
SciMLOperator Jacobians | 14 14 14.7s
Testing NonlinearSolveFirstOrder tests passed

QA on Julia 1.12.7:

GROUP=QA julia +1.12 --compiled-modules=existing --project=lib/NonlinearSolveFirstOrder -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'
QA | 20 20 3m25.6s
GROUP=QA julia +1.12 --compiled-modules=existing --project -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'
QA | 28 28 2m16.9s

Runic, spelling, and git diff --check passed. The bounded-method integration suite also passed 5810/5810 with the CI minimum dependency set and LinearSolve 5.6.0 on Julia 1.10.11 (GROUP=NativeBounds, 8m26.6s). GPU, downstream, and Julia prerelease jobs were not run locally; no assertions were skipped or relaxed.

Baseline investigation

An isolated clean-master reproduction independently failed 2/2 with LinearSolve 5.4 and passed 2/2 with 5.6. Historical adjacent revisions identify the removal of NonlinearSolveBase's fallback: its parent passes 2/2 with LinearSolve 3.15, while the constructor-only repair immediately after the removal fails 2/2 with residual 0.6. The replacement in LinearSolve initially covered LU failures; the later QR fix is already upstream, so no duplicate issue was opened.

Existing CI failure

The Linux LTS Core job fails the existing Watson/true-Jacobian Broyden assertion at residual 3.3209535743826133 > 0.001: https://github.com/SciML/NonlinearSolve.jl/actions/runs/34702554263/job/103576814882 . This is the already reported BLAS-kernel-sensitive failure in #1078 .

I reproduced that exact residual on unchanged master 40f6f613950636e22c25077124a93b914c1df669 with both OPENBLAS_CORETYPE=SANDYBRIDGE and NEHALEM, using Julia 1.10.12 with -C generic --compiled-modules=no --check-bounds=yes. The same Watson case with HASWELL succeeds at 2.3647750424515834e-14. Dependency versions match the failing CI job, including LinearSolve 5.17.2.

The historical boundary was independently verified with LinearSolve 4.3.0 held constant: parent d616cd994 succeeds at 3.108624468950438e-14; 6a7687f fails at the exact CI residual. This predates the compatibility change.

The full root Core group also passes locally on both unchanged master and this branch with the default BLAS kernel:

GROUP=Core julia +1.10.12 --project=scratch/base-broyden-env -e 'using Pkg; Pkg.test("NonlinearSolve")'
GROUP=Core julia +1.10.12 --project=scratch/compat-core-env -e 'using Pkg; Pkg.test("NonlinearSolve")'

Both locally developed environments print 23 Test Problems: Broyden | 93 pass, 22 pre-existing broken, 115 total and Testing NonlinearSolve tests passed. No Broyden code or test expectations are changed here. CI is not fully green; the existing Watson failure remains open. GitHub rejected an attempted master-job rerun with HTTP 403 because the connected account lacks the required permission.

Links

Ignore this draft until reviewed by @ChrisRackauckas.

🤖 Generated with Codex CLI 0.154.0 (model: gpt-6-astra). Session: local transcript /home/crackauc/.codex/sessions/2026/09/12/rollout-2026-09-12T04-30-15-01a094bd-179a-7972-97ec-36badb9448cd.jsonl.

ChrisRackauckas and others added 2 commits September 12, 2026 08:26
Use independent local checkouts and the public AirspeedVelocity API so
Julia LTS can resolve unregistered monorepo sublibrary versions. Publish
comparison tables in the job summary and preserve the result artifacts.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.154.0
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/12/rollout-2026-09-12T04-30-15-01a094bd-179a-7972-97ec-36badb9448cd.jsonl
Add a default Newton regression for a rank-deficient tall Jacobian and
require the first LinearSolve release with the pivoted-QR fallback.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.154.0
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/12/rollout-2026-09-12T04-30-15-01a094bd-179a-7972-97ec-36badb9448cd.jsonl
@ChrisRackauckas
ChrisRackauckas merged commit dd8ae83 into SciML:master Sep 13, 2026
12 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