Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
154ada9
Strip OrdinaryDiffEq v7 down to minimal re-export shell
ChrisRackauckas Mar 26, 2026
1803e58
Remove remaining deprecations from StochasticDiffEqCore, DelayDiffEq,…
ChrisRackauckas Mar 27, 2026
a13e68e
Remove deprecated autodiff::Bool compatibility shims for v7
ChrisRackauckas Mar 26, 2026
1bf706c
Replace legacy controller with new types and remove the controller fi…
termi-official Feb 7, 2026
957159d
Add DummyController back
termi-official Feb 7, 2026
c56a3ec
Remove more leftovers and recover default alg
termi-official Feb 7, 2026
267029d
Purge qmin from init
termi-official Feb 7, 2026
865892e
Faulty default dispatch
termi-official Feb 7, 2026
f3c745a
More faulty default dispatches
termi-official Feb 7, 2026
00507ff
Fix some missing dispatches and add an abstraction layer for the cont…
termi-official Feb 7, 2026
696ddd8
Restore old controller constructors.
termi-official Feb 7, 2026
a8ef5f0
Fix extrapolation controller
termi-official Feb 7, 2026
6d7e95a
Unpack controller correctly
termi-official Feb 7, 2026
dd3c828
Fix faulty sync
termi-official Feb 7, 2026
07aa780
Add back more missing dispatches on Extrapolation
termi-official Feb 7, 2026
f6d7e75
Hotfix downstream Core 3.4 export types.
termi-official Feb 7, 2026
72c0a75
Add missing controller ctor
termi-official Feb 8, 2026
aa43884
Fix downstream default_controller dispatch
termi-official Feb 8, 2026
c367e55
Try to fix downstream again.
termi-official Feb 8, 2026
c66f709
Fix reinit with dummy controller
termi-official Feb 9, 2026
affc840
Fix interaction between BDF and Default algorithm
termi-official Feb 9, 2026
c7f4844
Restore Aitken-Neville function
termi-official Feb 9, 2026
5a1c2b7
Format
termi-official Feb 9, 2026
ea7c273
Disambiguiate DFBDF signatures
termi-official Feb 9, 2026
d0b80f5
Disambiguiate controller signatures for composites
termi-official Feb 9, 2026
63bacf4
Make default type of predictive controller real not rational.
termi-official Feb 9, 2026
9e3e520
Purge controller symbol from algs
termi-official Feb 11, 2026
4f87e60
Remove extra reinit from tests
termi-official Feb 11, 2026
dd31190
Try to fix default
termi-official Feb 11, 2026
b924cea
Fix accept dispatches
termi-official Feb 11, 2026
b92337c
Make DefaultAlg use PIController
termi-official Feb 11, 2026
877c4f4
Extend inference test
termi-official Feb 11, 2026
09d23f3
Fix accept dispatch for DAE solver
termi-official Feb 11, 2026
e54cdf0
Revert inference tests
termi-official Feb 11, 2026
7ee613c
Add Enzyme regression payload.
termi-official Feb 11, 2026
fd2293c
Runic
termi-official Feb 11, 2026
489c88b
Revert BDF changes
termi-official Feb 11, 2026
6fda317
Remove atmp and q from controller cache
termi-official Feb 11, 2026
3f1b9b2
Missing dispatches for reinit when the algcache also holds the contro…
termi-official Feb 11, 2026
141bdb1
Update SERK2 dispatch
termi-official Feb 11, 2026
0af23aa
Remove debris.
termi-official Feb 11, 2026
8e6e6de
Disambiguiate
termi-official Feb 11, 2026
01caac2
Update default_controller signature in sublibs
termi-official Feb 11, 2026
55d3c22
Fix IController type
termi-official Feb 11, 2026
081dd3e
Fix faulty sync
termi-official Feb 11, 2026
0b3611e
Fix faulty PID ctor
termi-official Feb 11, 2026
2c91b1d
Restore old state for default alg
termi-official Feb 11, 2026
d913932
Fix PID controller
termi-official Feb 11, 2026
787231c
Add more inference regression tests
termi-official Feb 11, 2026
fc43437
Format
termi-official Feb 11, 2026
2ba7750
Test is not broken anymore.
termi-official Feb 12, 2026
30c1b9f
Test still broken on 1.10
termi-official Feb 12, 2026
38e168b
Format
termi-official Feb 12, 2026
56470fa
Improve inferrence coverage
termi-official Feb 12, 2026
f24a09a
Format
termi-official Feb 12, 2026
adee3c4
Tweak AD tests
termi-official Feb 12, 2026
5d2bd32
Typo
termi-official Feb 12, 2026
9c5da02
Typo
termi-official Feb 12, 2026
b4ecdc8
Qmax function
termi-official Feb 24, 2026
3e62881
Update test to new API
termi-official Feb 24, 2026
3de397f
Remove faulty controller
termi-official Apr 1, 2026
e25ae35
Typo?
termi-official Apr 1, 2026
5be5aad
Remove more leftovers and recover default alg
termi-official Feb 7, 2026
49203ac
Fix some missing dispatches and add an abstraction layer for the cont…
termi-official Feb 7, 2026
56d69ce
Restore old controller constructors.
termi-official Feb 7, 2026
5645ce0
Unpack controller correctly
termi-official Feb 7, 2026
bb1459f
Hotfix downstream Core 3.4 export types.
termi-official Feb 7, 2026
1d801e4
Fix downstream default_controller dispatch
termi-official Feb 8, 2026
df7f560
Try to fix downstream again.
termi-official Feb 8, 2026
0bfc3a6
Fix interaction between BDF and Default algorithm
termi-official Feb 9, 2026
e1ae8e4
Restore Aitken-Neville function
termi-official Feb 9, 2026
7bcd257
Format
termi-official Feb 9, 2026
69909ac
Disambiguiate controller signatures for composites
termi-official Feb 9, 2026
e7fc543
Purge controller symbol from algs
termi-official Feb 11, 2026
aa6a4c3
Try to fix default
termi-official Feb 11, 2026
e5039cb
Make DefaultAlg use PIController
termi-official Feb 11, 2026
e3c34d2
Revert inference tests
termi-official Feb 11, 2026
bb6d28d
Revert BDF changes
termi-official Feb 11, 2026
b385677
Remove atmp and q from controller cache
termi-official Feb 11, 2026
04070c8
Update default_controller signature in sublibs
termi-official Feb 11, 2026
3689454
Add more inference regression tests
termi-official Feb 11, 2026
9c27a65
Format
termi-official Feb 11, 2026
fe17f17
Improve inferrence coverage
termi-official Feb 12, 2026
9a1b824
Fix faulty rebase of some Project files
termi-official Apr 10, 2026
1f18dc7
Leaping new controller interface
termi-official Apr 10, 2026
5c4a085
Fix faulty constructor call
termi-official Apr 10, 2026
7822574
Fix Taylor solver
termi-official Apr 10, 2026
e770f38
Fix max_order passing
termi-official Apr 10, 2026
64344b9
Fix AD CI
termi-official Apr 10, 2026
e0d6877
Fix faulty PID controller ctor
termi-official Apr 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions lib/ImplicitDiscreteSolve/src/ImplicitDiscreteSolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ import OrdinaryDiffEqCore: OrdinaryDiffEqAlgorithm, alg_cache, OrdinaryDiffEqMut
alg_order, beta2_default, beta1_default, dt_required,
_initialize_dae!, DefaultInit, BrownFullBasicInit, OverrideInit,
@muladd, @.., _unwrap_val, OrdinaryDiffEqCore, isadaptive,
AbstractController

@static if Base.pkgversion(OrdinaryDiffEqCore) >= v"3.4"
@eval begin
import OrdinaryDiffEqCore: AbstractControllerCache
end
end
AbstractController, AbstractControllerCache

using Reexport
@reexport using SciMLBase
Expand Down
172 changes: 56 additions & 116 deletions lib/ImplicitDiscreteSolve/src/controller.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,133 +36,73 @@ Base.@kwdef struct KantorovichTypeController{T} <: AbstractController
strict::Bool = true
end

@static if Base.pkgversion(OrdinaryDiffEqCore) >= v"3.4"
@eval begin
mutable struct KantorovichTypeControllerCache{T} <: AbstractControllerCache
controller::KantorovichTypeController{T}
# Proposed scaling factor for the time step length
q::T
end
struct KantorovichTypeControllerCache{T} <: AbstractControllerCache
controller::KantorovichTypeController{T}
end

function OrdinaryDiffEqCore.default_controller_v7(
QT, alg::IDSolve,
)
return KantorovichTypeController{QT}(; Θmin = QT(1 // 8), p = 1)
end
function OrdinaryDiffEqCore.default_controller(
QT, alg::IDSolve,
)
return KantorovichTypeController{QT}(; Θmin = QT(1 // 8), p = 1)
end

function OrdinaryDiffEqCore.setup_controller_cache(alg, atmp, controller::KantorovichTypeController{T}) where {T}
return KantorovichTypeControllerCache(
controller,
T(1),
)
end
function OrdinaryDiffEqCore.setup_controller_cache(alg, cache, controller::KantorovichTypeController{T}) where {T}
return KantorovichTypeControllerCache(
controller,
)
end

function OrdinaryDiffEqCore.stepsize_controller!(
integrator, cache::KantorovichTypeControllerCache, alg::IDSolve
)
(; controller) = cache
@inline g(x) = √(1 + 4x) - 1
function OrdinaryDiffEqCore.stepsize_controller!(
integrator, cache::KantorovichTypeControllerCache, alg::IDSolve
)
(; controller) = cache
@inline g(x) = √(1 + 4x) - 1

# Adapt dt with a priori estimate (Eq. 5.24)
(; Θks) = integrator.cache
(; Θbar, γ, Θmin, qmin, qmax, p) = controller
# Adapt dt with a priori estimate (Eq. 5.24)
(; Θks) = integrator.cache
(; Θbar, γ, Θmin, qmin, qmax, p) = controller

Θ₀ = length(Θks) > 0 ? max(first(Θks), Θmin) : Θmin
cache.q = clamp(γ * (g(Θbar) / (g(Θ₀)))^(1 / p), qmin, qmax)
Θ₀ = length(Θks) > 0 ? max(first(Θks), Θmin) : Θmin
q = clamp(γ * (g(Θbar) / (g(Θ₀)))^(1 / p), qmin, qmax)

return cache.q
end
return q
end

function OrdinaryDiffEqCore.step_accept_controller!(
integrator, cache::KantorovichTypeControllerCache, alg::IDSolve, q
)
@assert q ≈ cache.q "Controller cache went out of sync with time stepping logic."
return cache.q * integrator.dt
end
function OrdinaryDiffEqCore.step_accept_controller!(
integrator, cache::KantorovichTypeControllerCache, alg::IDSolve, q
)
return q * integrator.dt
end

function OrdinaryDiffEqCore.step_reject_controller!(
integrator, cache::KantorovichTypeControllerCache, alg::IDSolve
)
(; controller) = cache
@inline g(x) = √(1 + 4x) - 1

# Shorten dt according to (Eq. 5.24)
(; Θks) = integrator.cache
(; Θbar, Θreject, γ, Θmin, qmin, qmax, p) = controller
for Θk in Θks
if Θk > Θreject
q = clamp(γ * (g(Θbar) / g(Θk))^(1 / p), qmin, qmax)
integrator.dt = q * integrator.dt
return
end
end
function OrdinaryDiffEqCore.step_reject_controller!(
integrator, cache::KantorovichTypeControllerCache, alg::IDSolve
)
(; controller) = cache
@inline g(x) = √(1 + 4x) - 1

# Shorten dt according to (Eq. 5.24)
(; Θks) = integrator.cache
(; Θbar, Θreject, γ, Θmin, qmin, qmax, p) = controller
for Θk in Θks
if Θk > Θreject
q = clamp(γ * (g(Θbar) / g(Θk))^(1 / p), qmin, qmax)
integrator.dt = q * integrator.dt
return
end

function OrdinaryDiffEqCore.accept_step_controller(integrator, cache::KantorovichTypeControllerCache)
(; controller) = cache
(; Θks) = integrator.cache
if controller.strict
return all(controller.Θreject .< Θks)
else
return true
end
end
end
else
@eval begin
function OrdinaryDiffEqCore.default_controller(
alg::IDSolve, cache::IDSolveCache, _1, _2, _3
)
return KantorovichTypeController(; Θmin = float(1 // 8), p = 1)
end

function OrdinaryDiffEqCore.stepsize_controller!(
integrator, controller::KantorovichTypeController, alg::IDSolve
)
@inline g(x) = √(1 + 4x) - 1

# Adapt dt with a priori estimate (Eq. 5.24)
(; Θks) = integrator.cache
(; Θbar, γ, Θmin, qmin, qmax, p) = controller

Θ₀ = length(Θks) > 0 ? max(first(Θks), Θmin) : Θmin
q = clamp(γ * (g(Θbar) / (g(Θ₀)))^(1 / p), qmin, qmax)

return q
end

function OrdinaryDiffEqCore.step_accept_controller!(
integrator, controller::KantorovichTypeController, alg::IDSolve, q
)
return q * integrator.dt
end

function OrdinaryDiffEqCore.step_reject_controller!(
integrator, controller::KantorovichTypeController, alg::IDSolve
)
@inline g(x) = √(1 + 4x) - 1

# Shorten dt according to (Eq. 5.24)
(; Θks) = integrator.cache
(; Θbar, Θreject, γ, Θmin, qmin, qmax, p) = controller
for Θk in Θks
if Θk > Θreject
q = clamp(γ * (g(Θbar) / g(Θk))^(1 / p), qmin, qmax)
integrator.dt = q * integrator.dt
return
end
end
return
end
return
end

function OrdinaryDiffEqCore.accept_step_controller(integrator, controller::KantorovichTypeController)
(; Θks) = integrator.cache
if controller.strict
return all(controller.Θreject .< Θks)
else
return true
end
end
function OrdinaryDiffEqCore.accept_step_controller(integrator, cache::KantorovichTypeControllerCache, alg)
(; controller) = cache
(; Θks) = integrator.cache
if controller.strict
return all(controller.Θreject .< Θks)
else
return true
end
end

function OrdinaryDiffEqCore.sync_controllers!(cache1::KantorovichTypeControllerCache, cache2::KantorovichTypeControllerCache)
return nothing
end
14 changes: 2 additions & 12 deletions lib/OrdinaryDiffEqBDF/src/OrdinaryDiffEqBDF.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module OrdinaryDiffEqBDF
import OrdinaryDiffEqCore: alg_order, calculate_residuals!,
initialize!, perform_step!, unwrap_alg,
calculate_residuals, alg_extrapolates,
OrdinaryDiffEqAlgorithm,
OrdinaryDiffEqAlgorithm, isstandard,
OrdinaryDiffEqMutableCache, OrdinaryDiffEqConstantCache,
OrdinaryDiffEqNewtonAdaptiveAlgorithm,
OrdinaryDiffEqNewtonAlgorithm,
Expand Down Expand Up @@ -35,17 +35,7 @@ using LinearAlgebra: mul!, I
import ArrayInterface
using ArrayInterface: ismutable
import OrdinaryDiffEqCore

@static if Base.pkgversion(OrdinaryDiffEqCore) >= v"3.4"
@eval begin
import OrdinaryDiffEqCore: default_controller_v7,
legacy_default_controller
end
else
@eval begin
import OrdinaryDiffEqCore: default_controller
end
end
import OrdinaryDiffEqCore: default_controller

@static if Base.pkgversion(OrdinaryDiffEqCore) >= v"3.10"
@eval begin
Expand Down
6 changes: 6 additions & 0 deletions lib/OrdinaryDiffEqBDF/src/alg_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ isadaptive(alg::DFBDF) = true

has_special_newton_error(alg::QNDF) = true

isstandard(::DImplicitEuler) = true
isstandard(::ABDF2) = true
isstandard(::QNDF1) = true
isstandard(::QNDF2) = true
isstandard(::DABDF2) = true

alg_extrapolates(alg::DImplicitEuler) = true
alg_extrapolates(alg::DABDF2) = true

Expand Down
Loading
Loading