Repository navigation
Apply stage limiters in every StabilizedRK method - #4550
Merged
ChrisRackauckas merged 1 commit intoSep 13, 2026
Merged
ChrisRackauckas merged 1 commit into
ChrisRackauckas merged 1 commit into
Conversation
SciML#3835 claimed to extend limiter support to the StabilizedRK methods but never touched their perform_step! bodies, so `stage_limiter` still errored as unused for ROCK2/ROCK4/RKC/RKMC2/ESERK4/ESERK5/SERK2/TSRKC2/TSRKC3/RKL1/RKL2/RKG1/RKG2. Every in-place perform_step! now applies `integrator.opts.stage_limiter!` to each recurrence stage (and the finishing stages of ROCK2/ROCK4, the extrapolation sub-steps of ESERK) before `f` reads it, and to the accepted `u`, and the methods opt into `has_stage_limiter`. Step limiters were already applied centrally and are unchanged. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Agent-Harness: Devin CLI 3000.10.21 Agent-Model: Fusion (Claude Fable 5.1 High + SWE-2 Medium) Agent-Session: local Devin CLI session id five-bladder (no shareable URL)
ChrisRackauckas
marked this pull request as ready for review
September 13, 2026 09:39
ChrisRackauckas
added a commit
that referenced
this pull request
Sep 13, 2026
- Stop tying the state Jacobian's finite-difference direction to tdir (#4543) - Extend OrdinaryDiffEqCore.dtnew_modification instead of shadowing it (#4547) - Pick the DAE initialization dt by magnitude, not signed min (#4549) - Accept a callable stage predictor on the nlsolve algorithms (#4539) - Run the QA test group last in every sublibrary that ran it first (#4551) - Apply stage limiters in every StabilizedRK method (#4550) Agent-Harness: Claude Code Agent-Model: claude-opus-5[1m] Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
ChrisRackauckas
added a commit
that referenced
this pull request
Sep 13, 2026
- Stop tying the state Jacobian's finite-difference direction to tdir (#4543) - Extend OrdinaryDiffEqCore.dtnew_modification instead of shadowing it (#4547) - Pick the DAE initialization dt by magnitude, not signed min (#4549) - Accept a callable stage predictor on the nlsolve algorithms (#4539) - Run the QA test group last in every sublibrary that ran it first (#4551) - Apply stage limiters in every StabilizedRK method (#4550) - Release OrdinaryDiffEqNonlinearSolve 2.9.8 (#4552) - Declare OrdinaryDiffEqCore.dtnew_modification public (#4553) - Fix baseline spelling and whitespace checks in tests (#4524) - Raise OrdinaryDiffEqNonlinearSolve floor for stage_predictor (#4554) Agent-Harness: Claude Code Agent-Model: claude-opus-5[1m] Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
ChrisRackauckas
added a commit
that referenced
this pull request
Sep 17, 2026
Ships stage limiters being applied in every StabilizedRK method (#4550) and the dtnew_modification extension fix (#4547). Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude <[email protected]> Agent-Harness: Claude Code 2.1.273 Agent-Model: claude-opus-5[1m] Agent-Session: 6a01e420-3436-4518-83cc-6cd853283cfb (local transcript; this harness publishes no conversation URL)
ChrisRackauckas
added a commit
that referenced
this pull request
Sep 17, 2026
Ships stage limiters being applied in every StabilizedRK method (#4550) and the dtnew_modification extension fix (#4547). Agent-Harness: Claude Code 2.1.273 Agent-Model: claude-opus-5[1m] Agent-Session: 6a01e420-3436-4518-83cc-6cd853283cfb (local transcript; this harness publishes no conversation URL) Co-authored-by: Claude <[email protected]>
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.
This PR should be ignored until reviewed by @ChrisRackauckas.
What changed and why
#3835 reported extending limiter support to "all StabilizedRK methods", but it never touched
rkc_perform_step.jl: the methods had no stage hooks and did not opt intohas_stage_limiter, sosolve(prob, ROCK2(); stage_limiter = ...)errored withstage_limiter_unused(raised in #3902 (comment)). Step limiters were already applied centrally and are unchanged.Every in-place
perform_step!inOrdinaryDiffEqStabilizedRK(ROCK2, ROCK4, RKC, RKMC2, ESERK4, ESERK5, SERK2, TSRKC2, TSRKC3, RKL1, RKL2, RKG1, RKG2) now callsintegrator.opts.stage_limiter!(buf, integrator, p, t_stage)on each stage buffer right after it is formed and beforefreads it — the Chebyshev/Legendre/Gegenbauer recurrence stages, the two- and four-stage finishing procedures of ROCK2/ROCK4, the ESERK extrapolation sub-step results — and on the acceptedu. Stage times are the ones the methods already track (tᵢ₋₁,t + dt*th,t + dt*cⱼ, the ESERKr). Following the convention of the other RK families, the out-of-placeConstantCachepaths do not apply stage limiters. All 13 algorithms opt intoOrdinaryDiffEqCore.has_stage_limiter.Tests
New
lib/OrdinaryDiffEqStabilizedRK/test/stage_limiter_tests.jl(Core group): for each algorithm andadaptive ∈ (false, true), a clampu .= max.(u, 0.9)is applied by the stage limiter onu' = -10u, andfcounts every call whose input violates the clamp. This checks that every state handed tofinside a step has passed through the limiter (a missed hook shows up as a violation), that the limiter receives aDEIntegratorand neveruprev, that every acceptedusatisfies the clamp, and that the unlimited solve does not (so the test discriminates).test/Integrators_I/step_limiter_test.jlmoves the 13 methods into thesupported/LIMITER_ALGSlists and removesROCK2, RKC, ESERK4, RKL1fromunsupported.Failing before the fix (src stashed, test kept):
and
solve(prob, ROCK2(); stage_limiter = ...)on master:ErrorException: Verbosity toggle: stage_limiter_unused.Passing after:
Verification
--inplaceon all changed files: no changes.typos: clean.GROUP=Core julia --project=lib/OrdinaryDiffEqStabilizedRK -e 'using Pkg; Pkg.test()':GROUP=QA julia --project=lib/OrdinaryDiffEqStabilizedRK -e 'using Pkg; Pkg.test()':test/Integrators_I/step_limiter_test.jlrun standalone against this checkout: 404 tests, 0 failures, includingGROUP=Integrators_I julia --project=. -e 'using Pkg; Pkg.test()'(full group, 64 min):Testing OrdinaryDiffEq tests passed, zero failures; the modified file ran asjulia prejobs.For the reviewer
t + dt*th(whereth == 1for the last stage) rather than a second time att + dt, to avoid double-applying the limiter to the same buffer.step_limiter_test.jl; no stage-limiter claim was made for it.🤖 Generated with Devin CLI 3000.10.21 (model: Fusion — Claude Fable 5.1 High + SWE-2 Medium). Local session id
five-bladder; the harness publishes no shareable conversation URL.