Skip to content

Restore dense pinv fallback for inverse Jacobian init - #1058

Closed
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix/broyden-linsolve-identity-regression
Closed

Restore dense pinv fallback for inverse Jacobian init#1058
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix/broyden-linsolve-identity-regression

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Ignore until reviewed by @ChrisRackauckas.

Summary

  • restore dense StridedMatrix inverse-Jacobian initialization to the previous LU/inverse path with pinv fallback for singular inputs
  • keep the LinearSolve workspace path for sparse and structured matrix inputs
  • update linsolve_identity!! tests to pin dense singular pinv behavior while preserving sparse/structured workspace coverage

Root cause

#1039 moved the dense quasi-Newton inverse initialization path from the old maybe_pinv!! semantics to linsolve_identity!! through LinearSolve. For rank-deficient reset Jacobians, that pivoted-QR generalized inverse can differ from the SVD pinv result enough to destabilize Broyden with true-Jacobian bad updates. The reproduced symptom was Generalized Rosenbrock function | alg #4 returning residual norm 4.3999999999999995 instead of satisfying <= 1e-3, plus Brown almost linear function | alg #4 becoming an unexpected pass.

Validation

  • env JULIA_DEPOT_PATH=/home/crackauc/sandbox/tmp_20260708_121627_10236/nls_broyden_bisect_depot JULIA_NUM_THREADS=1 JULIA_PKG_PRECOMPILE_AUTO=no JULIA_PKG_SERVER_REGISTRY_PREFERENCE=eager timeout 3600 julia +1 --startup-file=no --project=lib/NonlinearSolveBase -e 'import Pkg; Pkg.test()'\n - linsolve_identity!! workspace (#1020) | 56 Pass\n - Linear solver routing | 12 Pass\n - Dense LU refactorization allocations | 14 Pass\n - Testing NonlinearSolveBase tests passed\n- env JULIA_DEPOT_PATH=/home/crackauc/sandbox/tmp_20260708_121627_10236/nls_broyden_bisect_depot JULIA_NUM_THREADS=1 JULIA_PKG_PRECOMPILE_AUTO=no JULIA_PKG_SERVER_REGISTRY_PREFERENCE=eager timeout 3600 julia +1 --startup-file=no --project=/home/crackauc/sandbox/tmp_20260708_121627_10236/nls_broyden_bisect_env -e 'using Test; include("test/Core/23_test_problems_tests__item7.jl")'\n - completed with exit code 0; Generalized Rosenbrock function | alg #4 passed and Brown almost linear function | alg #4 was broken, not an unexpected pass\n- env NONLINEARSOLVE_TEST_GROUP=Core ... timeout 3600 julia +1 --startup-file=no --project=. -e 'import Pkg; Pkg.test()'\n - Broyden section passed: 23 Test Problems: Broyden | 95 Pass, 20 Broken, 115 Total\n - full Core then failed later in test/Core/homotopy_alloc_tests__item1.jl on allocation thresholds; I reproduced that same homotopy allocation failure on untouched origin/master, so it is separate from this patch\n- Runic check passed on the touched files\n- git diff --check passed

@ChrisRackauckas-Claude

ChrisRackauckas-Claude commented Jul 13, 2026

Copy link
Copy Markdown
Member Author

CI triage update:

  • tests / Core (julia 1, ubuntu-latest) reached and passed Broyden: 23 Test Problems: Broyden | 95 Pass, 20 Broken, 115 Total. It failed later at test/Core/homotopy_alloc_tests__item1.jl with allocation thresholds 154.4 < 48 and 80.0 < 48. I separately reproduced the same homotopy allocation test class on clean origin/master at b491a4e8; the direct clean-master include hit sweep_per_step(prob_big) == 154.4 before stopping.
  • tests / Core (julia lts, ubuntu-latest) passed.
  • sublibraries / lib/NonlinearSolveBase / Julia lts/1/pre / Tests - Core all passed.
  • sublibraries / lib/NonlinearSolveQuasiNewton / Julia 1 / Tests - Core and QA both passed.
  • sublibraries / lib/NonlinearSolveBase [QA] failed, but the same QA failure reproduces on clean master: JacobianCache ambiguity and SingleCacheStorage public-access complaint.
  • Several jobs failed before checkout while resolving Actions downloads (Service Unavailable, Bad Gateway, or Internal Server Error resolving actions/checkout / julia-actions); those are infrastructure failures, not code/test failures from this PR.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas-Claude
ChrisRackauckas-Claude force-pushed the fix/broyden-linsolve-identity-regression branch from a185a30 to ac8b3d5 Compare July 13, 2026 20:23

Copy link
Copy Markdown
Member Author

Rebased onto current master at 41681c5e4 after #1060 merged and reran validation on the final tree before updating the remote branch.

Final-tree validation on Julia 1.12:

  • NonlinearSolveBase tests passed: workspace 56/56, routing 12/12, operator dispatch 1/1, dense-LU allocation coverage 14/14.
  • Exact root Broyden file passed with local path assertions: 95 Pass, 20 Broken, 115 Total; the expected broken cases remained broken, with no unexpected pass.
  • Whole-repository Runic check passed.
  • git diff --check upstream/master...HEAD passed.

The rebased head is ac8b3d5a361d58b7eb5f02b5ff2897526ba13461; CI has restarted on that commit.

Copy link
Copy Markdown
Member Author

The two early red downgrade jobs on rebased head ac8b3d5a3 are the same shared-action resolver failure already classified on #1063, not Broyden test failures:

  • Root downgrade fixes in-tree NonlinearSolveQuasiNewton 1.14.1, which requires SciMLOperators >= 1.24, but the generated downgrade manifest explicitly pins SciMLOperators = 1.22.0.
  • SimpleNonlinearSolve downgrade fixes in-tree NonlinearSolveBase 2.34.3, which also requires >= 1.24, against the same explicit 1.22.0 pin.

Both jobs stop at Unsatisfiable requirements before any test starts. The shared path-source handling is addressed by stacked julia-downgrade-compat drafts #54 and #55. Remaining checks are still running.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Additional rebased-head CI classification from the exact logs:

Neither failure enters this PR's dense pseudoinverse/Broyden regression. No public-API exception or allocation threshold is changed here; the post-rebase Base suite and exact Broyden target were run locally on the current graph as recorded above.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Additional CI follow-up: I inspected the newly completed macOS current and prerelease Core logs. Both pass through the Broyden robustness section and then fail only the two clean-master homotopy allocation assertions addressed by #1061. The target NonlinearSolveBase dense/pseudoinverse regressions remain green. The sole outstanding check is the queued SimpleNonlinearSolve CUDA lane.

Copy link
Copy Markdown
Member Author

Closing this in favor of #1069.

The dense pinv fallback restoration was too broad: it changes inverse-Jacobian initialization semantics globally to satisfy one numerically fragile bad-Broyden robustness expectation. Bad Broyden with true-Jacobian resets can reasonably fail on the generalized Rosenbrock start, and Brown almost-linear now reaches the residual tolerance. #1069 updates that narrow test contract instead.

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