Repository navigation
Restore the SciMLOperators operator interface on using SciMLBase - #1550
Conversation
#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
|
OpenAI Codex continuation (2026-08-25): the earlier “Not run” limitation in the PR body is superseded by full local validation.
The PR’s Documentation failure is the incorrect The 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]>
What broke
b9c3507a("Make strict QA owner-contract clean", #1472) removed@reexport using SciMLOperatorsfromsrc/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
SciMLOperatorsmodule binding into scope for everyusing SciMLBase. Deleting itremoved 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)beganfailing with
UndefVarError— for the whole ecosystem, since SciMLBase is the root ofthe 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, ModelingToolkitbroke NeuralLyapunov.Evidence used to pick the list
docs/src/interfaces/SciMLFunctions.mddocumentsjac_prototypeas "anAbstractSciMLOperator" whose Jacobian update is built "usingupdate_coefficients!for the in-place form andupdate_coefficientsfor theout-of-place form", and links to SciMLOperators' Premade Operators page.
SplitFunction,SplitODEProblemandIncrementingODEProblemare specified asoperator-valued. That documented use cannot work if
using SciMLBasedoes not supplythe operators.
SciMLOperators.jlatbb5437a(2026-07-28, the state at the time of Make strict QA owner-contract clean #1472) exported exactly 33 names, and had no
@publicdeclarations at all. Those 33 plus the module binding are what the reexportwas providing.
OptimizationBaserecords the same surface from theother side: its source comment says blanket-reexporting SciMLBase "put 256 names into
every downstream namespace —
DynamicalSDEFunction,BlockDiagonalOperator,AddVectorand the rest of SciMLOperators".DifferentialEquations.jl'sreexports_allowlist 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,TensorSumOperatorOperator 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-solverW = M - γJmachinery. Greppingevery 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 SciMLBaseuser never constructs one. This mirrorsSundials dropping problem types for equation classes it cannot solve.
jacobian_stale,mark_jacobian_updated!,mark_jacobian_current!— SciMLOperatorsonly 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 assumedto have been lost here. It was not: SciMLOperators has never exported it, and its
@publicdeclaration landed in Update callback description ofsolve(OptimizationProblem)#418, also after Make strict QA owner-contract clean #1472 — and Reexport filters onBase.isexportedregardless ofpublic. It stays reachable the documented way, asSciMLOperators.AbstractSciMLOperator, which is precisely why theSciMLOperatorsbinding itself is back in the export list.
Documenting the reexported API
New rendered page
docs/src/interfaces/Reexported_API.md, wired intodocs/pages.jl, listing every nameusing SciMLBaseprovides that SciMLBase does notdefine — so a reader can see at a glance what they get and which package owns each name.
SciMLOperatorsmodule 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).
SciMLOperators.jl, linking to its
Premade Operators and
interface pages — SciMLBase
only re-exports them.
SciMLOperators directly, with both deliberate exclusions spelled out so they do not
read as oversights —
AbstractSciMLOperatorand the other public-but-unexportedabstract/lazy-algebra types (reachable qualified, which is what the re-exported
SciMLOperatorsbinding is for), and theWOperator/StaticWOperator+jacobian_stale/mark_jacobian_updated!/mark_jacobian_current!W-matrix machinery.solve,solve!,init,step!) already exported here getthe same treatment on the same page.
SciMLFunctions.md, which already documentsjac_prototypein terms ofAbstractSciMLOperatorandupdate_coefficients!, now points at the new page.The list is now in three places — the docs page, the
exportblock insrc/SciMLBase.jl, and_scimloperators_reexportsintest/qa/qa.jl. I verifiedprogrammatically 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.isconstantbecomes an ordinaryusing SciMLOperators: isconstant, matching whatsolve!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.jldeclares the list throughreexports_allow, and adds a "Reexportsurface" testset asserting every approved name is both in
names(SciMLBase)andactually in scope from a bare
using SciMLBase. That check runs in its ownsingle-
usingmodule so the extension trigger packagesqa.jlloads cannot mask amissing 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:
The job resolved SciMLOperators to the declared floor, 1.3.0, where the new
using SciMLOperators: ...line cannot even load. Until now nothing in SciMLBasereferenced these names, so the floor was never tested against them.
Walking every registered 1.x tag of SciMLOperators and extracting its
exportblocksgives the introduction point of each restored name:
has_concretizationBlockDiagonalOperator,TensorSumOperator,kronsumSo 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-sha1matches thev1.19.0tag. 1.18.0 is missing three of thenames, 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 —
ArrayInterface7.19 exactly,Adapt/DocStringExtensions/StaticArraysCoreabove — exceptAccessors, whereSciMLOperators 1.19.0 wants ≥ 0.1.42 and SciMLBase declares ≥ 0.1.39. That needs no change
here:
julia-downgrade-compat@v2resolves a jointly minimal version set (Resolver.jl--min-resolve) rather than pinning each direct dependency, so it lifts Accessors tosatisfy 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 SciMLBaseon this branch — loads clean.length(names(SciMLBase)): 466 on master → 498 on this branch, i.e. exactly the 32intended names and nothing else.
names(SciMLBase)andisdefinedin a module whose onlyusingis SciMLBase.MatrixOperator(rand(3,3)),isconstant, andupdate_coefficientsround-trip through the reexported names.SciMLTesting.public_reexports(SciMLBase; allow = <new list>)→Symbol[], i.e. theallow-list is exact, with no unapproved reexports left over.
SciMLTesting.run_api_docs(SciMLBase)→ 2/2 pass (docstring and rendered-docs checksboth green; reexported names are exempt from local rendering and inherit SciMLOperators'
docstrings).
ExplicitImports.improper_explicit_importsstale-import check → no stale importsintroduced by the new
using SciMLOperators: ...block.Documenter.makedocsbuild 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 SciMLOperatorsdoc URLs return HTTP 200 (
linkcheck = trueis on in this repo'smake.jl).exportblock, QA tuple) andasserting set equality → identical, 32 names each.
exportblocks of everyregistered 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 32names in scope,
MatrixOperator/isconstantsmoke test passes. Also confirmed 1.19.0is not yanked in the General registry and its registered tree hash matches the tag.
Runic --check --diffon the changed.jland.mdfiles → clean.Not run: the full
Pkg.test("SciMLBase")suite, the completerun_qaentry point, andthe full
docs/make.jlbuild. The QA environment pulls Enzyme, Makie, Mooncake, PythonCalland the rest of the weakdep closure, and the docs environment pulls ModelingToolkit,
OrdinaryDiffEq, StochasticDiffEq and Plots with
doctest = true, linkcheck = true; thismachine is heavily loaded by other work. Instead I exercised the three
run_qasub-checksthis 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