Repository navigation
Keep estimate_terk; drop duplicate OOP FBDF inline terk - #4785
Merged
ChrisRackauckas merged 2 commits intoOct 8, 2026
Merged
ChrisRackauckas merged 2 commits into
ChrisRackauckas merged 2 commits into
Conversation
The out-of-place adaptive path computed terk via estimate_terk and then immediately overwrote it with the identical inline FD formula. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/tmp_20260923_181807_1012334/jobs-root/jobs/4641-small-cursor/log.txt on amdci2
Matches the IIP/DFBDF path and removes the per-step allocating calc_finite_difference_weights copy; no narrating comment. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/tmp_20260923_181807_1012334/jobs-root/jobs/4641-small-cursor-fix/log.txt on amdci2
ChrisRackauckas
marked this pull request as ready for review
October 8, 2026 17:56
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.
Please ignore until reviewed by @ChrisRackauckas.
Summary
In FBDF's out-of-place adaptive
perform_step!, the 12-line inline FD-weightterkblock duplicatedestimate_terk(..., k + 1, ...)and allocated a fresh weights matrix every step. This PR keepsestimate_terk(matching the IIP and DFBDF paths) and deletes the inline copy. No behaviour change intended.Evidence
I compared master
bdf_perform_step.jlvs this change in one process (Base.includeswap). Trajectories are bit-identical (sol.t,sol.u, stats, retcode) for Number /Vector/SVectorOOP FBDF:ALL IDENTICAL: true (I observed).
Allocation (minimum over 20 samples after warmup, OOP scalar at order 3):
@allocated estimate_terk(...): 0 bytes@allocatedequivalent inlinecalc_finite_difference_weightspath: 384 bytesSo dropping the inline removes a 384-byte per-step allocation on the OOP adaptive path.
I ran
julia -m Runic --checkon the touched file (exit 0) andtypos(exit 0). FullGROUP=Corewas not completed on this host (same overload limit as #4784).What was not verified
GROUP=Coresuite completionPart of #4641
Risk assessment
Low: deletes a pure duplicate of
estimate_terkon the OOP path; bit-identical trajectories on the probed problems. Independent review: Claude Code claude-opus-5-5[1m] (a different harness from the author, Cursor Agent): round 2 on c127765 rated it VERDICT MERGE, RISK low, high confidence. It is bit-identical to master in 18 runs (scalar, Vector and SVector; 3 problems; tol 1e-4 and 1e-8), and allocations drop 55–76% for scalar/SVector and 11–15% for Vector. Auto-merge candidate once CI is green. Non-blocking: the out-of-place calc_finite_difference_weights now has no callers.Cursor Agent (auto). Transcript:
/home/crackauc/sandbox/tmp_20260923_181807_1012334/jobs-root/jobs/4641-small-cursor-fix/log.txton amdci2.Independent review and orchestration: 🤖 Claude Code (model: claude-opus-5-5[1m]), session https://claude.ai/code/session_015tNYhuzygK9z8yhh6MNCAz
Risk assessment
perform_step!for the OOP FBDF cache) only. The deleted block recomputedterkand overwrote the valueestimate_terk(integrator, cache, k + 1, Val(max_order), u)had just returned. Both use the samets_tmp,t + dt, orderkweights andabs(dt^k)scaling, so the step math is unchanged.tests / GPU (julia 1)with the same 3 failures at test/gpu/dae_tests.jl:481,SciMLSensitivity.jl/Core1with the same error at concrete_solve_derivatives.jl:451, anddowngrade-sublibraries / test (lib/DiffEqBase)and(lib/OrdinaryDiffEqDifferentiation). 132 checks pass, including the BDF sublibrary groups.estimate_terk.🤖 Risk assessment posted by an AI agent (fleet master) — harness: Claude Code 2.1.285 · model: claude-opus-5-5
Conversation: local session 3c311569-dda6-4687-bc9f-65febb212c33 (local transcript)