Repository navigation
Avoid RSwM3 reject_step! temporaries on the in-place path - #341
Conversation
Form the S₁ stack entry by mutating the just-popped S₂ slot in place so warmed adaptive SDE steps no longer allocate L₂ - dWtilde / L₃ - dZtilde arrays on every nonempty-S₂ rejection. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Cursor Agent <noreply@cursor.com> Agent-Harness: Cursor Agent 2026.10.01-14929f9 Agent-Model: unknown (Cursor auto) Agent-Session: local session, transcript /home/crackauc/sandbox/goals/performance/jobs/sde/pr-dnp-reject/log.txt on amdci2
Measure reject_step! through a local function so @allocated sees a compiled call site under SciMLTesting's @safetestset on Julia 1.10. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Cursor Agent <noreply@cursor.com> Agent-Harness: Cursor Agent CLI Agent-Model: auto
Independent review (Devin CLI 3000.11.3, model fusion-claude-opus-5-5-high-sidekick-swe-2-medium): MERGE, risk low. Full reviewVERDICT: MERGE Blocking findingsNone. Non-blocking findings
Correctness reasoning (from reading, then confirmed by the probes below)
What I ranAll runs were local on macOS aarch64, with scratch environments that
What I did not verify
🤖 Posted by an AI agent — harness: Devin CLI 3000.11.3 (review), Claude Code 2.1.285 (posting) · model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium |
Bump version to 5.36.5 Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Harness: Claude Code 2.1.301 Agent-Model: claude-opus-5-5 Claude-Session: https://claude.ai/code/session_01VZjwf7Ux9YtTzwHGHMqnsq
Summary
On the RSwM3 nonempty-
S₂rejection path, in-placereject_step!was buildingL₂ - W.dWtilde/L₃ - W.dZtildetemporaries beforecopyat_or_push!, which showed up as per-step allocations in warmed adaptive SDE solves (SRIW1 ~44.5 B/step). The in-place branch now mutates the just-poppedS₂slot (@.. L₂ -= W.dWtilde, and likewise forL₃whenZis present) and then copies that entry intoS₁. That is safe becausepop!only decrements the stack cursor,copyat_or_push!copies intoS₁beforeS₂reuses the slot, and the empty-S₂/NoiseGrid/NoiseFunctionpaths never enter this branch.Regression / numbers
Allocation regression (
test/RSwM_correctness_test.jl, warmed nonempty-S₂reject_step!, length-4W+Z):total == 19200→@test total == 0FAIL (before.txt)total == 0→ PASS (after.txt)@benchmarkminima (JULIA_NUM_THREADS=1 taskset -c 0, reject-only withsetup=accept_step!, length-4W+Z):SDE-level warmed adaptive iip (from the C2 audit patch on the same machine family; 35200 accepts):
Bitwise identical to baseline over 100 seeds for LambaEM / RKMil / RKMilCommute / SOSRI / SRIW1 (audit logs).
Test-group tails
Core (
Pkg.test, default All/Core):(
Core/RSwM_correctness_test.jl: 1282718 pass, including the new allocation test.)QA (
GROUP=QA):Also: Runic + typos on the touched files; Julia 1.10.12 allocation regression OK in a scratch env.
Not verified
L₂ - W.dWtildetemporaries (intentional; not changed).S₂/ RSwM1 / RSwM2 rejection branches still formW.dW - W.dWtildewith out-of-place arithmetic even whenisinplace(W).Arraynoise prototypes.Reviewer pushback
S₂buffer is only correct becausecopyat_or_push!(S₁, …)runs beforeS₂reclaims that slot withdWtilde.S₂in-place branch should get the same treatment in a follow-up.@test total == 0is too brittle under GC / CI noise (it was exact on amdci2 for 100 warmed rejects).Please ignore until reviewed by @ChrisRackauckas.
Risk assessment
Independent review: pending
🤖 Generated with Cursor Agent 2026.10.01-14929f9 (model: unknown (Cursor auto)), transcript /home/crackauc/sandbox/goals/performance/jobs/sde/pr-dnp-reject/log.txt on amdci2; orchestrated by Claude Code (claude-opus-5-5[1m]) https://claude.ai/code/session_01LPHREnnonfLg1VcE1EJovv
Made with Cursor
Independent review: Devin Fusion (fusion-claude-opus-5-5-high-sidekick-swe-2-medium) rated it low, verdict MERGE: #341 (comment)
Risk assessment
Independent risk assessment by codex-cli (gpt-6.1-sol), reviewed head
5a6017422c; dispatched by the fleet master, Claude Code (claude-opus-5-5), https://claude.ai/code/session_01VZjwf7Ux9YtTzwHGHMqnsq