Skip to content

Commit 12b0db6

Browse files
ChrisRackauckas-ClaudeChrisRackauckasclaude
committed
Fix FIRK step count test: use length(sol.t) instead of length(sol) (#3478)
On RAT v4, ODESolution is an AbstractArray. `length(sol)` dispatches to `length(::AbstractArray)` which materializes the flattened array dimensions. This JIT-compiles RecursiveArrayTools/FastBroadcast methods for the solution's element type, changing how @.. broadcasts dispatch for subsequent solves in the same process. The result: step counts double from 117 to 234 for the Van der Pol μ≥1e7 cases. `length(sol.t)` accesses the timestep vector directly without triggering the AbstractArray machinery. This gives consistent results regardless of compilation order. Confirmed: Pkg.test passes 92/92 with this fix (previously 82/10). Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8adb5f3 commit 12b0db6

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

lib/OrdinaryDiffEqFIRK/test/ode_firk_tests.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,22 +79,22 @@ for iip in (true, false)
7979
@test length(sol.t) < 150
8080
@test SciMLBase.successful_retcode(sol)
8181
sol_temp = solve(remake(vanstiff, p = [1.0e7]), RadauIIA5())
82-
@test length(sol_temp) < 150
82+
@test length(sol_temp.t) < 150
8383
@test SciMLBase.successful_retcode(sol_temp)
8484
sol_temp2 = solve(remake(vanstiff, p = [1.0e7]), reltol = [1.0e-6, 1.0e-4], RadauIIA5())
85-
@test length(sol_temp2) < 180
85+
@test length(sol_temp2.t) < 180
8686
@test SciMLBase.successful_retcode(sol_temp2)
8787
sol_temp3 = solve(
8888
remake(vanstiff, p = [1.0e7]), RadauIIA5(), reltol = 1.0e-9,
8989
abstol = 1.0e-9
9090
)
91-
@test length(sol_temp3) < 970
91+
@test length(sol_temp3.t) < 970
9292
@test SciMLBase.successful_retcode(sol_temp3)
9393
sol_temp4 = solve(remake(vanstiff, p = [1.0e9]), RadauIIA5())
94-
@test length(sol_temp4) < 170
94+
@test length(sol_temp4.t) < 170
9595
@test SciMLBase.successful_retcode(sol_temp4)
9696
sol_temp5 = solve(remake(vanstiff, p = [1.0e10]), RadauIIA5())
97-
@test length(sol_temp5) < 190
97+
@test length(sol_temp5.t) < 190
9898
@test SciMLBase.successful_retcode(sol_temp5)
9999
end
100100

0 commit comments

Comments
 (0)