Skip to content

Make the BDF cache-union aliases const - #4646

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:bdf-const-aliases
Sep 28, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:bdf-const-aliases

Conversation

@ChrisRackauckas-Claude

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

Copy link
Copy Markdown
Member

Summary

QNDF_CACHES, FBDF_CACHES, and BDF_CACHES_WITH_INTERPOLATIONS in lib/OrdinaryDiffEqBDF/src/bdf_interpolants.jl are now const. They are used only in method signatures and are never reassigned — the same pattern as #4608. NORDSIECK_CACHES later in the same file was already const; these three were the only non-const top-level globals in OrdinaryDiffEqBDF.

Verification

  • grep over lib/OrdinaryDiffEqBDF: all uses are in bdf_interpolants.jl, all in cache::/cache signature positions or the union definitions; no reassignment anywhere.

  • isconst(OrdinaryDiffEqBDF, name) reports false for all three on master and true on this branch. Actual output (Julia 1.12.4, OrdinaryDiffEqBDF dev'd at each revision):

    On master (f9ce35d):

    julia> using OrdinaryDiffEqBDF
    julia> for n in (:QNDF_CACHES, :FBDF_CACHES, :BDF_CACHES_WITH_INTERPOLATIONS)
               println(n, " => ", isconst(OrdinaryDiffEqBDF, n))
           end
    QNDF_CACHES => false
    FBDF_CACHES => false
    BDF_CACHES_WITH_INTERPOLATIONS => false

    On this branch (86c054e):

    julia> using OrdinaryDiffEqBDF
    julia> for n in (:QNDF_CACHES, :FBDF_CACHES, :BDF_CACHES_WITH_INTERPOLATIONS)
               println(n, " => ", isconst(OrdinaryDiffEqBDF, n))
           end
    QNDF_CACHES => true
    FBDF_CACHES => true
    BDF_CACHES_WITH_INTERPOLATIONS => true
  • FBDF solve + dense sol(out, t) still work.

  • Runic --check and typos clean on the changed file.

  • GROUP=Core and GROUP=QA for OrdinaryDiffEqBDF both pass locally (Pkg.test, Julia 1.12.4).

What was not verified

No runtime behavior change is expected — the bindings only appear in method signatures. const makes the binding itself constant, which is what lets the compiler fold the union type into dispatch tables.

Please ignore until reviewed by @ChrisRackauckas.

Risk assessment

  • Independent review: Cursor Agent (auto): low risk; diff is signature-only const on three Union aliases, no other-module references; asked for real isconst output (now added)
  • Trivial 3-line annotation-only change; no code motion.

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

Risk assessment

  • Risk: medium
  • Blast radius: BDF interpolation dispatch (QNDF/FBDF/DFBDF) and downstream DelayDiffEq solvers. Only three internal aliases become const; no new dependency-internal usage, public API/SemVer change, or weakened tests.
  • Evidence: Head 86c054e0: 134 successful, five failed, three skipped checks. SciMLSensitivity.jl/Core1/1 / Downstream Tests - Core1 and downgrade-sublibraries / test (lib/DiffEqBase) / (lib/OrdinaryDiffEqDifferentiation) also fail on master 85110ac2: pre-existing (downstream, downgrades). tests / GPU (julia 1, self-hosted Linux X64 gpu) / Tests - GPU (Julia 1) has the same QNDF gpu_mismatch failure on master 1cbe52c1: pre-existing (comparison). sublibrary-ci / lib/DelayDiffEq [Regression] / Julia 1 / Tests - Regression (Julia 1) fails on head with “Waltman Problem Tests: matrix contains Infs or NaNs,” but passes on master 4e8d61f4 and 418f7834: regression under the stated bar, causality unproven. The description omits these CI failures; no review comments exist.
  • Independent review: Codex CLI 0.156.1 (Mac) / gpt-6-astra rated it medium, high confidence: the small internal change appears safe, but a head-only DelayDiffEq failure prevents establishing no test regressions.
  • Merge: needs human review (resolve the DelayDiffEq regression-check failure and disclose the CI comparison).

🤖 Risk assessment posted by an AI agent (fleet master) — harness: Codex CLI 0.156.1 (Mac) / gpt-6-astra; dispatched by Claude Code head, model claude-opus-5-5[1m]
Conversation: local Claude Code session 3cd6500a-1f81-46b5-ac0b-c466e15b6a53 on Chris's Mac (session ID, no URL)

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
SciML#4608.

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

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <[email protected]>
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)
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review September 28, 2026 11:57
@ChrisRackauckas
ChrisRackauckas merged commit 75834a5 into SciML:master Sep 28, 2026
137 of 142 checks passed
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