Skip to content

Make has_symbolic_idxs public for solver packages - #1585

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:public-has-symbolic-idxs
Sep 7, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:public-has-symbolic-idxs

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

What changed and why

#1581 added symbolic_interpolation so solver
packages can resolve symbolic idxs in integrator(t; idxs). Every such package also has
to decide whether idxs is symbolic before routing, since a raw dense-output interpolant
only accepts integer component indices. That predicate is one line of interface policy and
belongs next to symbolic_interpolation rather than being duplicated in five packages or
reached into as a SciMLBase internal.

This adds SciMLBase.has_symbolic_idxs(idxs) as public, documented API. It was meant to be
part of #1581 but did not make it into the merge, and 3.52.0 is already released, so it needs
its own version.

The consumers, all currently red on UndefVarError: has_symbolic_idxs not defined against
3.52.0:

StochasticDiffEq needs nothing of its own: SDEIntegrator is an alias for
ODEIntegrator{<:SDEAlgTypes}.

Verification

Nineteen lines, no behavior change to anything existing — a new function, an @public entry
and a @docs entry.

Docs build (julia --project=docs docs/make.jl, which runs doctest = true and
linkcheck = true) exits 0; that is the check that matters here, since a public name without
a @docs entry is a fatal missing_docs error in this repo.

The predicate is exercised end to end by the three PRs above. With SciMLBase Pkg.developed
to this branch, locally:

DelayDiffEq                                                |    9      9  12.9s
OrdinaryDiffEq                                             |   12     12   4.6s
Symbolic idxs in the current-step interpolant: CVODE_Adams |    7      7   3.5s
Symbolic idxs in the current-step interpolant: CVODE_BDF   |    7      7   1.4s
Symbolic idxs in the current-step interpolant: ARKODE      |    7      7   2.0s
Symbolic idxs on an IDAIntegrator                          |    3      3   1.7s
Symbolic idxs inside a callback (ODEInterfaceDiffEq)       |   19     19   8.2s

Runic --check and typos clean on the files touched.

Things a reviewer should push back on

  • New public API, so this is a minor bump (3.52.0 → 3.53.0).
  • symbolic_type(::Symbol) and symbolic_type(::Expr) are both ScalarSymbolic(), so a
    Symbol or Expr index counts as symbolic here. That is deliberate — it is what makes
    integrator(t; idxs = :x) work against a SymbolCache — but it means solver packages that
    adopt this will start resolving Symbol indexes that previously threw.

Not verified

Nothing beyond the docs build and the three downstream suites above was run; this adds a
function and touches no existing code path.


This PR should be ignored until reviewed by @ChrisRackauckas.

🤖 Generated with Claude Code

https://claude.ai/code/session_019wKpyZHy9u4QhR4ePiVmam

Every solver package that owns an integrator call operator has to decide whether
`idxs` is symbolic before it can route to `symbolic_interpolation`, since a raw
dense-output interpolant only accepts integer component indices. Exposing the
predicate here keeps that one decision in one place rather than duplicating it
in OrdinaryDiffEq, DelayDiffEq, Sundials and ODEInterfaceDiffEq, and keeps those
packages off a SciMLBase internal.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants