Bug Description
The entire RDPK3 solver family (RDPK3Sp35, RDPK3SpFSAL35, RDPK3Sp49, RDPK3SpFSAL49, RDPK3Sp510, RDPK3SpFSAL510) crashes during init with a MethodError when constructing the PIDController.
Minimal Reproducer
using OrdinaryDiffEqLowStorageRK
function f!(du, u, p, t)
du[1] = -0.5 * u[1]
du[2] = -1.5 * u[2]
end
prob = ODEProblem(f!, [1.0, 1.0], (0.0, 1.0))
integrator = init(prob, RDPK3Sp35(), dt = 0.1)
Error
MethodError: no method matching MVector{3, Float64}(::Bool, ::Bool, ::Bool)
Root Cause
In OrdinaryDiffEqCore/src/integrators/controllers.jl, the PIDController constructor initializes the error history vector with Bool literals:
# Line 550
err = MVector{3, QT}(true, true, true)
When QT = Float64, newer versions of StaticArrays no longer accept Bool arguments for MVector{3, Float64}. The true literals are Bool, not Float64.
Affected Solvers
All 6 RDPK3 solvers use legacy_default_controller / default_controller which calls PIDController with RDPK3-specific beta coefficients, all hitting this code path:
RDPK3Sp35
RDPK3SpFSAL35
RDPK3Sp49
RDPK3SpFSAL49
RDPK3Sp510
RDPK3SpFSAL510
Proposed Fix
Change line 550 in OrdinaryDiffEqCore/src/integrators/controllers.jl from:
err = MVector{3, QT}(true, true, true)
to:
err = MVector{3, QT}(one(QT), one(QT), one(QT))
This uses one(QT) which is always type-correct (returns 1.0 for Float64, etc.) instead of relying on implicit Bool → QT conversion.
Discovery
Found while adding AllocCheck.jl allocation tests for OrdinaryDiffEqLowStorageRK. All 39 other low-storage RK solvers pass their allocation tests fine; only the RDPK3 family is excluded due to this crash.
Bug Description
The entire RDPK3 solver family (
RDPK3Sp35,RDPK3SpFSAL35,RDPK3Sp49,RDPK3SpFSAL49,RDPK3Sp510,RDPK3SpFSAL510) crashes duringinitwith aMethodErrorwhen constructing thePIDController.Minimal Reproducer
Error
Root Cause
In
OrdinaryDiffEqCore/src/integrators/controllers.jl, thePIDControllerconstructor initializes the error history vector withBoolliterals:When
QT = Float64, newer versions of StaticArrays no longer acceptBoolarguments forMVector{3, Float64}. Thetrueliterals areBool, notFloat64.Affected Solvers
All 6 RDPK3 solvers use
legacy_default_controller/default_controllerwhich callsPIDControllerwith RDPK3-specific beta coefficients, all hitting this code path:RDPK3Sp35RDPK3SpFSAL35RDPK3Sp49RDPK3SpFSAL49RDPK3Sp510RDPK3SpFSAL510Proposed Fix
Change line 550 in
OrdinaryDiffEqCore/src/integrators/controllers.jlfrom:to:
This uses
one(QT)which is always type-correct (returns1.0forFloat64, etc.) instead of relying on implicitBool → QTconversion.Discovery
Found while adding
AllocCheck.jlallocation tests forOrdinaryDiffEqLowStorageRK. All 39 other low-storage RK solvers pass their allocation tests fine; only the RDPK3 family is excluded due to this crash.