Skip to content

Make RK_WITH_SPECIAL_INTERPOLATIONS const - #4608

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:tsit5-const-alias
Sep 25, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:tsit5-const-alias

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

What changed and why

RK_WITH_SPECIAL_INTERPOLATIONS in lib/OrdinaryDiffEqTsit5/src/interpolants.jl was the package's only non-const global. It is a Union alias used exclusively in method signatures (cache::RK_WITH_SPECIAL_INTERPOLATIONS), never read at runtime, so marking it const is hygiene only — no runtime change is expected, by construction. This PR adds the const keyword and nothing else; the same-named aliases in other sublibraries are separate module locals and are untouched.

Verification

$ julia --project=env -e 'using OrdinaryDiffEqTsit5; println(isconst(OrdinaryDiffEqTsit5, :RK_WITH_SPECIAL_INTERPOLATIONS))'   # master
false

$ julia --project=env2 -e 'using OrdinaryDiffEqTsit5; println(isconst(OrdinaryDiffEqTsit5, :RK_WITH_SPECIAL_INTERPOLATIONS))'  # this branch
true

@benchmark of sol(out, t) dense interpolation (Lorenz, Tsit5, 1000 points, 3 trials per run; machine under heavy load — load avg ~500 on 128 cores):

Before:

trial 1 sol(out,t): min=66980.0 ns median=115020.0 ns allocs=0
trial 2 sol(out,t): min=98690.0 ns median=116549.0 ns allocs=0
trial 3 sol(out,t): min=98810.0 ns median=119389.0 ns allocs=0

After:

trial 1 sol(out,t): min=99719.0 ns median=116339.0 ns allocs=0
trial 2 sol(out,t): min=100640.0 ns median=113650.0 ns allocs=0
trial 3 sol(out,t): min=98750.0 ns median=117940.0 ns allocs=0

The numbers are noise on a loaded machine; a signature-only alias has no runtime effect regardless — const only removes a non-const global binding from the module namespace.

Test group — GROUP=ALL for OrdinaryDiffEqTsit5 (its whole suite is the QA group: AllocCheck, JET, Aqua):

OrdinaryDiffEqTsit5.Tsit5{...} perform_step! appears allocation-free with AllocCheck
Test Summary:    | Pass  Total     Time
Allocation Tests |    1      1  2m39.8s
Test Summary: | Pass  Broken  Total     Time
JET Tests     |    1       2      3  1m40.1s
Test Summary: | Pass  Total     Time
Aqua          |   21     21  2m09.2s
     Testing OrdinaryDiffEqTsit5 tests passed

(The 2 JET "broken" are pre-existing @test_brokens. Two unrelated sibling packages printed "missing from the cache" warnings during parallel precompilation under heavy load; they are not dependencies of this change.)

Runic --check on the changed file: exit 0. typos over the diff: exit 0.

What was not verified

  • Same-named aliases in other sublibraries (LowOrderRK, Verner, …) were intentionally not touched.
  • No other globals were audited; this fixes only the one non-const global in this package.

Please ignore until reviewed by @ChrisRackauckas.

Risk assessment

  • Risk: low
  • Blast radius: one module-local Union alias in OrdinaryDiffEqTsit5 used only in dispatch signatures; not exported, not referenced from any other sublibrary.
  • Evidence: isconst false → true (commands above); Tsit5 test group (Allocation, JET, Aqua) passes.
  • Independent review: Claude Code (Opus 5.5) rated it low, high confidence: one const on a signature-only alias, no external references, same-named aliases in LowOrderRK/Verner are separate modules. Verdict MERGE.
  • Merge: auto-merge candidate once CI is green.

🤖 Generated with Devin (model: swe-2-high), local session, orchestrated by Claude Code (claude-opus-5-5[1m]) session https://claude.ai/code/session_01LPHREnnonfLg1VcE1EJovv

The Union alias is used only in method signatures; marking it const
removes a non-const global from the package namespace. No runtime
behavior change expected or measured.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <[email protected]>
Agent-Harness: devin 3000.11.1 (cc4e349ca55e)
Agent-Model: swe-2-high
Agent-Session: local Devin session in /home/crackauc/sandbox/goals/performance/jobs/OrdinaryDiffEqTsit5/repo (log: /home/crackauc/sandbox/goals/performance/jobs/OrdinaryDiffEqTsit5/log.txt)
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review September 25, 2026 02:17
@ChrisRackauckas
ChrisRackauckas merged commit 418f783 into SciML:master Sep 25, 2026
141 of 145 checks passed
ChrisRackauckas added a commit that referenced this pull request Sep 27, 2026
The Union alias is used only in method signatures; marking it const
removes a non-const global from the package namespace. Same change as
#4608 for Tsit5. No runtime behavior change expected.



Agent-Harness: Cursor Agent 2026.09.26-dd393fe
Agent-Model: auto
Agent-Session: local cursor-agent session in /home/crackauc/sandbox/goals/performance/jobs/pr-out-size/repo (log /home/crackauc/sandbox/goals/performance/jobs/pr-out-size/log.txt)

Co-authored-by: ChrisRackauckas-Claude <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
ChrisRackauckas added a commit that referenced this pull request Sep 27, 2026
Signature-only Union alias hygiene; same pattern as #4608.



Agent-Harness: Cursor Agent 2026.09.26-dd393fe
Agent-Model: auto
Agent-Session: local cursor-agent session in /home/crackauc/sandbox/goals/performance/jobs/pr-rosen-const/repo (log /home/crackauc/sandbox/goals/performance/jobs/pr-rosen-const/log.txt)

Co-authored-by: ChrisRackauckas-Claude <[email protected]>
Co-authored-by: Cursor Agent <[email protected]>
ChrisRackauckas added a commit that referenced this pull request Sep 28, 2026
QNDF_CACHES, FBDF_CACHES, and BDF_CACHES_WITH_INTERPOLATIONS are used
only in method signatures and are never reassigned; NORDSIECK_CACHES
later in the same file is already declared const. Declaring them const
lets the compiler treat the unions as constant bindings and silences
the only non-const globals in OrdinaryDiffEqBDF. Same pattern as
#4608.

Verified: isconst(OrdinaryDiffEqBDF, name) reports true for all three
(false before); FBDF solve and dense interpolation are unaffected.



Agent-Harness: devin 3000.11.1
Agent-Model: swe-2-high
Agent-Session: local Devin session in /home/crackauc/sandbox/goals/performance/jobs/pr-bdf/repo (log /home/crackauc/sandbox/goals/performance/jobs/pr-bdf/log.txt)

Co-authored-by: ChrisRackauckas-Claude <[email protected]>
Co-authored-by: Devin <[email protected]>
ChrisRackauckas referenced this pull request Sep 29, 2026
* Bump DiffEqBase to 7.21.3

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.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqBDF to 2.4.12

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.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqSDIRK to 2.9.7

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.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqRosenbrock to 2.7.5

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.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqLowOrderRK to 2.2.6

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.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqTsit5 to 2.1.5

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.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqVerner to 2.4.2

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.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqSymplecticRK to 2.2.3

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.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

---------

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants