Skip to content

Restore the SciMLOperators operator interface on using SciMLBase - #1550

Merged
ChrisRackauckas merged 4 commits into
masterfrom
restore-scimloperators-reexports
Aug 26, 2026
Merged

ChrisRackauckas merged 4 commits into
masterfrom
restore-scimloperators-reexports

Conversation

@ChrisRackauckas

@ChrisRackauckas ChrisRackauckas commented Aug 23, 2026 •

Copy link
Copy Markdown
Member

What broke

b9c3507a ("Make strict QA owner-contract clean", #1472) removed
@reexport using SciMLOperators from src/SciMLBase.jl.

Reexport exports filter(x -> Base.isexported(m, x), names(m; all = true, imported = true)),
so that one line had been putting SciMLOperators' 33 exported names plus the
SciMLOperators module binding
into scope for every using SciMLBase. Deleting it
removed all 34 from SciMLBase's public surface. Nothing in SciMLBase's own test suite
imports them, so CI stayed green while using SciMLBase; MatrixOperator(A) began
failing with UndefVarError — for the whole ecosystem, since SciMLBase is the root of
the SciML dependency tree.

Measured: length(names(SciMLBase)) is 466 on master, 498 on this branch.

This is the same class of breakage already confirmed elsewhere in the org — JumpProcesses
stripping its DiffEqBase reexport broke MomentClosure's DiscreteProblem/EnsembleProblem,
and NeuralPDE stripping SciMLBase, ModelingToolkit broke NeuralLyapunov.

Evidence used to pick the list

  1. SciMLBase's own documentation. docs/src/interfaces/SciMLFunctions.md documents
    jac_prototype as "an AbstractSciMLOperator" whose Jacobian update is built "using
    update_coefficients! for the in-place form and update_coefficients for the
    out-of-place form", and links to SciMLOperators' Premade Operators page.
    SplitFunction, SplitODEProblem and IncrementingODEProblem are specified as
    operator-valued. That documented use cannot work if using SciMLBase does not supply
    the operators.
  2. Reconstruction of the exact lost surface. SciMLOperators.jl at bb5437a
    (2026-07-28, the state at the time of Make strict QA owner-contract clean #1472) exported exactly 33 names, and had no
    @public declarations at all. Those 33 plus the module binding are what the reexport
    was providing.
  3. Downstream corroboration. OptimizationBase records the same surface from the
    other side: its source comment says blanket-reexporting SciMLBase "put 256 names into
    every downstream namespace — DynamicalSDEFunction, BlockDiagonalOperator,
    AddVector and the rest of SciMLOperators". DifferentialEquations.jl's
    reexports_allow list still carries this same operator set as approved public surface.

Restored names (32)

SciMLOperators (the module binding), plus:

Premade operator types (12) — AddVector, AffineOperator, BlockDiagonalOperator,
DiagonalOperator, FunctionOperator, IdentityOperator, InvertibleOperator,
MatrixOperator, NullOperator, ScalarOperator, TensorProductOperator,
TensorSumOperator

Operator interface and traits (19) — cache_operator, concretize, has_adjoint,
has_concretization, has_exp, has_expmv, has_expmv!, has_ldiv, has_ldiv!,
has_mul, has_mul!, isconstant, isconvertible, iscached, islinear, issquare,
kronsum, update_coefficients, update_coefficients!

Deliberately not restored

  • WOperator, StaticWOperator — the stiff-solver W = M - γJ machinery. Grepping
    every SciML clone I have locally, the only live uses are in OrdinaryDiffEq and
    LinearSolve, both of which depend on SciMLOperators directly; everywhere else they
    appear only in comments. A using SciMLBase user never constructs one. This mirrors
    Sundials dropping problem types for equation classes it cannot solve.
  • jacobian_stale, mark_jacobian_updated!, mark_jacobian_current! — SciMLOperators
    only began exporting these in its make types safe to print when verbose stacktraces are on #419, after Make strict QA owner-contract clean #1472, so they were never part of this
    surface.
  • AbstractSciMLOperator — worth flagging, because it is the name most often assumed
    to have been lost here. It was not: SciMLOperators has never exported it, and its
    @public declaration landed in Update callback description of solve(OptimizationProblem) #418, also after Make strict QA owner-contract clean #1472 — and Reexport filters on
    Base.isexported regardless of public. It stays reachable the documented way, as
    SciMLOperators.AbstractSciMLOperator, which is precisely why the SciMLOperators
    binding itself is back in the export list.

Documenting the reexported API

New rendered page docs/src/interfaces/Reexported_API.md, wired into
docs/pages.jl, listing every name using SciMLBase provides that SciMLBase does not
define — so a reader can see at a glance what they get and which package owns each name.

  • The 32 SciMLOperators names grouped by role: the SciMLOperators module binding;
    operator types (trivial / matrix-backed / scalar / matrix-free / structured and lazy);
    operator interface and traits (updating / caching and materialization / structural
    traits / supported-operation traits / lazy algebra).
  • Stated explicitly as owned and documented by
    SciMLOperators.jl
    , linking to its
    Premade Operators and
    interface pages — SciMLBase
    only re-exports them.
  • A boundary section: anything else from SciMLOperators must be imported from
    SciMLOperators directly
    , with both deliberate exclusions spelled out so they do not
    read as oversights — AbstractSciMLOperator and the other public-but-unexported
    abstract/lazy-algebra types (reachable qualified, which is what the re-exported
    SciMLOperators binding is for), and the WOperator/StaticWOperator +
    jacobian_stale/mark_jacobian_updated!/mark_jacobian_current! W-matrix machinery.
  • The CommonSolve verbs (solve, solve!, init, step!) already exported here get
    the same treatment on the same page.
  • SciMLFunctions.md, which already documents jac_prototype in terms of
    AbstractSciMLOperator and update_coefficients!, now points at the new page.

The list is now in three places — the docs page, the export block in
src/SciMLBase.jl, and _scimloperators_reexports in test/qa/qa.jl. I verified
programmatically that all three parse to the identical 32-name set, each code copy
cross-references the other two, and the "Reexport surface" testset holds the code copies
to the real export surface.

Implementation notes

  • const isconstant = SciMLOperators.isconstant becomes an ordinary
    using SciMLOperators: isconstant, matching what solve! already does with CommonSolve.
    The alias made SciMLBase the binding owner, which would have failed run_api_docs'
    docstring check once the name was exported; imported, the docstring resolves to
    SciMLOperators.
  • test/qa/qa.jl declares the list through reexports_allow, and adds a "Reexport
    surface" testset asserting every approved name is both in names(SciMLBase) and
    actually in scope from a bare using SciMLBase. That check runs in its own
    single-using module so the extension trigger packages qa.jl loads cannot mask a
    missing export. The allow-list cannot drift from the exports in either direction.

Compat floor: SciMLOperators 1.3 → 1.19

This is a genuinely tighter floor than SciMLBase carries today, and it is a direct
consequence of the restoration — not unrelated churn.
Downgrade CI caught it:

ERROR: LoadError: UndefVarError: `BlockDiagonalOperator` not defined
ERROR: LoadError: Failed to precompile SciMLBase

The job resolved SciMLOperators to the declared floor, 1.3.0, where the new
using SciMLOperators: ... line cannot even load. Until now nothing in SciMLBase
referenced these names, so the floor was never tested against them.

Walking every registered 1.x tag of SciMLOperators and extracting its export blocks
gives the introduction point of each restored name:

introduced in names
1.0.0 the other 27
1.13.0 has_concretization
1.19.0 BlockDiagonalOperator, TensorSumOperator, kronsum

So 1.19.0 is the first registered version exporting all 32, and every release from
1.19.0 through 1.28.0 (and master's 1.29.0) still does. 1.19.0 is not yanked, and its
registered git-tree-sha1 matches the v1.19.0 tag. 1.18.0 is missing three of the
names, so the floor is minimal, not merely sufficient.

No other compat entry needs moving. Julia floors match (both 1.10), and SciMLOperators
1.19.0's own bounds are already satisfied by SciMLBase's — ArrayInterface 7.19 exactly,
Adapt/DocStringExtensions/StaticArraysCore above — except Accessors, where
SciMLOperators 1.19.0 wants ≥ 0.1.42 and SciMLBase declares ≥ 0.1.39. That needs no change
here: julia-downgrade-compat@v2 resolves a jointly minimal version set (Resolver.jl
--min-resolve) rather than pinning each direct dependency, so it lifts Accessors to
satisfy the transitive bound, and SciMLBase's own 0.1.39 floor stays accurate for its own
use.

Why this is not breaking

Every name here used to be exported by this package; this only restores what #1472
removed, and adds nothing that was not previously in scope. Per SemVer that is a minor
(here: patch, 0.x-style) change. No version bump in this PR — a separate release pass
handles versions.

What I verified vs. inspected

Ran locally (Julia 1.11.8, macOS):

  • Pkg.instantiate() + using SciMLBase on this branch — loads clean.
  • length(names(SciMLBase)): 466 on master → 498 on this branch, i.e. exactly the 32
    intended names and nothing else.
  • All 32 names present in names(SciMLBase) and isdefined in a module whose only
    using is SciMLBase.
  • Functional smoke test: MatrixOperator(rand(3,3)), isconstant, and
    update_coefficients round-trip through the reexported names.
  • SciMLTesting.public_reexports(SciMLBase; allow = <new list>) → Symbol[], i.e. the
    allow-list is exact, with no unapproved reexports left over.
  • SciMLTesting.run_api_docs(SciMLBase) → 2/2 pass (docstring and rendered-docs checks
    both green; reexported names are exempt from local rendering and inherit SciMLOperators'
    docstrings).
  • ExplicitImports.improper_explicit_imports stale-import check → no stale imports
    introduced by the new using SciMLOperators: ... block.
  • A scoped Documenter.makedocs build over the new page plus the two pages it links to:
    the page renders, and all three new cross-references resolve to real anchors
    (Reexported_API → SciMLFunctions#scimlfunctions,
    Reexported_API → Init_Solve#The-SciML-init-and-solve-Functions,
    SciMLFunctions → Reexported_API#Reexported-API). All three upstream SciMLOperators
    doc URLs return HTTP 200 (linkcheck = true is on in this repo's make.jl).
  • A script parsing all three copies of the list (docs page, export block, QA tuple) and
    asserting set equality → identical, 32 names each.
  • The compat floor, two ways: statically, by extracting the export blocks of every
    registered SciMLOperators 1.x tag to find each name's introduction point (1.19.0 is the
    max; 1.18.0 is missing three); and dynamically, by resolving SciMLOperators to exactly
    1.19.0 against this branch — SciMLBase precompiles, names(SciMLBase) is 498, all 32
    names in scope, MatrixOperator/isconstant smoke test passes. Also confirmed 1.19.0
    is not yanked in the General registry and its registered tree hash matches the tag.
  • Runic --check --diff on the changed .jl and .md files → clean.

Not run: the full Pkg.test("SciMLBase") suite, the complete run_qa entry point, and
the full docs/make.jl build. The QA environment pulls Enzyme, Makie, Mooncake, PythonCall
and the rest of the weakdep closure, and the docs environment pulls ModelingToolkit,
OrdinaryDiffEq, StochasticDiffEq and Plots with doctest = true, linkcheck = true; this
machine is heavily loaded by other work. Instead I exercised the three run_qa sub-checks
this change can actually affect (public_reexports, run_api_docs, ExplicitImports'
stale-import check) directly against the built package, and did the scoped Documenter build
described above. CI covers the rest.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ

ChrisRackauckas and others added 3 commits August 23, 2026 18:11
#1472 dropped `@reexport using SciMLOperators` from `src/SciMLBase.jl`. Reexport
exports `filter(x -> Base.isexported(m, x), names(m; all = true, imported = true))`,
so that line had been putting SciMLOperators' 33 exported names plus the
`SciMLOperators` module binding into scope for every `using SciMLBase`. Removing it
silently deleted all 34 from SciMLBase's public surface: nothing in SciMLBase's own
tests imports them, so CI stayed green while `using SciMLBase; MatrixOperator(A)`
started failing with `UndefVarError` across the ecosystem.

SciMLBase is the root of the SciML dependency tree, so the blast radius is every
package and script that reached an operator through it. `OptimizationBase` records
the same surface from the other side: its comment notes that blanket-reexporting
SciMLBase "put 256 names into every downstream namespace -- `DynamicalSDEFunction`,
`BlockDiagonalOperator`, `AddVector` and the rest of SciMLOperators".

Restore the surface as an explicit `export` list rather than the blanket reexport,
following the Sundials.jl#553 pattern. The list is the operator interface SciMLBase's
own documentation is written in terms of: `SciMLFunctions.md` documents
`jac_prototype` as "an `AbstractSciMLOperator`" whose Jacobian update goes through
`update_coefficients!`/`update_coefficients`, and `SplitFunction`, `SplitODEProblem`
and `IncrementingODEProblem` are all specified as operator-valued. That means the
premade operator types, the operator traits, and the update/cache verbs -- 32 names.

Deliberately excluded from the 34: `WOperator` and `StaticWOperator`. They are the
stiff-solver W = M - gamma*J machinery, constructed by OrdinaryDiffEq and consumed by
LinearSolve, both of which depend on SciMLOperators directly. A `using SciMLBase` user
never builds one. `jacobian_stale`, `mark_jacobian_updated!` and
`mark_jacobian_current!` are not in the list either: SciMLOperators only started
exporting them in #419, after #1472, so they were never part of this surface.

`AbstractSciMLOperator` is a common assumption in reports about this breakage, but it
was never reexported here: SciMLOperators has never exported it, and its `@public`
declaration landed in #418, after #1472 -- and Reexport filters on `Base.isexported`
regardless. It stays reachable the documented way, qualified as
`SciMLOperators.AbstractSciMLOperator`, which is why the `SciMLOperators` binding
itself is back in the export list.

`const isconstant = SciMLOperators.isconstant` becomes an ordinary
`using SciMLOperators: isconstant`, matching what `solve!` already does with
CommonSolve. The alias made SciMLBase the binding owner, which would have failed
`run_api_docs`' docstring check once the name was exported; imported, the docstring
resolves to SciMLOperators.

QA declares the list through `reexports_allow`, and a new "Reexport surface" testset
asserts every approved name is both in `names(SciMLBase)` and actually in scope from
a bare `using SciMLBase`, evaluated in a dedicated module so the extension trigger
packages `test/qa/qa.jl` loads cannot mask a missing export. The allow-list cannot
drift from the exports in either direction.

Restoring names that used to be exported is not breaking; no version bump here.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ
A restored export that is not documented is only half the fix: nothing tells the next
reader, or the next QA sweep, that the name is deliberately part of SciMLBase's surface
or which package actually owns it.

Add `docs/src/interfaces/Reexported_API.md`, wired into `docs/pages.jl`, listing every
name `using SciMLBase` provides that SciMLBase does not define. The 32 SciMLOperators
names are grouped by role -- the `SciMLOperators` module binding, operator types
(trivial / matrix-backed / scalar / matrix-free / structured and lazy), and the operator
interface and traits (updating / caching and materialization / structural traits /
supported-operation traits / lazy algebra) -- each stated as owned and documented by
SciMLOperators, with links to its Premade Operators and interface pages. The CommonSolve
verbs already exported here get the same treatment.

The page closes with the boundary: anything else from SciMLOperators must be imported
from SciMLOperators directly. Two exclusions are spelled out rather than left to look
like oversights. `AbstractSciMLOperator` and the other abstract and lazy-algebra types
are public but deliberately not exported by SciMLOperators, so they are not exported
here either and are used qualified -- which is what the reexported `SciMLOperators`
binding is for. `WOperator`, `StaticWOperator`, `jacobian_stale`,
`mark_jacobian_updated!` and `mark_jacobian_current!` are stiff-solver W-matrix
machinery for packages that depend on SciMLOperators directly.

`SciMLFunctions.md` already describes `jac_prototype` in terms of `AbstractSciMLOperator`
and `update_coefficients!`, so it now points at the new page for the exact list.

The list now lives in three places -- the page, the `export` block in
`src/SciMLBase.jl`, and `_scimloperators_reexports` in `test/qa/qa.jl`. All three are
identical, the two code copies carry cross-references to the other two, and the
"Reexport surface" testset holds the code copies to the actual export surface.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ
Downgrade CI resolved SciMLOperators to the declared floor, 1.3.0, where the new
`using SciMLOperators: ...` line fails at precompile time:

    ERROR: LoadError: UndefVarError: `BlockDiagonalOperator` not defined
    ERROR: LoadError: Failed to precompile SciMLBase

That is the honest consequence of the restoration: the reexported names are newer than
the floor SciMLBase carried, and until now nothing in SciMLBase referenced them, so the
floor was never tested against them. `BlockDiagonalOperator` is only the first name the
loader reaches.

Walking every registered 1.x tag of SciMLOperators and extracting its `export` blocks
gives the introduction point of each of the 32 restored names:

  - 1.0.0  -- the other 27 names
  - 1.13.0 -- `has_concretization`
  - 1.19.0 -- `BlockDiagonalOperator`, `TensorSumOperator`, `kronsum`

so 1.19.0 is the first registered version that exports all of them, and every release
from 1.19.0 through 1.28.0 (and master's 1.29.0) still does. 1.19.0 is not yanked, and
its registered git-tree-sha1 matches the `v1.19.0` tag. 1.18.0 is missing three of the
names, so this floor is minimal rather than merely sufficient.

Verified by resolving SciMLOperators to exactly 1.19.0 against this branch: SciMLBase
precompiles, `names(SciMLBase)` is 498, and all 32 names are in scope from a bare
`using SciMLBase`. Julia floors match (both 1.10), and SciMLOperators 1.19.0's own
bounds are already satisfied by SciMLBase's -- `ArrayInterface` 7.19 exactly, `Adapt`,
`DocStringExtensions` and `StaticArraysCore` above -- except `Accessors`, where
SciMLOperators 1.19.0 wants 0.1.42 and SciMLBase declares 0.1.39. That needs no change
here: the downgrade action resolves a jointly minimal version set rather than pinning
each direct dependency, so it lifts Accessors to satisfy the transitive bound, and
SciMLBase's own 0.1.39 floor remains accurate for its own use.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

OpenAI Codex continuation (2026-08-25): the earlier “Not run” limitation in the PR body is superseded by full local validation.

  • GROUP=Core ~/.juliaup/bin/julia +release --project=. -e 'using Pkg; Pkg.test()' → Testing SciMLBase tests passed (including Remake 4430/4430).
  • GROUP=QA JULIA_CONDAPKG_BACKEND=Null JULIA_PYTHONCALL_EXE=/usr/bin/python3 ... Pkg.test() → QA 123/123 and Testing SciMLBase tests passed.
  • ~/.juliaup/bin/julia +release --project=docs docs/make.jl → exit 0 after doctests, cross-references, checks, and HTML rendering.
  • Runic and typos over the complete parent diff → exit 0.
  • Exact floor probe: SciMLOperators 1.18.0 lacks BlockDiagonalOperator, TensorSumOperator, and kronsum; 1.19.0 has all three.

The PR’s Documentation failure is the incorrect JuliaLang/CommonSolve.jl owner URL. The exact one-line correction is available in stacked draft #1555; the corrected URL returns HTTP 200 and the full docs build passes with it.

The DownstreamAD failures reproduce unchanged on master in https://github.com/SciML/SciMLBase.jl/actions/runs/32635237444 (Julia 1: https://github.com/SciML/SciMLBase.jl/actions/runs/32635237444/job/97183904080; LTS: https://github.com/SciML/SciMLBase.jl/actions/runs/32635237444/job/97183904057).

AI continuation: OpenAI Codex session ID 01a03a11-47c2-77e0-858b-167004f0b79c.

AI-Agent: OpenAI Codex
Codex-Session-ID: 01a03a11-47c2-77e0-858b-167004f0b79c


Claude-Session: https://claude.ai/code/session_01Rmh6B9eoW3N8oCbuuVPVxJ

Co-authored-by: ChrisRackauckas-Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
@ChrisRackauckas
ChrisRackauckas merged commit 49cb8cf into master Aug 26, 2026
30 of 54 checks passed
@ChrisRackauckas
ChrisRackauckas deleted the restore-scimloperators-reexports branch August 26, 2026 10:00
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