Repository navigation
Fix scalar indexing in fallback compute_stages! for >17-stage tableaus - #4705
Merged
ChrisRackauckas merged 1 commit intoOct 3, 2026
Merged
Conversation
Replace zero(kk[1][1]) with zero(eltype(kk[1])) so no scalar read of GPU-like arrays is needed. Add a JLArray regression test with a 19-stage tableau under allowscalar(false). Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: OpenCode <[email protected]> Agent-Harness: opencode 1.18.31 Agent-Model: opencode/muse-spark-1.3-contributor-free Agent-Session: local session, transcript /home/crackauc/sandbox/goals/performance/jobs/pr-erk-gpu-zero/log.txt on amdci2
ChrisRackauckas
marked this pull request as ready for review
October 3, 2026 12:23
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.
The fallback
compute_stages!used for tableaus with more than 17 stages zeroed the stage accumulator withzero(kk[1][1]), which scalar-indexes the state array and errors on GPU-like arrays underallowscalar(false). This replaces both sites withzero(eltype(kk[1])), which needs no scalar read, and adds a regression test solving a 19-stage tableau on aJLArrayunderallowscalar(false).JLArrayswas not a test dependency of this sublibrary, so it is added via[extras]/[targets]with compat0.3(notest/Project.toml).Failing-before: with the src change stashed, the repro errors with
Scalar indexing is disallowed ... getindex ... compute_stages! ... explicit_rk_perform_step.jl:171(exit 1, saved inbefore.txt); theVector{Float64}solve succeeds. Passing-after: with the fix, both CPU andJLArraysolves returnSuccesswith bitwise-equalu[end](BITWISE_EQUAL: true, exit 0, saved inafter.txt); theVector{Float64}result is bitwise identical before/after the fix.Test-group tails (
GROUP=QA,Pkg.test(), exit 0,Testing OrdinaryDiffEqExplicitRK tests passed):Generic RK Tests | 27 27,Allocation Tests | 1 1,JET Tests | 1 pass, 2 broken (pre-existing),Aqua | 21 21. Targeted run ofinterpolation_tests.jl: all testsets pass includingfallback compute_stages! (>17 stages) on JLArray | 3 3. Regression repro also passes on Julia 1.10.12 (BITWISE_EQUAL: true). Runic andtyposclean on changed files.What was NOT verified: GPU hardware (only
JLArraysCPU emulation); downstream packages; the other genericity items in the audit (Float32cpromotion, empty-αEEsttableau, Dual-Θdense output) are untouched.What a reviewer should push back on: whether
zero(eltype(kk[1]))is the preferred spelling versuszero(eltype(eltype(kk)))(avoids even the outerkk[1]index); whether the regression test belongs ininterpolation_tests.jlor a new GPU test file/group; whetherJLArrays = "0.3"compat is the right floor.Please ignore until reviewed by @ChrisRackauckas.
Risk assessment
OrdinaryDiffEqExplicitRKfallback stage computation for >17-stage tableaus only;zero(x)is value-independent so CPU numerics are unchanged (verified bitwise identical)before.txt/after.txt); test-group tails abovezero(eltype(...))change, bitwise identical to master across Float64/Unitful/ArrayPartition/Dual, fails-before/passes-after on 1.10 and 1.12. Sonnet is not a top-tier reviewer, so this needs human review rather than auto-merge. Textual conflict with OrdinaryDiffEqExplicitRK: make indexed dense interpolation generic over Θ type #4704 (Project.toml extras, end of test/interpolation_tests.jl).🤖 Generated with opencode 1.18.31 (model: opencode/muse-spark-1.3-contributor-free), transcript /home/crackauc/sandbox/goals/performance/jobs/pr-erk-gpu-zero/log.txt on amdci2; orchestrated by Claude Code (claude-opus-5-5[1m]) https://claude.ai/code/session_01LPHREnnonfLg1VcE1EJovv
Risk assessment
ExplicitRKsolves using tableaus with more than 17 stages; adds a test-only JLArrays dependency. No new dependency internals, public API changes, or weakened assertions found; intended behavior change is a GPU scalar-indexing bug fix, not a SemVer-breaking change.e7036c9has four failures, all pre-existing, matchingmastercommit7393799and still failing on recent October 3 commits:SciMLSensitivity.jl/Core1/1 / Downstream Tests - Core1—MooncakeAdjoint constructor error (baseline);downgrade-sublibraries / test (lib/DiffEqBase)—29 passed, 1 failed, 3 errored;downgrade-sublibraries / test (lib/OrdinaryDiffEqDifferentiation)—missingdiag(::ScalarOperator)(baseline);tests / GPU (julia 1, self-hosted Linux X64 gpu) / Tests - GPU (Julia 1)—same three QNDF assertions (baseline). ExplicitRK sublibrary and downgrade checks pass. No observed test regressions. No review comments exist. The description omits these CI failures and baseline comparisons.🤖 Risk assessment posted by an AI agent (fleet master) — harness: Codex CLI 0.156.1 (Mac) / gpt-6-astra; dispatched by Claude Code 2.1.285 (Mac) fleet-master head, model claude-opus-5-5[1m]
Conversation: local session 3c311569-dda6-4687-bc9f-65febb212c33