Skip to content

NonlinearSolveAlg: pull nsolve from inner NonlinearSolve stats - #3816

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:nsa-nsolve-stat
Jul 6, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:nsa-nsolve-stat

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Please ignore until reviewed by @ChrisRackauckas. Draft opened by an agent.

The NSA initialize! forwards nf and njacs from the inner NonlinearSolve cache stats to the integrator stats, but drops nsolve — so integrator.stats.nsolve always reads 0 under NonlinearSolveAlg while NLNewton increments it per linear solve. Forward it the same way (the inner stats reset on each per-stage reinit!, so the pull-before-reinit pattern accumulates deltas correctly — same as the existing nf/njacs pulls).

Verified locally: TRBDF2+NSA on ROBER at 1e-8 now reports nsolve = 16674 (≈ nnonliniter = 16912); was 0.

Part of a series closing NonlinearSolveAlg↔NLNewton parity gaps (with the sparse jac_prototype fix and the J/W update split; see also SciML/NonlinearSolve.jl#1003).

🤖 Generated with Claude Code

The NSA initialize! already forwards nf and njacs from the inner
NonlinearSolve cache stats to the integrator stats, but dropped nsolve, so
integrator.stats.nsolve always read 0 under NonlinearSolveAlg while NLNewton
increments it per linear solve. Forward it the same way.

Co-Authored-By: Chris Rackauckas <[email protected]>
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