Repository navigation
Raise OrdinaryDiffEqDefault DiffEqBase floor to 7.15 - #4274
Merged
ChrisRackauckas merged 1 commit intoAug 20, 2026
Merged
ChrisRackauckas merged 1 commit into
ChrisRackauckas merged 1 commit into
Conversation
OrdinaryDiffEqDefault relies on DiffEqBase calling `prepare_alg(nothing, ...)` so the default algorithm gets the same `prepare_alg` pass (sparse AD from `jac_prototype`, etc.) as an explicitly passed algorithm. That hook exists since DiffEqBase 7.15.0; with 7.14.0 the default is solved unprepared and its stats no longer match `AutoTsit5(FBDF(...))` in the downgrade CI. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
ChrisRackauckas-Claude
force-pushed
the
fix-default-diffeqbase-floor
branch
from
August 20, 2026 17:50
63f64d7 to
a8de9eb
Compare
ChrisRackauckas
marked this pull request as ready for review
August 20, 2026 18:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ignore until reviewed by @ChrisRackauckas.
What changed and why
Raise the
DiffEqBasecompat floor oflib/OrdinaryDiffEqDefaultfrom7.14to7.15.Since #4241 (
27faa3ad3), OrdinaryDiffEqDefault definesDiffEqBase.prepare_alg(::Nothing, u0, p, ::ODEProblem) = DefaultODEAlgorithm(autodiff = AutoFiniteDiff())and relies on DiffEqBase'ssolve_up/init_upcallingprepare_alg(nothing, ...)first and then running the normalprepare_algpass on the returned algorithm. That hook shipped in DiffEqBase 7.15.0 (tagged at50d228361), but the OrdinaryDiffEqDefault floor stayed at 7.14. With DiffEqBase 7.14.0 thesolve(prob)path goes through theSciMLBase.__solve(prob, ::Nothing)fallback, which buildsDefaultODEAlgorithm(autodiff = AutoFiniteDiff())and never callsprepare_alg, so the default'sFBDFkeeps a plainAutoFiniteDiff(dense finite-difference Jacobian) while an explicitly passedFBDF(autodiff = AutoFiniteDiff())getsprepare_user_sparsityapplied and becomesAutoSparse{AutoFiniteDiff, KnownJacobianSparsityDetector, GreedyColoringAlgorithm}from the problem'sjac_prototype. The two solves then take different step/f-eval counts and the "extended Robertson"n = 100assertions indefault_solver_tests.jl:106-107fail.This is what makes
downgrade-sublibraries / test (lib/OrdinaryDiffEqDefault)red on master (e.g. https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/31881306107, https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/31840134545, and identically on #4272). #4271 raised the LinearSolve floor for an unrelated resolution failure and did not touch this.History: the Default downgrade job first went red on
4356f2210(https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/31256852719, 2026-08-08 12:16 UTC); the previous run7b1ad0368(https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/31253935515, 11:06 UTC) was green. The only package version that differs between those two job logs is FiniteDiff 2.32.1 -> 2.33.0 (released 2026-08-08 12:25 UTC, JuliaDiff/FiniteDiff.jl#230, JVP step rescaling). The sparse-AD Jacobian path (AutoSparse{AutoFiniteDiff}via DifferentiationInterface) usesfinite_difference_jvpand changed with FiniteDiff 2.33.0, while the unprepared dense-AutoFiniteDiffpath did not, so the two solves stopped agreeing. Since #4241 the default is prepared too (both sides now agree with current deps), but only when DiffEqBase >= 7.15 is loaded, hence the floor.Verification
Reproduced the CI procedure locally on Julia 1.11.9 by running
julia-actions/julia-downgrade-compat@v2'sdowngrade.jlonlib/OrdinaryDiffEqDefaultwith the same effective skip list asSciML/.github/.github/workflows/sublibrary-downgrade.yml@v1(stdlibs + alllib/*names +Pkg,TOML,Statistics,LinearAlgebra,SparseArrays,InteractiveUtils,OrdinaryDiffEqCore,OrdinaryDiffEqNonlinearSolve,OrdinaryDiffEqDifferentiation), thenGROUP=Core julia --project -e 'using Pkg; Pkg.test()'.Resolved versions in that env (unchanged by this PR except DiffEqBase): FiniteDiff 2.33.0, LinearSolve 5.2.0, OrdinaryDiffEqBDF 2.0.0, OrdinaryDiffEqCore 4.12.0, OrdinaryDiffEqDifferentiation 3.7.0, OrdinaryDiffEqNonlinearSolve 2.8.0, OrdinaryDiffEqTsit5 2.0.0, OrdinaryDiffEqVerner 2.0.0, OrdinaryDiffEqRosenbrock 2.6.1, SciMLBase 3.46.0, ADTypes 1.22.0, DiffEqBase 7.14.0 (before) / 7.15.0 (after).
Before (master, DiffEqBase 7.14.0):
After (this branch, DiffEqBase 7.15.0):
Diagnostic script in the failing env (extended Robertson block, printing the algorithm actually used):
Same script with current registry versions (OrdinaryDiffEqBDF 2.4.2, OrdinaryDiffEqCore 4.14.3, DiffEqBase 7.15.0, FiniteDiff 2.33.0): both
n=100solves givenaccept=54 nf=241.typos lib/OrdinaryDiffEqDefault/Project.toml: clean. Runic not applicable (TOML-only diff).Not verified
Coregroup oflib/OrdinaryDiffEqDefaultwas run in the downgraded env; QA/GPU groups and other sublibraries' downgrade jobs were not run locally.Alternative a reviewer may prefer
Instead of (or in addition to) the floor,
SciMLBase.__solve/__init(prob::ODEProblem, ::Nothing)inlib/OrdinaryDiffEqDefault/src/default_alg.jlcould callDiffEqBase.prepare_algon theDefaultODEAlgorithmit constructs so the default is prepared even under DiffEqBase < 7.15. I kept this PR to the compat floor since that fallback is unreachable fromsolve(prob)once DiffEqBase >= 7.15 is loaded.