Repository navigation
Resolve symbolic idxs in the integrator interpolants - #565
Merged
ChrisRackauckas merged 2 commits intoSep 7, 2026
Merged
ChrisRackauckas merged 2 commits into
ChrisRackauckas merged 2 commits into
Conversation
`integrator(t; idxs = sym)` passed `idxs` straight to `out[idxs]`, 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` in the out-of-place `CVODEIntegrator`, `ARKODEIntegrator` and `IDAIntegrator` call operators. 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
This was referenced Sep 7, 2026
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
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)passedidxsstraight through toout[idxs], so any symbolicindex threw
ArgumentError: invalid indexand an observed equation could never beretrieved from an integrator.
sol(t; idxs = sym)has resolved both for a long time; thiscloses the same gap that SciML/OrdinaryDiffEq.jl#4469 closes for
ODEIntegratorandDDEIntegrator. It came up inSciML/ModelingToolkit.jl#5006.
The four out-of-place call operators —
CVODEIntegrator,ARKODEIntegrator(ARKStep andERKStep) and
IDAIntegrator— now checkSciMLBase.has_symbolic_idxsand route toSciMLBase.symbolic_interpolation, which evaluates the interpolant and applies the symbolicgetter to it. Integer
idxs,nothing, and the in-placeintegrator(out, t; idxs)methodsare untouched.
Depends on
SciMLBase.symbolic_interpolationandSciMLBase.has_symbolic_idxs, added inSciML/SciMLBase.jl#1585.
symbolic_interpolationshipped inSciMLBase 3.52.0, but
has_symbolic_idxsdid not make that merge, so the compat floor hereis
3.53and CI fails withUndefVarError: has_symbolic_idxs not defineduntil #1585 isregistered.
Verification
New test file
test/common_interface/symbolic_interpolation.jl, run acrossCVODE_Adams,CVODE_BDF,ARKODEandIDA. It uses aSymbolCache, whoseExprindexes are observedquantities, so it covers the observed path without adding ModelingToolkit to the test target.
Before, with only the test applied and
src/reverted:After:
Both runs used SciMLBase
Pkg.developed to the branch in #1581, since the compat boundabove requires a version that is not yet registered (#1585). Runic
--checkandtyposare cleanon every file touched.
Things a reviewer should push back on
index reads that component out of the raw output. The two agree to rounding rather than
bitwise, so the tests compare those paths with
≈; there is a comment in the test sayingso.
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 relying on the error.
integrator(out, t; idxs)methods are deliberately left alone: writing asymbolic projection into a caller-supplied buffer has no obvious shape contract.
Not verified
The rest of the Sundials test suite, and Julia LTS. This touches only the
idxsdispatch ofthe four out-of-place call operators; CI covers the rest once #1585 is registered.
This PR should be ignored until reviewed by @ChrisRackauckas.
🤖 Generated with Claude Code
https://claude.ai/code/session_019wKpyZHy9u4QhR4ePiVmam