Skip to content

Support SciMLBase v3 / OrdinaryDiffEq v7 ecosystem#307

Merged
rveltz merged 3 commits into
bifurcationkit:masterfrom
ChrisRackauckas-Claude:widen-scimlbase3
May 17, 2026
Merged

Support SciMLBase v3 / OrdinaryDiffEq v7 ecosystem#307
rveltz merged 3 commits into
bifurcationkit:masterfrom
ChrisRackauckas-Claude:widen-scimlbase3

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Summary

Allows BifurcationKit to be used alongside the SciMLBase v3 / OrdinaryDiffEq v7 / RecursiveArrayTools v4 ecosystem release that's currently rolling out across SciML.

Compat change

Package Before After
SciMLBase "^1, ^2" "^1, ^2, 3"

Source change

The new ensemble API changed the prob_func signature from (prob, i, repeat) to (prob, ctx::EnsembleContext) with no deprecation shim. Updated the three _prob_func definitions in src/periodicorbit/FlowDE.jl to accept either signature — detect whether the second arg is an Integer (v1/v2) or an EnsembleContext (v3) and extract the trajectory index accordingly:

_prob_func = (prob, ctx_or_i, _rest...) -> begin
    ii = ctx_or_i isa Integer ? ctx_or_i : ctx_or_i.sim_id
    remake(prob, ...)
end

output_func already had a 2-arg signature (sol, i) whose unused i is benignly replaced by the context object on v3, so no functional change there beyond renaming the throwaway parameter to make the intent obvious.

Other v3 breaking changes checked and not used by BifurcationKit

I went through OrdinaryDiffEq.jl's NEWS.md and grepped the codebase for each migration. None of these patterns are used in BifurcationKit's source:

  • sol[i] linear indexing on ODESolution (RAT v4 makes it scalar) — uses sol.u[i] consistently
  • length(sol) / eachindex(sol) / for u in sol on a SciML solution — not used
  • EnsembleSolution iteration via for sol in es — uses sol.u consistently
  • u_modified!derivative_discontinuity! — not used
  • sol.destats / has_destats — not used
  • DEAlgorithm / DEProblem / DESolution abstract type renames — not used (uses concrete ODEProblem, EnsembleProblem, SciMLBase.AbstractODEIntegrator)
  • sol.retcode == :Symbol — no equality comparisons against Symbol retcodes
  • verbose = false on solve — BifurcationKit's own verbose kwargs aren't passed to underlying solve
  • concrete_solve — only mentioned in a comment
  • alias_u0 / alias_du0 — not used
  • gamma/beta1/beta2/qmin/qmax/etc. controller kwargs — not used
  • chunk_size / standardtag / diff_type — not used

Verified

julia> using Pkg; Pkg.activate("."); Pkg.add(name="SciMLBase", version="3"); using BifurcationKit
julia> pkgversion(BifurcationKit)
v"0.5.8"

Resolves with: SciMLBase 3.9.1 / RecursiveArrayTools 4.3.0 / DiffEqBase 7.3.0.

Context

Unblocks Catalyst.jl v17 release (SciML/Catalyst.jl#1466) and any other downstream user that wants BifurcationKit alongside the v7 ecosystem.

Please ignore until reviewed by @ChrisRackauckas / the BifurcationKit maintainers.

🤖 Generated with Claude Code

Comment thread Project.toml Outdated
Comment thread Project.toml Outdated
@ChrisRackauckas-Claude ChrisRackauckas-Claude marked this pull request as ready for review May 10, 2026 19:52
ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/Catalyst.jl that referenced this pull request May 10, 2026
Per the original PR intent, this commit drops the legacy major ranges
that were temporarily restored, so installing Catalyst now forces the
new ecosystem majors:

- DiffEqBase v7 (was 6.165.0, 7)
- OrdinaryDiffEqBDF v2 (was 1, 2)
- OrdinaryDiffEqCore v4 (was 3.22, 4)
- OrdinaryDiffEqDefault v2 (was 1, 2)
- OrdinaryDiffEqRosenbrock v2 (was 1, 2)
- OrdinaryDiffEqSDIRK v2 (docs only; was 1, 2)
- OrdinaryDiffEqTsit5 v2 (was 1, 2)
- OrdinaryDiffEqVerner v2 (was 1, 2)
- SciMLBase v3 (was 2.84, 3)
- StochasticDiffEq v7 (was 6.101, 7)

Same tightening in docs/Project.toml and test/extensions/Project.toml.

Bump Catalyst to v17.0.0 (breaking).

Documentation and Extensions Tests are expected to stay red on this
branch until the corresponding downstream bumps land in the registry:

- sebapersson/SBMLImporter.jl#155 (Catalyst v17 / SciMLBase v3)
- bifurcationkit/BifurcationKit.jl#307 (SciMLBase v3 + ensemble
  prob_func signature fix)
- sebapersson/PEtab.jl#383 (Catalyst v17 / SciMLBase v3 +
  SciMLAlgorithm rename + verbose-Bool fix)

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@rveltz

rveltz commented May 10, 2026

Copy link
Copy Markdown
Member

Thank you Chris for your work (and your co-worker ;) )

I will try to review this PR as fast as I can

@rveltz

rveltz commented May 17, 2026

Copy link
Copy Markdown
Member

Hi,

I am done with a major overhaul of BK.
I want to merge your changes but the above CI failed for installing OdinaryDiffEq.
Am I missing something?

ChrisRackauckas and others added 3 commits May 17, 2026 06:29
The new ecosystem release changed the ensemble `prob_func` signature
from `(prob, i, repeat)` to `(prob, ctx::EnsembleContext)` (no
deprecation shim). Update FlowDE.jl's three `_prob_func` definitions
to accept either signature: detect whether the second arg is an
Integer (v1/v2) or an EnsembleContext (v3) and extract the trajectory
index accordingly.

`output_func` was already using a 2-arg signature `(sol, i)` whose
unused `i` is benignly replaced by the context object on v3, so no
change there beyond renaming the throwaway parameter.

Compat:
- SciMLBase: "^1, ^2" → "^1, ^2, 3"

Verified locally: BifurcationKit precompiles and loads against
SciMLBase v3.9.1, RecursiveArrayTools v4.x, DiffEqBase v7.x.

Context: this unblocks Catalyst v17's Extensions tests
(SciML/Catalyst.jl#1466) and any other downstream user that wants
BifurcationKit alongside the v7 ecosystem.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-authored-by: Christopher Rackauckas <accounts@chrisrackauckas.com>
…p fixups

After running the full suite against SciMLBase 3.13 / OrdinaryDiffEq 7.0
on master (rebased branch), three remaining v3/v7 break points surfaced:

1. VectorContinuousCallback in SciMLBase v3 dropped the affect_neg!
   keyword. The single affect! is now invoked with
   affect!(integrator, simultaneous_events::Vector{Int8}) where each
   entry is +1 for an upcrossing, -1 for a downcrossing, 0 for none.
   PoincareShooting wants upcrossings only, so its callback now calls
   terminate! whenever any(==(Int8(1)), events).

2. OrdinaryDiffEq v7 no longer reexports the full solver catalog from
   the umbrella package -- Rodas5, Rodas4, Rodas4P live in
   OrdinaryDiffEqRosenbrock, KenCarp4 in OrdinaryDiffEqSDIRK. Tests now
   pull them directly from the subpackages, which are added to
   [extras]/[targets]. Test compat for OrdinaryDiffEq widened to
   "^6.33, 7".

3. terminate! and EnsembleProblem are likewise no longer reexported by
   OrdinaryDiffEq; the two tests that referenced ODE.terminate! /
   ODE.EnsembleProblem now `using SciMLBase: terminate!,
   EnsembleProblem`.

Full test suite: 15247/15247 passing locally (Julia 1.10, SciMLBase
3.13.0, OrdinaryDiffEq 7.0.0, DiffEqBase 7.5.0).

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor Author

@rveltz Sorry, the diff was stale — your 0.6.0/0.7.0 refactor introduced several more v3/v7 break points that hadn't surfaced when I opened this. Rebased on current master and pushed a follow-up commit (047be020). Three things broke beyond the original prob_func signature change:

  1. VectorContinuousCallback lost affect_neg! in SciMLBase v3. The signature for affect! changed from (integrator, idx::Int) to (integrator, simultaneous_events::Vector{Int8}) where +1 = upcrossing, -1 = downcrossing, 0 = none. PoincareShooting wants upcrossings only, so its callback now does any(==(Int8(1)), events) && terminate!(integrator). Both call sites in src/periodicorbit/ShootingDE.jl are updated.

  2. OrdinaryDiffEq v7 stopped reexporting most solvers. Only Tsit5/Vern*/Rosenbrock23/Rodas5P/FBDF are kept in the umbrella package now. Tests that reach for ODE.Rodas5, ODE.Rodas4, ODE.Rodas4P, ODE.KenCarp4 were hitting UndefVarError. Test files now pull them directly from OrdinaryDiffEqRosenbrock / OrdinaryDiffEqSDIRK, which are added to [extras] and [targets] in Project.toml. Test compat for OrdinaryDiffEq widened to "^6.33, 7".

  3. terminate! and EnsembleProblem aren't reexported from OrdinaryDiffEq v7 either. The two tests that referenced ODE.terminate! / ODE.EnsembleProblem now using SciMLBase: terminate!, EnsembleProblem.

The CI failure you saw was the resolver giving up: with RecursiveArrayTools = "4" pinned but the test-env OrdinaryDiffEq capped at ^6, the SciMLBase v3 ↔ OrdinaryDiffEq v6 incompatibility had no satisfying assignment. Widening OrdinaryDiffEq test compat to allow v7 lets the resolver pick the v3-compatible stack.

Verified locally on Julia 1.10 with SciMLBase 3.13.0 / OrdinaryDiffEq 7.0.0 / DiffEqBase 7.5.0 / RecursiveArrayTools 4.3.0:

Test Summary:  |  Pass  Total      Time
BifurcationKit | 15247  15247  99m56.7s
     Testing BifurcationKit tests passed

CI should be green this time — please re-run when you have a moment. Ignore until reviewed by @ChrisRackauckas as usual.

@codecov

codecov Bot commented May 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.59%. Comparing base (e8e27df) to head (047be02).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #307   +/-   ##
=======================================
  Coverage   91.59%   91.59%           
=======================================
  Files          69       69           
  Lines       10315    10321    +6     
=======================================
+ Hits         9448     9454    +6     
  Misses        867      867           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rveltz rveltz merged commit 63fe658 into bifurcationkit:master May 17, 2026
6 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.

3 participants