Repository navigation
Preserve despecialized parameters during reinit - #1199
Merged
ChrisRackauckas merged 1 commit intoAug 28, 2026
Merged
ChrisRackauckas merged 1 commit into
ChrisRackauckas merged 1 commit into
Conversation
Co-Authored-By: Chris Rackauckas <[email protected]>
ChrisRackauckas
marked this pull request as ready for review
August 28, 2026 09:06
This was referenced Sep 4, 2026
ChrisRackauckas
added a commit
that referenced
this pull request
Sep 7, 2026
- Drop stale [compat] majors older than one year (#1198) - Drop @fastmath from L2_NORM/Linf_NORM so isfinite guards survive (#1182) - Release 4.28.1 (#1202) - Release 2.48.1 (#1206) - Align QA NLsolve compat with root project (#1205) - Widen NonlinearSolveBase LogExpFunctions compat to 0.3.28–1 (#1203) - Continue polyalgorithm after stalled least-squares solves (#1204) - Align Wrappers NLsolve compat with root project (#1208) - Release 2.48.2 (#1210) - Preserve despecialized parameters during reinit (#1199) Agent-Harness: Claude Code Agent-Model: claude-opus-5[1m] Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
ChrisRackauckas
added a commit
that referenced
this pull request
Sep 7, 2026
- Drop stale [compat] majors older than one year (#1198) - Drop @fastmath from L2_NORM/Linf_NORM so isfinite guards survive (#1182) - Release 4.28.1 (#1202) - Release 2.48.1 (#1206) - Align QA NLsolve compat with root project (#1205) - Widen NonlinearSolveBase LogExpFunctions compat to 0.3.28–1 (#1203) - Continue polyalgorithm after stalled least-squares solves (#1204) - Align Wrappers NLsolve compat with root project (#1208) - Release 2.48.2 (#1210) - Preserve despecialized parameters during reinit (#1199) Agent-Harness: Claude Code Agent-Model: claude-opus-5[1m] Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.
Ignore this PR until it has been reviewed by @ChrisRackauckas.
What changed and why
Preserve
AutoDespecialize's parameter wrapper whenreinit!replaces a cache's parameters with a different concrete type. The public cache boundary now normalizes replacement parameters against the wrapper stored by the problem before updating nested Jacobian and linear caches. The same rule covers initialized solver caches, polyalgorithm caches, andNonlinearSolveNoInitCachewithout requiring callers such as OrdinaryDiffEq or ModelingToolkit to know NonlinearSolve's cache representation.The regression reinitializes Newton, no-init, and default polyalgorithm caches with a new parameter type, verifies that the wrapper contains the current payload, and solves the updated problem. This is the generic replacement for the caller-side workaround in SciML/OrdinaryDiffEq.jl#4325.
Failing before
With the new regression test but without the source fix, the initialized cache fails before the solve:
The no-init path independently fails on the unfixed source while assigning the remade problem:
Passing after
I also removed OrdinaryDiffEq's local wrapping expression in a disposable current-master checkout, path-developed this branch's NonlinearSolve and NonlinearSolveBase, and ran the ModelingToolkit Robertson
FBDF+NonlinearSolveAlgreproducer:Not verified
GPU, prerelease Julia, docs, and the full
Everythinggroup were not run locally. No public name, docstring, or documentation was changed.