Repository navigation
Resolve symbolic idxs in the ODE and DDE integrator interpolants - #4469
Merged
ChrisRackauckas merged 4 commits intoSep 7, 2026
Merged
ChrisRackauckas merged 4 commits into
ChrisRackauckas merged 4 commits into
Conversation
This was referenced Sep 6, 2026
Member
Author
|
CI is red across every job here for a single reason, and it is the expected one for a stacked PR rather than a defect in the change. From the Documentation job log: This PR calls The unblocking order is SciML/SciMLBase.jl#1581 merged and registered as 3.52.0, then this. I will re-run CI here once that tag exists. Locally, with SciMLBase 🤖 Generated with Claude Code |
`integrator(t; idxs = sym)` passed `idxs` straight to the dense-output interpolant, which only accepts integer component indices, so any symbolic index threw `ArgumentError: invalid index` and an observed equation could never be retrieved. `sol(t; idxs = sym)` has resolved both for a long time. Symbolic `idxs` now route to `SciMLBase.symbolic_interpolation`, which evaluates the current step's interpolant and applies the symbolic getter to it. Integer, `nothing`, and in-place calls are unchanged. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_019wKpyZHy9u4QhR4ePiVmam
`DDEIntegrator` has the same gap `ODEIntegrator` did: `integrator(t; idxs = sym)` went straight to the dense-output interpolant, which only accepts integer component indices, so symbolic indexes threw and observed equations were unreachable. The predicate moves to the public `SciMLBase.has_symbolic_idxs` rather than staying an OrdinaryDiffEqCore internal, since DelayDiffEq, Sundials and ODEInterfaceDiffEq all need the same decision. `HistoryODEIntegrator` is deliberately left alone: it implements none of the `SymbolicIndexingInterface` methods a `DEIntegrator` needs, so symbolic indexing against it is unsupported before and after this change. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_019wKpyZHy9u4QhR4ePiVmam
ChrisRackauckas-Claude
force-pushed
the
integrator-symbolic-interpolation
branch
from
September 7, 2026 01:31
3e2675d to
b50002a
Compare
`has_symbolic_idxs` did not make it into the 3.52.0 release, so the floor moves to the version that carries it. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_019wKpyZHy9u4QhR4ePiVmam
ChrisRackauckas
marked this pull request as ready for review
September 7, 2026 09:02
ChrisRackauckas
added a commit
that referenced
this pull request
Sep 17, 2026
Ships the callback despecialization (#4376, using the existing Base.isempty(::CallbackSet)) and symbolic-index resolution in the ODE/DDE integrator interpolants (#4469). Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude <[email protected]> Agent-Harness: Claude Code 2.1.273 Agent-Model: claude-opus-5[1m] Agent-Session: 6a01e420-3436-4518-83cc-6cd853283cfb (local transcript; this harness publishes no conversation URL)
ChrisRackauckas
added a commit
that referenced
this pull request
Sep 17, 2026
Ships the callback despecialization (#4376, using the existing Base.isempty(::CallbackSet)) and symbolic-index resolution in the ODE/DDE integrator interpolants (#4469). Agent-Harness: Claude Code 2.1.273 Agent-Model: claude-opus-5[1m] Agent-Session: 6a01e420-3436-4518-83cc-6cd853283cfb (local transcript; this harness publishes no conversation URL) Co-authored-by: Claude <[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.
What changed and why
integrator(t; idxs = sym)only accepted integer component indices, so it threwArgumentError: invalid indexfor any symbolic index and could never resolve an observedequation.
sol(t; idxs = sym)has resolved both for a long time; this closes that gap inthe integrator interface, which came up in
SciML/ModelingToolkit.jl#5006.
(integrator::ODEIntegrator)(t; idxs)and(integrator::DDEIntegrator)(t; idxs)now routesymbolic
idxstoSciMLBase.symbolic_interpolation, which evaluates the current step'sinterpolant and applies the symbolic getter to it. Integer,
nothing, and in-place callsare untouched and still go straight to
current_interpolant.StochasticDiffEqneeds no change of its own —SDEIntegratoris an alias forODEIntegrator{<:SDEAlgTypes}, so it is covered by theODEIntegratormethod here.HistoryODEIntegratoris deliberately not routed. It implements none of theSymbolicIndexingInterfacemethods aDEIntegratorneeds — it has nopfield, soparameter_valuesthrows — which means symbolic indexing against it is unsupported bothbefore and after this PR. Making that work is a feature addition, not part of closing this
gap, so there is a comment in the test file saying so rather than a silent omission.
Depends on
SciMLBase.symbolic_interpolationandSciMLBase.has_symbolic_idxs, both addedin SciML/SciMLBase.jl#1581 and
SciML/SciMLBase.jl#1585. The predicate lives in SciMLBase rather
than here because Sundials and ODEInterfaceDiffEq need the same decision and should not
reach into an OrdinaryDiffEqCore internal to get it.
symbolic_interpolationshipped inSciMLBase 3.52.0, but
has_symbolic_idxsdid not make that merge, so the compat floor inOrdinaryDiffEqCore and DelayDiffEq is
3.53and CI fails withUndefVarError: has_symbolic_idxs not defineduntil #1585 is registered.Verification
New test files
test/Integrators_I/symbolic_interpolation_tests.jlandlib/DelayDiffEq/test/interface/symbolic_interpolation.jl. Both use aSymbolCache, whoseExprindexes are observed quantities, so they cover the observed path without addingModelingToolkit to either test target.
Before (this branch's test file against unmodified
lib/):After, and the same file for DelayDiffEq, both run against SciMLBase #1581:
End to end against the ModelingToolkit system from the issue, with
w ~ x + y + zobserved — before, on OrdinaryDiffEq master:
after:
Also run locally:
GROUP=Integrators_I(output below), Runic andtyposon every filetouched.
(The single
brokenin Error Check Tests is a pre-existing@test_brokenon master, notintroduced here.
SciMLBasewasPkg.developed to the branch above for this run, sincethe compat bound below requires a version that is not yet registered.)
Things a reviewer should push back on
integer index evaluates the interpolant for that component alone. The two agree to
rounding, not bitwise, so the tests compare those two paths with
≈. There is a commentin the test saying so.
has_symbolic_idxstreatsSymbolandExpras symbolic, since that is whatSymbolicIndexingInterface.symbolic_typereports.integrator(t; idxs = :x)previouslythrew and now resolves through the symbol cache. That is the intended widening, but it
is a behavior change for anyone who was relying on the error.
integrator(val, t; idxs)is deliberately left alone: writing asymbolic projection into a caller-supplied buffer has no obvious shape contract. It
still errors for symbolic
idxs.Not verified
Other test groups, the GPU group, and downstream packages. This touches only the
idxs-dispatch of the integrator call, so the blast radius is the interpolation path thatGROUP=Integrators_IandGROUP=InterfaceIcover; CI runs the rest.This PR should be ignored until reviewed by @ChrisRackauckas.
🤖 Generated with Claude Code
https://claude.ai/code/session_019wKpyZHy9u4QhR4ePiVmam