Repository navigation
NonlinearSolveAlg: extend W-reuse to WOperator with concrete underlying Jacobian - #3753
Merged
ChrisRackauckas merged 1 commit intoJun 29, 2026
Merged
Conversation
singhharsh1708
force-pushed
the
feat/wreuse-operator
branch
from
June 13, 2026 21:01
389657e to
a1568f2
Compare
Member
Author
|
@ChrisRackauckas Diff is +11/−4 in one file; default (concrete) linsolve path is byte-identical, matrix-free WOperators correctly fall through to AD/FD. Local runic clean — the red format/downgrade checks here are master-side failures. Pairs with #3696 (architectural ask covered by MTK#4609 + #3703, both merged). |
…ng J Hand the WOperator's _concrete_form to NonlinearSolve as analytic jac (Closes SciML#3697 for the concrete-J case; matrix-free WOperators still fall back).
singhharsh1708
force-pushed
the
feat/wreuse-operator
branch
from
June 29, 2026 07:37
a1568f2 to
b27411d
Compare
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3697 for the common case.
Summary
`build_nlsolver` previously gated `use_w_reuse` on
```julia
W isa AbstractMatrix && !(W isa AbstractSciMLOperator)
```
which excluded `WOperator` entirely. But a `WOperator` built around a concrete Jacobian (the typical setup when the user picks an iterative linsolve such as `KrylovJL_GMRES` with `concrete_jac = true`) carries the materialized `M/γdt - J` in its `_concrete_form` field, and `_update_nlsolvealg_W!` already writes the refreshed W there via `jacobian2W!`. We can hand that buffer to NonlinearSolve as the analytic Jacobian unchanged.
Truly matrix-free `WOperator`s (where `W.J` is itself an `AbstractSciMLOperator`) still fall back to AD/FD on the inner Newton — handing those off as analytic Jacobians is a deeper change tracked separately.
Measured
Robertson, `linsolve = KrylovJL_GMRES(), concrete_jac = true`, `nlsolve = NonlinearSolveAlg(NewtonRaphson(autodiff = AutoFiniteDiff()))`:
Audit