Repository navigation
Fix Feagin in-place stage updates to avoid scalar indexing - #4757
Merged
ChrisRackauckas merged 2 commits intoOct 7, 2026
Merged
ChrisRackauckas merged 2 commits into
ChrisRackauckas merged 2 commits into
Conversation
Replace @tight_loop_macros/@inbounds element loops in Feagin10/12/14 in-place perform_step! with @.. broadcast=false so JLArray solves work under allowscalar(false) without changing Float64 arithmetic order. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent 2026.10.01-14929f9 Agent-Model: unknown (Cursor auto) Agent-Session: local session, transcript /home/crackauc/sandbox/goals/performance/jobs/pr-feagin-jlarray/log.txt on amdci2
Wrap the 80 IIP @.. stage updates so FastBroadcast skips shape checks, matching the old scalar-loop inbounds assumption, and tighten the JLArray regression to adaptive/fixed plus the matrix exponential. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent 2026.10.01-14929f9 Agent-Model: unknown (Cursor auto) Agent-Session: local session, transcript /home/crackauc/sandbox/goals/performance/jobs/pr-feagin-jlarray/log.txt on amdci2
ChrisRackauckas
marked this pull request as ready for review
October 7, 2026 04:54
This was referenced Oct 8, 2026
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
In-place Feagin10/12/14
perform_step!used@tight_loop_macros/@inboundsscalar element loops for stage updates and the adaptive residual, which errors onJLArrayunderJLArrays.allowscalar(false)(out-of-place already worked). Those loops are rewritten as@inbounds @.. broadcast = falsefused broadcasts with the same arithmetic grouping (restoring the matching-cache-axes inbounds scope), and a JLArray IIP regression test plusJLArrays/LinearAlgebra[extras]/[targets]entries are added.Failing-before / passing-after: with the src change stashed, the JLArray IIP repro errors with
Scalar indexing is disallowedatfeagin_rk_perform_step.jl:176(exit 1,before.txt); with the fix, Feagin10/12/14 all succeed underallowscalar(false)(after.txt).sol.uSHA-256 hashes for Vector Lorenz, Pleiades, and linear100 (adaptive and fixed) are bitwise identical vs master for all three methods.Vector solve time (round 2, pinned):
JULIA_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 taskset -c 64,@benchmarkminima, 5 interleaved master/head rounds. Median of trial minima (ms); negative is faster than master. All 12 cases are within ~2% of master or faster.Test-group tails (round 2)
Core (
GROUP=Core):QA (
GROUP=QA):Also verified the JLArray IIP repro on Julia 1.10.12 (round 1) and again under
allowscalar(false)after@inbounds(round 2).What was NOT verified
JLArrayunderallowscalar(false).#=Feagin kernel block should be deleted (left untouched).What a reviewer should push back on
@inbounds @..is the right way to restore FastBroadcast's skipped shape checks vs leaving DimensionMismatch paths.LinearAlgebrabelongs in test extras solely formul!in the JLArray probe.Please ignore until reviewed by @ChrisRackauckas.
Risk assessment
Independent review: Codex CLI (gpt-6-astra) round 1 CHANGES: @inbounds scope; round 2 restores it, Vector speed re-measured
🤖 Generated with Cursor Agent 2026.10.01-14929f9 (model: unknown (Cursor auto)), transcript /home/crackauc/sandbox/goals/performance/jobs/pr-feagin-jlarray/log.txt on amdci2; orchestrated by Claude Code (claude-opus-5-5[1m]) https://claude.ai/code/session_01LPHREnnonfLg1VcE1EJovv
Made with Cursor
Risk assessment
Feagin10/Feagin12/Feagin14inlib/OrdinaryDiffEqFeagin. Each scalar@tight_loop_macros/@inboundselement loop becomes a matching@inbounds @.. broadcast = falsefused broadcast with the same terms and grouping, and nothing else inperform_step!changes. Out-of-place paths, caches, tableaus and the public API are unchanged, so no SemVer impact. The PR stops using the non-public DiffEqBase macro@tight_loop_macrosand removes it from the QA ExplicitImports ignore list, which tightens QA rather than loosening it. Pairing@inboundswith@..(which skips shape checks) is already done in 8 files in this repo, including theinterpolants.jlfiles for Tsit5, Verner and HighOrderRK, and it is safe here because every cache array is built withu's axes inalg_cache. The only new dependencies are test-only (JLArrays0.3 and theLinearAlgebrastdlib, both MIT).e245e3f, and all 4 also fail on the two most recent completed master runs (4a5c0e71,e7068884), so none is a regression:tests / GPU (julia 1, self-hosted …): same 3 QNDFmass=diag_cufailures attest/gpu/dae_tests.jl:481on head and master, same totals (170 pass / 3 fail / 12 broken). Pre-existing.SciMLSensitivity.jl/Core1/1 / Downstream Tests - Core1: same "Mooncake with MooncakeAdjoint" Error During Test atconcrete_solve_derivatives.jl:451on head and master. Pre-existing.downgrade-sublibraries / test (lib/DiffEqBase)andtest (lib/OrdinaryDiffEqDifferentiation): both fail on master too, and the PR touches neither lib. Pre-existing.allowscalar(false), adaptive and fixed-step, compared againstexp(A)*u0) and modifies no existing assertion.sol.uvs master) and adds no new CI failures.JLArrays.allowscalar(false)and never restores it. This only matters if a later test in the same process uses JLArrays.qa.jlignore-list removal or the two added# SAFETY:comments.🤖 Risk assessment posted by an AI agent (fleet master) — harness: Devin CLI (Mac) / fusion-claude-opus-5-5-high-sidekick-swe-2-medium; dispatched by Devin CLI 3000.11.3 (Mac) fleet-master caretaker, model Fusion (claude-opus-5-5 medium + swe-2 medium)
Conversation: local transcript ~/.local/share/devin/cli/transcripts/speckle-whale.json (Chris's Mac)