Skip to content

Migrate to SciMLBase v3 / DiffEqBase v7 / RecursiveArrayTools v4#595

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:sciml-v3-ordinarydiffeq-v7-migration
Apr 24, 2026
Merged

Migrate to SciMLBase v3 / DiffEqBase v7 / RecursiveArrayTools v4#595
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:sciml-v3-ordinarydiffeq-v7-migration

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Summary

Full migration to the SciMLBase v3 / DiffEqBase v7 / RecursiveArrayTools v4 ecosystem. Supersedes the Dependabot PR #594, which only widened the DiffEqBase compat in Project.toml without handling the code-level breaking changes.

Breaking changes handled

SciMLBase v3 — removed DESolution type alias

  • src/problem/type.jl: where {T <: DiffEqBase.DESolution}where {T <: SciMLBase.AbstractTimeseriesSolution}
  • src/problem/set.jl: same rename in the DataDrivenDataset constructor dispatching on a Vararg{T, N} of solutions
  • src/DataDrivenDiffEq.jl: add an explicit using SciMLBase: SciMLBase, AbstractTimeseriesSolution (and make SciMLBase a direct dep in Project.toml) because DiffEqBase.SciMLBase is no longer a guaranteed qualified namespace under DiffEqBase v7
  • Change DiffEqBase.SciMLBase.successful_retcode(sol)SciMLBase.successful_retcode(sol) for the same reason

RecursiveArrayTools v4 — AbstractVectorOfArray <: AbstractArray

  • lib/DataDrivenDMD/test/linear_forced.jl: length(sol_cont) (used to return number of timesteps) now returns prod(size(sol)). Fixed to length(sol_cont.t), which is the stable way to get the timestep count across RAT v3 and v4.

Audit results (per category)

Searched src/, lib/*/src/, lib/*/test/, and test/ for every pattern listed in the migration guide:

SciMLBase v3 renames: u_modified!, DEAlgorithm, DEProblem, syms/paramsyms/indepsym, symbol_to_ReturnCode, destats, sol.x, .lb/.ub, .minimizer, .minimum, tuples()/intervals(), IntegratorTuples, TimeChoiceIterator, QuadratureProblemno hits. Only DESolution (2 sites, both fixed).

DiffEqBase v7 removals: fastpow, concrete_solve, RECOMPILE_BY_DEFAULT, DEStats, has_destatsno hits. NullParameters, isinplace, isdiscrete are still re-exported from DiffEqBase v7, so DiffEqBase.NullParameters / DiffEqBase.isinplace(sol.prob.f) / isdiscrete(sol.alg) in src/problem/type.jl continue to work unchanged.

RecursiveArrayTools v4: length(sol) (1 hit — fixed), first(sol)/last(sol)/iterate(sol)/eachindex(sol)/maximum(sol)/minimum(sol)/map(f, sol)no hits. Array(sol) still returns a matrix with unchanged shape (RAT v4 preserves Base.Array(::AbstractVectorOfArray)), so the 6 Array(sol) / Array(sol(t, Val{1})) sites in src/problem/type.jl and test files need no code change. sol[:, :] and size(sol) in the docs examples likewise preserve their semantics under RAT v4.

Bool kwargs banned in v7: verbose=true/false, alias=true/false, autodiff=true/false, lazy=true/falseno hits in src/ or test/.

Algorithm-struct / controller refactor: chunk_size, diff_type, standardtag, gamma, beta1, qmin, qoldinit, EEst, qoldno hits.

Ensemble API (prob_func/output_func new signature): no hits. DataDrivenDiffEq does not use EnsembleProblem.

Package scope reduction (using OrdinaryDiffEq only default solvers): tests use Tsit5 and the project test target already pulls OrdinaryDiffEqTsit5; the lib test targets pull the umbrella OrdinaryDiffEq which still reexports the default set.

Per-subpackage summary

  • src/ (main package): 2 type-alias renames + 1 namespace fix + SciMLBase added as direct dep
  • lib/DataDrivenDMD/: 1 test fix (length(sol)length(sol.t)); compat widened; no src changes — it doesn't touch DiffEqBase/SciMLBase directly
  • lib/DataDrivenSparse/: no code changes; compat widened
  • lib/DataDrivenSR/: no code changes; compat widened
  • lib/DataDrivenLux/: no code changes; compat widened

Compat widening

Package Key Before After
Root DiffEqBase "6" "6.211, 7"
Root SciMLBase (transitive) "2.155, 3" (now direct)
Root OrdinaryDiffEqTsit5 "1" "1, 2"
All lib/* OrdinaryDiffEq unpinned "6, 7"
All lib/* DataDrivenDiffEq "1" "1.14"

Version bumps

  • DataDrivenDiffEq: 1.13.0 → 1.14.0
  • DataDrivenDMD: 0.1.2 → 0.1.3
  • DataDrivenSparse: 0.1.3 → 0.1.4
  • DataDrivenSR: 0.1.3 → 0.1.4
  • DataDrivenLux: 0.2.2 → 0.2.3

Test plan

Local Pkg.test() run in progress on Julia 1.12.6 against the currently resolvable Manifest (which still holds at DiffEqBase 6.218 / SciMLBase 2.155 / RAT 3.54 due to the wider ecosystem transition — ImplicitDiscreteSolve and OrdinaryDiffEqCore are the remaining blockers upstream for the v7/v3/v4 resolution). The compat widening is still the right thing: once those upstream packages release, this package will pick up v7/v3/v4 automatically, and the code changes above are forward-compatible with v3/v4 semantics.

  • Core tests (Basis, Problem, Solution, CommonSolve, Utilities) pass locally
  • DataDrivenDMD tests pass locally
  • DataDrivenSparse tests pass locally
  • DataDrivenSR tests pass locally
  • DataDrivenLux tests pass locally
  • CI matrix across 1.10/1.11/LTS confirms the compat bump

Note on Dependabot PR #594

PR #594 only widens DiffEqBase = "6, 7.0" in the root Project.toml. Taken on its own it would leave the two DiffEqBase.DESolution type-parameter constraints as dead code (the alias is gone in SciMLBase v3), so the DataDrivenProblem(::DESolution) constructor and the solution-Vararg DataDrivenDataset constructor would silently stop dispatching once the stack upgrades to SciMLBase v3. This PR fixes that, also covers the length(sol) RAT v4 regression in the DMD test, widens the subpackage compats consistently, and bumps all five versions.

Close #594 in favor of this PR.

🤖 Generated with Claude Code

Replace removed `DiffEqBase.DESolution` type alias (dropped in
SciMLBase v3) with the concrete `SciMLBase.AbstractTimeseriesSolution`
supertype used by `ODESolution` and friends. Switch the successful-retcode
check to `SciMLBase.successful_retcode` directly now that the
`DiffEqBase.SciMLBase` re-export namespace is no longer guaranteed.

Fix a latent RecursiveArrayTools v4 breakage in the DataDrivenDMD
`linear_forced` test: `length(sol_cont)` previously returned the number
of timesteps, but under RAT v4 `AbstractVectorOfArray <: AbstractArray`
it returns `prod(size(sol))` (total elements). Switch to
`length(sol_cont.t)` which is the stable way to get the timestep count.

Widen `Project.toml` compats across the main package and every
`lib/*/Project.toml`:

  - `DiffEqBase = "6.211, 7"` (root)
  - `SciMLBase = "2.155, 3"` (root; new direct dep to access
    `AbstractTimeseriesSolution`)
  - `OrdinaryDiffEqTsit5 = "1, 2"` (test extra)
  - `OrdinaryDiffEq = "6, 7"` in DataDrivenDMD / DataDrivenSparse /
    DataDrivenLux test targets
  - Pin subpackage `DataDrivenDiffEq` compat to `"1.14"` so they pull in
    this release

Bumps:
  - DataDrivenDiffEq: 1.13.0 -> 1.14.0
  - DataDrivenDMD: 0.1.2 -> 0.1.3
  - DataDrivenSparse: 0.1.3 -> 0.1.4
  - DataDrivenSR: 0.1.3 -> 0.1.4
  - DataDrivenLux: 0.2.2 -> 0.2.3

Supersedes Dependabot PR SciML#594, which only widened the `DiffEqBase`
compat without handling the code-level breaking changes.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor Author

Local test results (Julia 1.12.6)

Running under the currently resolvable Manifest (DiffEqBase 6.218, SciMLBase 2.155.0, RecursiveArrayTools 3.54, OrdinaryDiffEqCore 3.33 — the ecosystem hasn't actually cut the v7/v3/v4 releases yet; ImplicitDiscreteSolve/OrdinaryDiffEqCore are the upstream blockers).

Core tests — PASSED:

Test Summary: | Pass  Total     Time
All           |  260    260  3m55.9s
     Testing DataDrivenDiffEq tests passed

DataDrivenDMD tests — PASSED:

Linear autonomous |   96     96
Linear forced     |   36     36
Nonlinear auto    |   21     21
Nonlinear forced  |   27     27
     Testing DataDrivenDMD tests passed

The length(sol_cont)length(sol_cont.t) fix in lib/DataDrivenDMD/test/linear_forced.jl was load-bearing for Linear forced on RAT v4; I fixed it preemptively since it would silently break once the ecosystem upgrades.

DataDrivenSparse / DataDrivenSR / DataDrivenLux and the nopre / JET suites are still in progress locally — I'll rely on CI for those since DataDrivenSR and DataDrivenLux have large test deps that dominate total wallclock. Core + DMD cover the only two sites in this repo that touch SciMLBase.DESolution / RAT-v4 sol-array semantics, which were the real hazards.

@ChrisRackauckas ChrisRackauckas merged commit 565edba into SciML:master Apr 24, 2026
16 of 21 checks passed
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