Skip to content

Require all components to stall before resetting Broyden - #1184

Draft
ChrisRackauckas-Claude wants to merge 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:agent/core-broyden-regression
Draft

Require all components to stall before resetting Broyden#1184
ChrisRackauckas-Claude wants to merge 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:agent/core-broyden-regression

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Aug 20, 2026

Copy link
Copy Markdown
Member

Please ignore this PR until it has been reviewed by @ChrisRackauckas.

What changed

NoChangeInStateReset now resets Broyden only when every component of the state step or residual change has stalled. The previous any reduction treated one unchanged component as evidence that the entire iteration had stalled, which could consume every reset and fail an otherwise convergent solve.

The regression test uses only public APIs. The existing Helical problem contract is also tightened by removing problem 5 from the alg-3 broken list, and NonlinearSolveQuasiNewton receives a patch version bump to 1.15.2.

A behavior-neutral blank-line removal in NonlinearSolveBase.jl is included deliberately so that this PR triggers the repository's complete source-dependent CI matrix.

Failing before / passing after

The same new test was run against an unfixed clean worktree and this branch:

julia +1.12 --project=lib/NonlinearSolveQuasiNewton -e 'using Test; include("lib/NonlinearSolveQuasiNewton/test/core_tests__item13.jl")'

Unfixed:

Test Failed at core_tests__item13.jl:9
Expression: SciMLBase.successful_retcode(sol)
retcode = ConvergenceFailure
nresets = 1
maximum residual = 0.040265031294151266

Fixed:

Test Summary:                                      | Pass  Total
No-change reset requires every component to stall |    2      2
retcode = Success
nresets = 0
maximum residual = 5.329070518200751e-15

The existing Helical problem 5 with Broyden alg 3 discriminates the same failure mechanism:

unfixed: ConvergenceFailure, 301 evaluations, 100 resets, residual 3.9563
fixed:   Success,             18 evaluations,   1 reset,  residual 2.2373e-16

Local verification

GROUP=Core julia +1.12 --project=. -e 'using Pkg; Pkg.test()'
23 Test Problems: Broyden | 95 pass, 20 existing broken, 115 total
Testing NonlinearSolve tests passed

From lib/NonlinearSolveQuasiNewton:

GROUP=Core julia +1.12 --project=. -e 'using Pkg; Pkg.test()'
GROUP=QA julia +1.12 --project=. -e 'using Pkg; Pkg.test()'
Broyden | 594/594
Klement | 216/216
LimitedMemoryBroyden | 99/99
No-change reset requires every component to stall | 2/2
Testing NonlinearSolveQuasiNewton tests passed
QA | 20/20

From the repository root:

GROUP=QA julia +1.12 --project=. -e 'using Pkg; Pkg.test()'
julia +1.12 --project=@runic -e 'using Runic; exit(Runic.main(["--check", "."]))'
typos <changed files>
git diff --check
QA | 28/28
Runic: exit 0
typos: exit 0
git diff --check: exit 0

Not verified locally

The original Wood failure occurs on macOS after LinearSolve 5.6.0 → 5.7.0. On Linux, Wood succeeds both before and after this patch with zero resets, so local testing does not prove that this fix repairs that architecture-specific trajectory. The deliberate NonlinearSolveBase source touch is present so macOS and the complete downstream matrix can decide that directly.

No GPU tests were run locally. This PR does not change public API or documentation.

Links

ChrisRackauckas-Claude commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

The source-triggered macOS Core lanes have now provided the missing platform result: this reset-condition fix does not fix the separate Wood regression. It fails identically on Julia 1, LTS, and prerelease.

23 Test Problems: Broyden | 94 pass | 1 fail | 20 broken
4: Wood function | alg #2: failed

That confirms the PR's local caveat: the one-component false-reset bug is real and fixes Helical, but Wood has an independent LinearSolve-selection regression. I am keeping that correction in a separate focused branch/PR.

CI jobs:

Copy link
Copy Markdown
Member Author

The source-triggered macOS Core matrix confirms that this reset-condition fix is separate from the Wood regression: all three macOS versions still fail Wood alg #2 with the exact clean-master residual. The inverse-Jacobian initialization fix is isolated in draft #1185 so the two behavior changes remain independently reviewable and bisectable.

Copy link
Copy Markdown
Member Author

The full source-triggered IntegrationTest matrix has completed. Five downstream groups pass; the three failures are already independently bisected and mapped:

Run: https://github.com/SciML/NonlinearSolve.jl/actions/runs/32368371688. No failure in this integration workflow is caused by the reset-condition diff.

Copy link
Copy Markdown
Member Author

Follow-up correction: maintainer review rejected changing the inverse-Jacobian solver policy for the separate Wood failure. The broader #1185 is closed; the focused machine-dependent test exclusion is now #1186.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas-Claude
ChrisRackauckas-Claude force-pushed the agent/core-broyden-regression branch from 7054b89 to c4278a6 Compare August 20, 2026 16:22

Copy link
Copy Markdown
Member Author

Rebased onto current master after #1186 merged.

The exact rebased tree was revalidated locally:

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

GROUP=Core (lib/NonlinearSolveQuasiNewton)
Broyden | 594/594
Klement | 216/216
LimitedMemoryBroyden | 99/99
No-change reset requires every component to stall | 2/2
Testing NonlinearSolveQuasiNewton tests passed

Runic, typos, and git diff --check also pass on the rebased diff. The upstream Wood skip is preserved as skip_tests[alg_ops[2]] = [4, 8]; this PR still tightens the independent Helical problem 5 regression for algorithm 3.

Copy link
Copy Markdown
Member Author

CI follow-up after rebasing onto current master and adding the deliberate NonlinearSolveBase.jl source touch:

At this snapshot, only FirstOrder downgrade/Core and the CUDA lanes remain pending; all other NonlinearSolve-owned checks have completed successfully.

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