Skip to content

Bump compat for OrdinaryDiffEq v7 / StochasticDiffEq v7 ecosystem#581

Merged
ChrisRackauckas merged 3 commits intoSciML:masterfrom
ChrisRackauckas-Claude:bump-ordinarydiffeq-v7-ecosystem
Apr 28, 2026
Merged

Bump compat for OrdinaryDiffEq v7 / StochasticDiffEq v7 ecosystem#581
ChrisRackauckas merged 3 commits intoSciML:masterfrom
ChrisRackauckas-Claude:bump-ordinarydiffeq-v7-ecosystem

Conversation

@ChrisRackauckas-Claude
Copy link
Copy Markdown
Contributor

Summary

This PR widens compat entries so JumpProcesses works with the upcoming OrdinaryDiffEq v7 / StochasticDiffEq v7 ecosystem, and migrates test code to the SciMLBase v3 / RecursiveArrayTools v4 APIs that shipped in prior PRs.

Compat changes

Source / test migrations

  • prob_func signature (SciMLBase v3 breaking change): The old 3-arg prob_func(prob, i, repeat) is gone in SciMLBase v3.6.0, which calls prob_func(prob, ctx) where ctx is an EnsembleContext. Updated in test/ensemble_uniqueness.jl and test/thread_safety.jl.
  • length(sol) (RecursiveArrayTools v4 breaking change): length(AbstractVectorOfArray) now returns total scalar element count (size product), not the number of trajectories/timesteps. length(sol.u) is unambiguous. Fixed in test/ensemble_problems.jl, test/saveat_regression.jl, test/thread_safety.jl, and test/variable_rate.jl.

No source changes needed

  • src/SSA_stepper.jl already handles u_modified!derivative_discontinuity! rename via an @static if isdefined(SciMLBase, :derivative_discontinuity!) guard (added in PR Prepare source for SciMLBase v3 and widen compat #579).
  • u_modified! calls in src/variable_rate.jl and aggregators are still valid: SciMLBase v3 keeps u_modified! as a deprecated re-export through DiffEqBase v7, so these generate deprecation warnings but continue to work.

Related

🤖 Generated with Claude Code

- Widen OrdinaryDiffEq compat to include v7 ("6" → "6, 7")
- Widen StochasticDiffEq compat to include v7 ("6.82" → "6.82, 7")
- Apply same widen in docs/Project.toml and docs/src/assets/Project.toml
- Migrate prob_func to 2-arg SciMLBase v3 EnsembleContext signature
  (prob_func(prob, i, repeat) → prob_func(prob, ctx)) in ensemble_uniqueness.jl
  and thread_safety.jl
- Fix length(sol) → length(sol.u) for RAT v4 compatibility in
  ensemble_problems.jl, saveat_regression.jl, thread_safety.jl,
  and variable_rate.jl (length(AbstractVectorOfArray) now returns
  total scalar count rather than trajectory/timestep count)

SciMLBase compat was already "2.115, 3.1" and DiffEqBase was already
"6.192, 7" from prior PRs SciML#579 and SciML#580; no further changes needed there.

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

Hard verification on the v7 ecosystem revealed:
1. `FunctionMap` is no longer in OrdinaryDiffEq's umbrella in v7 — the slim
   default set excludes it. Tests referencing `FunctionMap` (constant_rate.jl,
   ensemble_uniqueness.jl, sir_model.jl, splitcoupled.jl) need explicit
   `using OrdinaryDiffEqFunctionMap`. Added it to [extras]/[compat]/targets.test.
2. Ensemble callback signatures: `prob_func(prob, i, repeat)` →
   `prob_func(prob, ctx)` for SciMLBase v3 EnsembleContext API.
3. RAT v4 fix: `length(sol)` on EnsembleSolution now returns scalar count,
   not trajectory count — replaced with `length(sol.u)` in test assertions.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/JumpProcesses.jl that referenced this pull request Apr 27, 2026
…op pre-v7 ecosystem (v10.0.0)

PR SciML#581's CI surfaced that the partial SciMLBase v3 migration in PR SciML#579
left `SSAIntegrator.u_modified::Bool` named the old way. DiffEqBase v7's
`initialize!(...)` accesses `integrator.derivative_discontinuity` as a
struct field directly (not via a method), so a `getproperty` shim or method
override can't paper over it — hence:

    LoadError: FieldError: type JumpProcesses.SSAIntegrator has no field
               `derivative_discontinuity`, available fields: ..., `u_modified`, ...

This commit finishes the rename:

  • SSAIntegrator field `u_modified` → `derivative_discontinuity`
  • All `integrator.u_modified` reads/writes in SSA_stepper.jl updated
  • Replace `DiffEqBase.u_modified!` method with the canonical
    `SciMLBase.derivative_discontinuity!` method, dropping the
    `@static if isdefined(SciMLBase, :derivative_discontinuity!)` guard
    (no longer needed with SciMLBase v3 lower bound)
  • Internal `u_modified!(integrator, ...)` calls in variable_rate.jl,
    aggregators/coevolve.jl, aggregators/ssajump.jl rewritten to
    `derivative_discontinuity!(integrator, ...)`
  • `using ... u_modified!` → `using SciMLBase: derivative_discontinuity!`

Renaming the field is a breaking ABI change for any code that touched
`integrator.u_modified` directly, so this also drops the pre-v7 ecosystem
support entirely (DiffEqBase v6 callbacks still expect the old field name
and would break if we dragged the v6 lower bound along):

  • DiffEqBase: `"6.192, 7"` → `"7"`
  • OrdinaryDiffEq: `"6, 7"` → `"7"`
  • OrdinaryDiffEqCore: `"3, 4"` → `"4"`
  • OrdinaryDiffEqFunctionMap: `"1, 2"` → `"2"`
  • RecursiveArrayTools: `"3.35, 4"` → `"4"`
  • SciMLBase: `"2.115, 3.1"` → `"3.1"`
  • StochasticDiffEq: `"6.82, 7"` → `"7"`

Bumps version 9.26.0 → 10.0.0. The v9 line stays available for users
still on the OrdinaryDiffEq v6 / SciMLBase v2 era; the patch v9.26.1
(in flight at SciML#583) handles the OrdinaryDiffEqCore lower-bound bug there.

docs/Project.toml and docs/src/assets/Project.toml updated to drop v6
support to match.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas-Claude
Copy link
Copy Markdown
Contributor Author

Pushed a follow-up commit (4dbce91) that finishes the SciMLBase v3 rename properly and bumps this to a breaking v10.0.0.

What the new commit does

  • Field rename: SSAIntegrator.u_modified::BoolSSAIntegrator.derivative_discontinuity::Bool. This is the actual fix for the FunctionWrapper test failure — DiffEqBase v7's initialize! (callbacks.jl:25) accesses integrator.derivative_discontinuity as a field, so a method/getproperty shim can't help. The field has to be renamed.
  • Drop the pre-v7 ecosystem entirely (the question from the dig was whether to keep both — answer was no, renaming forces this anyway since DiffEqBase v6 callbacks read integrator.u_modified directly and would break the moment we rename). Compats:
    • DiffEqBase: "6.192, 7""7"
    • OrdinaryDiffEq: "6, 7""7"
    • OrdinaryDiffEqCore: "3, 4""4"
    • OrdinaryDiffEqFunctionMap: "1, 2""2"
    • RecursiveArrayTools: "3.35, 4""4"
    • SciMLBase: "2.115, 3.1""3.1"
    • StochasticDiffEq: "6.82, 7""7"
  • Version bump 9.26.0 → 10.0.0 (breaking ABI on the integrator struct).
  • Internal DiffEqBase.u_modified! method removed; SciMLBase.derivative_discontinuity!(::SSAIntegrator, ::Bool) replaces it (no more @static if isdefined guard since SciMLBase v3 is now mandatory).
  • Internal u_modified!(integrator, ...) calls in variable_rate.jl, aggregators/coevolve.jl, aggregators/ssajump.jl rewritten to derivative_discontinuity!(integrator, ...). using ... u_modified!using SciMLBase: derivative_discontinuity!.
  • docs/Project.toml and docs/src/assets/Project.toml updated to drop v6 lower bounds.

Companion work

This PR (now → v10) completes the v7-ecosystem migration; the other two clean up the v9 line.

@isaacsas
Copy link
Copy Markdown
Member

V10 also requires merging #570, so if these changes are merged they should not be released at this time as a new release.

@ChrisRackauckas
Copy link
Copy Markdown
Member

This shouldn't require a v10 of JumpProcesses: nothing about the API here is changed? We can just keep a deprecation path for now.

… to v9.27.0

PR SciML#581's CI surfaced that DiffEqBase v7 / SciMLBase v3 callbacks access
`integrator.derivative_discontinuity` as a struct field directly (not via
a method), so the v6-era field name `u_modified` blew up at runtime:

    LoadError: FieldError: type JumpProcesses.SSAIntegrator has no field
               `derivative_discontinuity`, available fields: ..., `u_modified`, ...

Renaming the field would be a breaking ABI change (and would force v7-only
compat, since DiffEqBase v6 callbacks still read `integrator.u_modified`).
Instead, this commit overrides `Base.getproperty` / `Base.setproperty!` /
`Base.propertynames` on `SSAIntegrator` to alias `:derivative_discontinuity`
onto the existing `:u_modified` field. Both names resolve to the same
storage, so v6 and v7 callback code both keep working unchanged.

Internal `u_modified!(integrator, ...)` calls and the
`DiffEqBase.u_modified!` / `SciMLBase.derivative_discontinuity!` method
definitions are left in place — they continue to dispatch correctly under
both ecosystems (the SciMLBase v3 `@deprecate u_modified! → derivative_discontinuity!`
alias is bypassed by JumpProcesses' more specific method).

Also tightens the existing widening from `OrdinaryDiffEqCore = "3, 4"`
to `"3.17, 4"` — the imported `StochasticDiffEqAlgorithm` /
`StochasticDiffEqRODEAlgorithm` symbols only exist from v3.17+, and
allowing v3.0–v3.16 lets the resolver pick a version that breaks the
extension precompile (same root cause being patched on master via SciML#583).

Bumps version 9.26.0 → 9.27.0 (minor, fully backwards compatible).

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas-Claude ChrisRackauckas-Claude force-pushed the bump-ordinarydiffeq-v7-ecosystem branch from 4dbce91 to 0700aa8 Compare April 27, 2026 16:05
@ChrisRackauckas-Claude
Copy link
Copy Markdown
Contributor Author

Reworked the field-rename approach into a non-breaking alias (force-pushed; previous v10 commit dropped). New plan: this PR stays a minor bump → v9.27.0, no API breakage.

What the new commit does

  • Override Base.getproperty / setproperty! / propertynames on SSAIntegrator so :derivative_discontinuity aliases the existing :u_modified field. Both names hit the same underlying storage. v6-era callbacks (which read integrator.u_modified) and v7-era callbacks (which read integrator.derivative_discontinuity) both keep working with no struct rename.
  • Field name unchangedu_modified::Bool stays. No ABI break for any external code that touches the integrator directly.
  • Kept both methods: DiffEqBase.u_modified!(::SSAIntegrator, ::Bool) and the @static if isdefined(SciMLBase, :derivative_discontinuity!)-guarded SciMLBase.derivative_discontinuity!(::SSAIntegrator, ::Bool). The SciMLBase v3 @deprecate u_modified! → derivative_discontinuity! alias is bypassed by JumpProcesses' more specific dispatch, so internal u_modified!(integrator, ...) calls don't trigger deprecation warnings.
  • Tightened the existing widening from OrdinaryDiffEqCore = "3, 4" to "3.17, 4" so the resolver can't pick the broken v3.0–v3.16 versions (same lower-bound fix as Patch v9.26.1: tighten OrdinaryDiffEqCore lower bound to 3.17 #583).
  • Version bump 9.26.0 → 9.27.0 (minor, fully backwards compatible).

Why this works for both ecosystems

DiffEqBase v6 callbacks: integrator.u_modified → hits the real field directly via default getproperty (sym ≠ :derivative_discontinuity).

DiffEqBase v7 callbacks: integrator.derivative_discontinuity → hits the alias branch in our getproperty, returns getfield(integrator, :u_modified).

Same for writes via setproperty!. propertynames reports both for tab-completion / show.

The rest of the PR (compat widening, ensemble prob_func migration, length(sol) fix, OrdinaryDiffEqFunctionMap test dep) is unchanged.

@ChrisRackauckas
Copy link
Copy Markdown
Member

Okay this form is one that I am fine with. There is no breaking update in the source code. But I will note that the tests are using the SciMLBase v3 ensemble code now, so actually on earlier SciMLBase the tests will be broken. I think it will be very good for the ecosystem at least for now to have some backwards compatible versions, so because this is only in the test source code I think it would be good to allow this for now, and then bump the lower bound later. This should unblock a whole lot and the tests confirm the actual source code is good so I think it's best to make that judgement call there.

@ChrisRackauckas ChrisRackauckas merged commit 20271f4 into SciML:master Apr 28, 2026
11 of 12 checks passed
@ChrisRackauckas
Copy link
Copy Markdown
Member

@isaacsas on the v10 I assume you'll just want to drop the backwards compat path and just use the new derivative_discontinuity naming?

@isaacsas
Copy link
Copy Markdown
Member

Yes, V10 will be SciMLBase 3 only as it makes changes to rng handling that would be unsafe prior to v3.

@isaacsas
Copy link
Copy Markdown
Member

You can see the PR for what is changing here -- I just need to update it to master and check everything is passing. I think it should otherwise be good to go, but I won't have time to play with it and give it a last review for a few weeks.

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