Invalidate integrator caches after parameter mutation - #1575
Draft
ChrisRackauckas-Claude wants to merge 1 commit into
Draft
Invalidate integrator caches after parameter mutation#1575ChrisRackauckas-Claude wants to merge 1 commit into
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
Mark DEIntegrator derivatives discontinuous when symbolic parameter assignments finish so solver caches are refreshed before the next step. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: OpenAI Codex <noreply@openai.com> Agent-Harness: Codex CLI 0.151.0 Agent-Model: gpt-5.6-sol Agent-Session: local session ID 01a057e2-edc7-7342-9835-8122a5c647eb
Member
Author
|
Follow-up plan for the workflow in SciML/ModelingToolkit.jl#5006 (comment):
This PR intentionally covers only step 1. |
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
Symbolic parameter assignment through
integrator.ps[...]now marks aDEIntegrator's derivative as discontinuous whenSymbolicIndexingInterfacefinishes the assignment. This makes the nextstep!refresh method caches instead of advancing with derivative data computed from the previous parameter value.This supplies the missing integrator specialization of the existing
SymbolicIndexingInterface.finalize_parameters_hook!extension point. It enables the single-integrator interactive workflow discussed in SciML/ModelingToolkit.jl#5006 (comment) without repeatedly callingreinit!.Regression evidence
With the new regression test present and the production change removed:
With this change applied, rerun after rebasing onto the latest
upstream/master:Verification
The first QA attempt exposed a corrupted shared Pixi package cache: cached Python standard-library files were zero bytes. The same failure reproduced on a clean
masterworktree. Re-running against a fresh workspace-local Pixi cache produced the 123/123 result above; no repository change was needed for that machine-state failure.Review notes and unverified paths
No public API is added; this specializes an existing SII hook for
DEIntegrator.Everything, GPU, Julia pre-release, and unrelated sublibrary/downstream jobs were not run locally.The two failing DownstreamAD CI jobs also fail in the master run at the PR's exact base SHA,
3d95609f7dc1c86a8fded41b9d357bcf25b83ad3: https://github.com/SciML/SciMLBase.jl/actions/runs/33443540855/job/99658026211 and https://github.com/SciML/SciMLBase.jl/actions/runs/33443540855/job/99658026315. The LTS failure is addressed by #1574. The Julia 1.12 Mooncake failure is reduced and tracked separately at #1578.The new source hunk was formatted with Runic. A whole-file Runic check of
src/integrator_interface.jlstill detects an unrelated pre-existing formatting hunk, which this behavior-change PR deliberately does not include.🤖 Generated with Codex CLI 0.151.0 (model: gpt-5.6-sol; session: local session ID 01a057e2-edc7-7342-9835-8122a5c647eb).