From 3b78f06b1708271ce4e2f025d4c551adb0b88d67 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Sat, 20 Jun 2026 07:56:54 -0400 Subject: [PATCH] Fix mass-matrix Rosenbrock test and raise downgrade compat floors The CPU/JLArrays/OpenCL/QA test groups all errored on the first test, test/gpu_kernel_de/stiff_ode/gpu_ode_mass_matrix.jl, with a `Cannot convert StaticWOperator{Float64} to StaticWOperator{Float32}` MethodError. The reference CPU bench solve used `dt = 0.1` (Float64) on an otherwise all-Float32 problem (u0, p, tspan, tolerances are Float32, and the GPU solve already uses `dt = 0.1f0`). OrdinaryDiffEqRosenbrock's JacReuseState types its `cached_W` slot from the state eltype (Float32), but with a Float64 dt `calc_W` builds a Float64 StaticWOperator that cannot be stored, erroring at OrdinaryDiffEqDifferentiation derivative_utils.jl:922 (`jac_reuse.cached_W = W`). Use a type-consistent `dt = 0.1f0` for the bench solve; the GPU-vs-reference tolerance assertions are unchanged. Verified locally on Julia 1.12 with GROUP=CPU: the mass-matrix safetestset passes 2/2. Also raise three compat floors so the Downgrade job can get past the ModelingToolkit unsatisfiability it currently hits (StaticArrays was pinned to its 1.9 floor at downgrade, which forced MTK below v11 while the test pins MTK >= 11.17): - StaticArrays 1.9 -> 1.9.14 (MTK 10.18-11 needs StaticArrays >= 1.9.14) - SciMLBase 3 -> 3.1 (lowest MTK compatible with SciMLBase 3 is 11.22; JumpProcesses 9.25.1+ needs SciMLBase >= 3.1.0, excluding 3.0.0) - ModelingToolkit 11.17.0 -> 11.23.0 (test; lowest MTK consistent with the SciMLBase 3.1 and OrdinaryDiffEqRosenbrock 2 floors) Verified the floor set resolves on Julia 1.10 (SciMLBase 3.1.0 / MTK 11.23.0 / StaticArrays 1.9.14 / OrdinaryDiffEqRosenbrock 2.0.0) and that normal latest-version resolution is unaffected (SciMLBase 3.21, MTK 11.28, StaticArrays 1.9.18). The Downgrade job may still hit the pre-existing, maintainer-noted ForwardDiff/LogExpFunctions strict-floor wall, which is an upstream issue tracked separately. Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.8 (1M context) --- Project.toml | 4 ++-- test/Project.toml | 6 +++--- test/gpu_kernel_de/stiff_ode/gpu_ode_mass_matrix.jl | 5 ++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Project.toml b/Project.toml index c39dee1c..d4be4163 100644 --- a/Project.toml +++ b/Project.toml @@ -59,11 +59,11 @@ MuladdMacro = "0.2" OpenCL = "0.10" Parameters = "0.12, 0.13" RecursiveArrayTools = "4" -SciMLBase = "3" +SciMLBase = "3.1" Setfield = "1" SimpleDiffEq = "1.11" SimpleNonlinearSolve = "2" -StaticArrays = "1.9" +StaticArrays = "1.9.14" TOML = "1" ZygoteRules = "0.2.7" julia = "1.10" diff --git a/test/Project.toml b/test/Project.toml index 558c0313..630ebcaa 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -41,7 +41,7 @@ ForwardDiff = "1" GPUArraysCore = "0.2" JLArrays = "0.3" KernelAbstractions = "0.9" -ModelingToolkit = "11.17.0" +ModelingToolkit = "11.23.0" OpenCL = "0.10" Optimization = "5" OptimizationOptimisers = "0.3" @@ -50,8 +50,8 @@ OrdinaryDiffEqRosenbrock = "2" OrdinaryDiffEqSDIRK = "2" OrdinaryDiffEqStabilizedRK = "2" SafeTestsets = "0.1" -SciMLBase = "3" -StaticArrays = "1.9" +SciMLBase = "3.1" +StaticArrays = "1.9.14" Statistics = "1" StochasticDiffEq = "7" TOML = "1" diff --git a/test/gpu_kernel_de/stiff_ode/gpu_ode_mass_matrix.jl b/test/gpu_kernel_de/stiff_ode/gpu_ode_mass_matrix.jl index e35fd652..9db8fffc 100644 --- a/test/gpu_kernel_de/stiff_ode/gpu_ode_mass_matrix.jl +++ b/test/gpu_kernel_de/stiff_ode/gpu_ode_mass_matrix.jl @@ -35,8 +35,11 @@ monteprob = EnsembleProblem(prob, safetycopy = false) alg = GPURosenbrock23() +# dt must match the Float32 eltype of u0/p. A Float64 dt makes calc_W build a +# Float64 StaticWOperator that OrdinaryDiffEqRosenbrock's JacReuseState (typed +# from the Float32 state) cannot store, erroring in the cached_W assignment. bench_sol = solve( - prob, Rosenbrock23(), dt = 0.1, abstol = 1.0f-5, reltol = 1.0f-5, + prob, Rosenbrock23(), dt = 0.1f0, abstol = 1.0f-5, reltol = 1.0f-5, initializealg = BrownFullBasicInit() )