Bump compat for OrdinaryDiffEq v7 / StochasticDiffEq v7 ecosystem#581
Conversation
- 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>
…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>
|
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
Companion work
This PR (now → v10) completes the v7-ecosystem migration; the other two clean up the v9 line. |
|
V10 also requires merging #570, so if these changes are merged they should not be released at this time as a new release. |
|
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>
4dbce91 to
0700aa8
Compare
|
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
Why this works for both ecosystemsDiffEqBase v6 callbacks: DiffEqBase v7 callbacks: Same for writes via The rest of the PR (compat widening, ensemble |
|
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. |
|
@isaacsas on the v10 I assume you'll just want to drop the backwards compat path and just use the new derivative_discontinuity naming? |
|
Yes, V10 will be SciMLBase 3 only as it makes changes to rng handling that would be unsafe prior to v3. |
|
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. |
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
OrdinaryDiffEq:"6"→"6, 7"(main, docs, docs/src/assets Project.toml)StochasticDiffEq:"6.82"→"6.82, 7"(same files)SciMLBasewas already"2.115, 3.1"andDiffEqBasewas already"6.192, 7"from PRs Prepare source for SciMLBase v3 and widen compat #579 and Bump DiffEqBase / OrdinaryDiffEq / OrdinaryDiffEqCore compat to include v7/v4 #580; no changes needed.Source / test migrations
prob_funcsignature (SciMLBase v3 breaking change): The old 3-argprob_func(prob, i, repeat)is gone in SciMLBase v3.6.0, which callsprob_func(prob, ctx)wherectxis anEnsembleContext. Updated intest/ensemble_uniqueness.jlandtest/thread_safety.jl.length(sol)(RecursiveArrayTools v4 breaking change):length(AbstractVectorOfArray)now returns total scalar element count (sizeproduct), not the number of trajectories/timesteps.length(sol.u)is unambiguous. Fixed intest/ensemble_problems.jl,test/saveat_regression.jl,test/thread_safety.jl, andtest/variable_rate.jl.No source changes needed
src/SSA_stepper.jlalready handlesu_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 insrc/variable_rate.jland aggregators are still valid: SciMLBase v3 keepsu_modified!as a deprecated re-export through DiffEqBase v7, so these generate deprecation warnings but continue to work.Related
🤖 Generated with Claude Code