Skip to content

Stabilize Broyden inverse-Jacobian initialization - #1185

Closed
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:agent/stabilize-broyden-lu
Closed

ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:agent/stabilize-broyden-lu

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

What changed and why

Use LinearSolve.LUFactorization() explicitly when inverse-Jacobian initialization solves A * X = I for strided BLAS matrices. The LinearSolve 5.7 GenericLU kernel changed the floating-point trajectory of true-Jacobian Broyden and made the Wood problem fail deterministically on macOS aarch64; selecting the public LAPACK-backed LU algorithm restores a stable solver choice instead of inheriting changes in LinearSolve's default heuristic.

If LU reports a singular factorization, the LinearSolve extension explicitly performs the existing pivoted-QR least-squares rescue, preserving finite generalized-inverse behavior. NonlinearSolveBase is bumped from 2.46.0 to 2.46.1.

Ignore this PR until reviewed by @ChrisRackauckas.

Tracking issue: #1158

Failing before

The new assertion is part of the existing NonlinearSolveBase Core workspace test. On unfixed current master with LinearSolve 5.12.0, the default GenericLU result differs from explicit LU for the Wood Jacobian:

BLAS matrices use explicit LU factorization: Test Failed
Expression: X == X_lu
Evaluated: [GenericLU inverse] == [LUFactorization inverse]

linsolve_identity!! workspace (#1020) | 52 pass, 1 fail, 53 total
Testing NonlinearSolveBase tests failed

The maximum entrywise difference is approximately 1.7e-18, which is enough to change the long Broyden trajectory. The dependency boundary is LinearSolve 5.6.0 → 5.7.0, specifically SciML/LinearSolve.jl@6bbb233.

Passing after

The identical test passes with the explicit selection:

linsolve_identity!! workspace (#1020) | 53 pass, 53 total
Testing NonlinearSolveBase tests passed

A focused Linux run of the public Wood problem with the patch returns:

retcode = Success
evaluations = 1012
residual_inf = 2.5757174171303632e-14

The singular-matrix path remains finite and satisfies the generalized-inverse identity:

all(isfinite, X) = true
norm(A * X * A - A) = 4.7e-16

Local verification

NonlinearSolveBase GROUP=Core
  linsolve workspace 53/53; routing 12/12; allocations 14/14
  Testing NonlinearSolveBase tests passed

NonlinearSolveBase GROUP=QA
  QA 20/20

NonlinearSolve GROUP=Core
  23 Test Problems: Broyden | 94 pass, 21 existing broken, 115 total
  Testing NonlinearSolve tests passed

NonlinearSolve GROUP=QA
  QA 28/28

Runic over all changed Julia files, typos over the diff, and git diff --check passed.

macOS verification boundary

Linux does not reproduce the failing Wood endpoint: both the GenericLU and explicit-LU trajectories converge there. The three source-triggered macOS aarch64 Core jobs are the decisive validation and currently fail on unfixed/default initialization:

I am not claiming the macOS regression fixed until this PR's corresponding jobs pass.

Not verified locally

macOS aarch64, GPU groups, downstream packages, and the Julia version matrix were not run locally. No docs build was run because this changes no public API, docstring, or documentation.

@ChrisRackauckas

Copy link
Copy Markdown
Member

We should just skip this test with that Broyden since it's not numerically stable.

Copy link
Copy Markdown
Member Author

Agreed. The Linux convergence and macOS failure demonstrate that this Broyden/problem pair is machine-dependent, so changing the inverse-Jacobian solver policy is broader than warranted. I’m closing this source-change proposal and replacing it with the narrow Wood / true-Jacobian Broyden test exclusion.

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