Skip to content

Commit ed632e3

Browse files
Narrow range expansion to !isadaptive(alg) and non-CompositeAlgorithm
Two more CI regressions surfaced: 1. `composite_algorithm_test.jl` \"Mixed adaptivity\": the test asserts bit-exact `sol3.u == sol4.u` between two CompositeAlgorithms that differ only in sub-alg ordering plus a swapped choice function. With `dt=0.05, adaptive=false`, accumulated drift previously kept `t < 0.5` throughout the pre-switch phase; range tstops instead land exactly on `t = 0.5`, which the two choice functions discriminate differently (`t < 0.5` vs `t > 0.5`), routing the two composites through different sub-algorithms at the boundary. Skip composite algorithms. 2. `OrdinaryDiffEqLowStorageRK` RDPK3SpFSAL510 convergence: for adaptive algorithms run with `adaptive=false` (what `DiffEqDevTools.test_convergence` does), landing exactly on every range tstop changes the per-step error enough to push the fitted convergence order from 5.05 (master) to 5.30 — outside the ±0.25 tolerance. Restricting the expansion to `!isadaptive(alg)` leaves adaptive-with-adaptive=false solvers on the prior code path. The PositiveIntegrators.jl bug case (`Euler`) still fires because `isadaptive(Euler()) == false`. Verified locally: Euler bug produces 11 steps, composite test passes, RDPK3 order back to 5.048, `tspan=(0,Inf)` + `set_proposed_dt!` cases still work. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
1 parent 615ebb2 commit ed632e3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/OrdinaryDiffEqCore/src/solve.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,9 @@ function _ode_init(
411411
# d_discontinuities, or callbacks (which may mutate dt at runtime via
412412
# `set_proposed_dt!`) to preserve existing "step at dtcache" semantics,
413413
# and when tspan has non-finite endpoints.
414-
if !isnothing(dt) && !iszero(dt) && (!isadaptive(_alg) || !adaptive) &&
415-
isdtchangeable(_alg) && sign(dt) == tdir &&
414+
if !isnothing(dt) && !iszero(dt) && !isadaptive(_alg) &&
415+
isdtchangeable(_alg) && !(_alg isa CompositeAlgorithm) &&
416+
sign(dt) == tdir &&
416417
isempty(tstops) && isempty(d_discontinuities) &&
417418
callback === nothing && all(isfinite, tspan)
418419
tstops = ((tspan[1] + dt):dt:tspan[end]...,)

0 commit comments

Comments
 (0)