Repository navigation
Fix ExplicitRK tableau c eltype for Float32 time - #4702
Merged
ChrisRackauckas merged 2 commits intoOct 3, 2026
Merged
Conversation
Prefer converting cache `c` to typeof(one(tType)) when exact (or IEEE float narrowing) so AutoSpecialize FunctionWrappers keep matching stage times; fall back to promote_type to preserve wider coefficient types. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent 2026.09.28-64d2043 Agent-Model: unknown (Cursor auto) Agent-Session: local session, transcript /home/crackauc/sandbox/goals/performance/jobs/pr-erk-c-eltype/log.txt on amdci2
Drop value-dependent exact-conversion helpers and Float64→Rational narrowing (overflows for fine dt). Keep IEEE→IEEE matching for the Float32 FunctionWrapper fix; otherwise promote_type as on master. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent 2026.09.28-64d2043 Agent-Model: unknown (Cursor auto) Agent-Session: local session, transcript /home/crackauc/sandbox/goals/performance/jobs/pr-erk-c-eltype/log.txt on amdci2
ChrisRackauckas
marked this pull request as ready for review
October 3, 2026 11:51
ChrisRackauckas
referenced
this pull request
Oct 14, 2026
…inaryDiffEqBDF, OrdinaryDiffEqExplicitRK, OrdinaryDiffEqFIRK, OrdinaryDiffEqFeagin, OrdinaryDiffEqHighOrderRK, OrdinaryDiffEqPDIRK, OrdinaryDiffEqRKN, OrdinaryDiffEqSDIRK, StochasticDiffEqHighOrder, StochasticDiffEqLowOrder, and StochasticDiffEqMilstein for release (#4871) Agent-Harness: Devin CLI 3000.11.3 Agent-Model: Fusion (Claude Opus 5.5 Medium + SWE-2 Medium) Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/flash-hour.json Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ExplicitRKcache construction previously set tableaucviapromote_type(eltype(c), typeof(one(tType))), which left Float64 coefficients in place for Float32 time problems. Stage timest + c[i]*dtthen promoted away from the FunctionWrapper signature under AutoSpecialize and raisedNoFunctionWrapperFoundError. This narrowscto the dimensionless time type when both that type and the tableau eltype are IEEE floats (Float16/Float32/Float64); otherwise it keeps master'spromote_typefallback so wider coefficient types (e.g. BigFloat) stay preserved and cache construction stays type-stable.Rational time with the default Float64 tableau is not claimed fixed: Float64→
Rational{Int}dyadic narrowing overflows for finedt(e.g.1//1000), and a Rational-built tableau already works on master forRational{BigInt}time viapromote_type(whileRational{Int}time still hitsInexactError/OverflowErroron both trees).Verification
Failing before / passing after (src stashed to master helper vs fixed; same regression script):
Before (unfixed
explicit_rk_caches.jl):After (with fix):
Float64 / BigFloat trajectories (
adaptive=false, dt=0.1) were bitwise identical before vs after on this machine.julia +1.10(1.10.12) regression: Float32 3/3 pass, BigFloat-tableau@inferred1/1 pass.Test-group tails (
Pkg.test("OrdinaryDiffEqExplicitRK"), GROUP=Core then GROUP=QA)Not verified
ode_numbertype_testson this branch.Unitful time types were verified bitwise identical to master by the independent reviewer (Claude Code, claude-opus-5-5).
Reviewer pushback
0.2).Please ignore until reviewed by @ChrisRackauckas.
Risk assessment
c; Float64/BigFloat/Unitful/Dual paths checked bitwise identical to master.OrdinaryDiffEqExplicitRKExplicitRKsolves, especially Float32 time under AutoSpecialize.@inferredBigFloat tableau → concreteVector{BigFloat}c.🤖 Generated with Cursor Agent 2026.09.28-64d2043 (model: unknown (Cursor auto)), transcript /home/crackauc/sandbox/goals/performance/jobs/pr-erk-c-eltype/log.txt on amdci2; orchestrated by Claude Code (claude-opus-5-5[1m]) https://claude.ai/code/session_01LPHREnnonfLg1VcE1EJovv
Made with Cursor