Skip to content

Support SciMLBase v3: rename u_modified! → derivative_discontinuity!#300

Merged
ChrisRackauckas merged 4 commits intoSciML:masterfrom
ChrisRackauckas-Claude:sciml-base-v3-compat
Apr 13, 2026
Merged

Support SciMLBase v3: rename u_modified! → derivative_discontinuity!#300
ChrisRackauckas merged 4 commits intoSciML:masterfrom
ChrisRackauckas-Claude:sciml-base-v3-compat

Conversation

@ChrisRackauckas-Claude
Copy link
Copy Markdown
Contributor

Summary

  • Extend SciMLBase compat to "2.54, 3.1" and bump DiffEqCallbacks to 4.14.0.
  • Rename u_modified!derivative_discontinuity! across all 13 callback source files, the reexport in src/DiffEqCallbacks.jl, and test/preset_time.jl. u_modified! is @deprecate'd in SciMLBase v3 (src/integrator_interface.jl:242), so the previous name technically still works but emits a deprecation warning at every call site.

Closes the intent of #299 (the dependabot compat bump), but does the rename work on top rather than only touching Project.toml.

Known limitation — please read before merging

Local Pkg.resolve() fails on any environment that contains SciMLBase 3.1, because SciMLBase 3.1 pins RecursiveArrayTools = 4 while OrdinaryDiffEq / OrdinaryDiffEqVerner in the registry still pin RecursiveArrayTools ≤ 3.54. The CI on this PR will reproduce the same unsatisfiable resolution until upstream OrdinaryDiffEq* packages release RAT-v4-compatible versions.

That means:

  • I have not been able to run tests locally. Per our usual rule of not claiming something works without running it, this PR should be treated as unverified until CI goes green.
  • CI is expected to fail at the Pkg.add / instantiate step with an Unsatisfiable requirements detected for package RecursiveArrayTools error, not at Julia runtime. Once OrdinaryDiffEq releases the RAT-v4 bump, re-running CI here should succeed without further edits.

What is NOT in this PR

  • sol[end] references in README.md:63 and docs/src/projection.md:51 are left alone. I could not verify in the SciMLBase v3.1 source that scalar integer indexing on AbstractTimeseriesSolution actually changed behavior (no explicit Base.getindex(::AbstractTimeseriesSolution, ::Int) override is present), so rewriting docs based on an unverified claim would be premature.

Test plan

  • CI passes once OrdinaryDiffEq releases a RAT-v4-compatible version.
  • Verify that existing callback test suite (test/preset_time.jl in particular, which was renamed too) still exercises the same code path under SciMLBase v3 without deprecation warnings.
  • If any test fails at Julia runtime (not at Pkg.add), triage before merging.

🤖 Generated with Claude Code

ChrisRackauckas and others added 2 commits April 12, 2026 23:30
SciMLBase v3 deprecates `u_modified!` in favor of `derivative_discontinuity!`
(SciMLBase src/integrator_interface.jl:242 `@deprecate`). This renames all
13 callback call sites to the new name and extends SciMLBase compat to v3.1.

Note: local test runs fail at Pkg resolution because OrdinaryDiffEq* still
pins RecursiveArrayTools ≤ 3.54, which conflicts with SciMLBase 3.1's RAT
v4 requirement. This PR is therefore intended to be merged after upstream
OrdinaryDiffEq packages release RAT-v4-compatible versions; CI on this PR
is the only venue where the combined environment can be exercised.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
SciMLBase v3 changes `sol[end]` on non-scalar ODEs to return the last
scalar of the flat representation (`sol.u[end][end]`) rather than the
final state vector. The manifold-projection examples index into the
returned state vector with `[1]` and `[2]`, which only works against the
state vector — use `sol.u[end]` explicitly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
ChrisRackauckas and others added 2 commits April 13, 2026 03:38
Rather than hard-bumping the SciMLBase compat minimum to v3, use an
`@static if isdefined(SciMLBase, :derivative_discontinuity!)` guard that
aliases to `u_modified!` when running against SciMLBase v2. This lets
DiffEqCallbacks continue supporting v2 downstream packages while the
ecosystem migrates.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas ChrisRackauckas merged commit de819a6 into SciML:master Apr 13, 2026
21 of 31 checks passed
@ChrisRackauckas-Claude
Copy link
Copy Markdown
Contributor Author

cc @ChrisRackauckas

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