Skip to content

Import alg_adaptive_order / alg_can_repeat_jac in Feagin and StabilizedIRK (#4811) - #4812

Merged
ChrisRackauckas merged 3 commits into
SciML:masterfrom
ChrisRackauckas-Claude:agent/4811-feagin-irkc-imports
Nov 2, 2026
Merged

ChrisRackauckas merged 3 commits into
SciML:masterfrom
ChrisRackauckas-Claude:agent/4811-feagin-irkc-imports

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Please ignore until reviewed by @ChrisRackauckas.

Fixes #4811.

What changed and why

alg_adaptive_order(::Feagin10) = 8, alg_adaptive_order(::Feagin14) = 12 and alg_can_repeat_jac(::IRKC) = false were defined without importing the names from OrdinaryDiffEqCore, so they were local functions that Core never calls. This PR imports them. IRKC's alg_adaptive_order(alg::IRKC) = 1 is deleted rather than imported, because Core's fallback alg_order - 1 already returns 1.

Behavioural effect: Feagin10/14 now report adaptive orders 8/12 instead of 9/13. Only IController, PIDController and PredictiveController read this. The default PIController takes its gains from alg_order and is unchanged. Nothing in the ODE sublibraries reads alg_can_repeat_jac for IRKC (the only reader is OrdinaryDiffEqFIRK), so the IRKC change only corrects the declared value.

Verification (Julia 1.12.7, master cceca42 + this commit)

New assertions with the src changes stashed (unfixed):

alg_adaptive_order extends OrdinaryDiffEqCore: Test Failed
   Evaluated: 9 == 8
   Evaluated: 13 == 12
alg_can_repeat_jac extends OrdinaryDiffEqCore: Test Failed
   Evaluated: true == false

With the fix:

alg_adaptive_order extends OrdinaryDiffEqCore |    2      2
alg_can_repeat_jac extends OrdinaryDiffEqCore |    1      1

julia +1.12 --project=lib/<Lib> -e 'using Pkg; Pkg.test()' (GROUP=ALL: Core + QA):

== OrdinaryDiffEqStabilizedIRK
IRKC Tests       | Pass 7
Allocation Tests | Broken 1   (pre-existing marker)
JET Tests        | Pass 1
Aqua             | Pass 21
     Testing OrdinaryDiffEqStabilizedIRK tests passed
== OrdinaryDiffEqFeagin
SciMLBase reexport | Pass 2
Feagin Tests       | Pass 32

Runic (--check) is clean on all five files, and typos reports nothing on the diff.

Not verified locally

  • OrdinaryDiffEqFeagin QA group: locally the QA env resolved a held-back GPUCompiler v1.23.0, which fails to precompile on Julia 1.12.7 (UndefVarError: IRBuilder not defined in GPUCompiler) before any QA test runs. This PR does not touch dependencies, and CI's lib/OrdinaryDiffEqFeagin [QA] (Julia 1) job passes on this PR. All Feagin and StabilizedIRK CI jobs (Core lts/1/pre, QA, downgrade) pass. The four failing checks are SciMLSensitivity downstream, GPU, and the DiffEqBase/OrdinaryDiffEqDifferentiation downgrade jobs, none of which this PR touches.
  • Step counts of Feagin10/14 under the non-default controllers. No existing test pins them.
  • Julia LTS / pre, and downstream packages.

Risk assessment

  • Risk: medium (the higher of the two independent ratings)
  • Blast radius: Feagin10/14 adaptive stepping under the I/PID/Predictive controllers (the default PIController is unchanged), and the value IRKC reports for alg_can_repeat_jac, which nothing in the ODE sublibraries currently reads for IRKC. No signature changes. The return values of two documented public traits (alg_adaptive_order, alg_can_repeat_jac) change to the values their authors wrote.
  • Evidence: fail-before/pass-after above. Both sublibraries' Core tests pass and StabilizedIRK QA passes locally. In CI, every Feagin/StabilizedIRK job passes; the four failures match master cceca42 (detail from the fleet master's Astra run in the section below).
  • Independent review: Cursor Agent (auto) rated it low risk, high confidence, MERGE. Codex gpt-6-astra (round 2 here, and separately the fleet master's run below) rated it medium, high confidence, CHANGES. Its one blocker is SemVer: it holds that changing a public trait's return value needs major bumps of OrdinaryDiffEqFeagin (2.3.0) and OrdinaryDiffEqStabilizedIRK (2.1.3). Every technical claim was confirmed by both reviewers by running.
  • Merge: needs human review. Decision for @ChrisRackauckas: patch release as a bug fix (my recommendation: the old values came from a missing import, not a design choice), or major bumps as Astra asks.

Source edits were written by Devin CLI 3000.11.3 (model swe-2-high), which had no working shell. The test fix (IRKC test importing OrdinaryDiffEqCore), the verification and this PR are from Claude Code.

🤖 Generated with Claude Code (model: claude-opus-5-5[1m]) and Devin CLI (model: swe-2-high)

https://claude.ai/code/session_015tNYhuzygK9z8yhh6MNCAz

Fleet master's independent risk assessment

  • Risk: medium
  • Blast radius: Feagin10/14 adaptive stepping under I/PID/Predictive controllers and downstream consumers of IRKC’s Jacobian-reuse trait. Both traits are declared public; their return values change. No new non-public dependency calls or weakened tests.
  • Evidence: Head 0f2da219 has 128 passing checks and four failures, all pre-existing on master cceca424: SciMLSensitivity.jl/Core1/1 / Downstream Tests - Core1 has the same MooncakeAdjoint constructor error; tests / GPU (julia 1, self-hosted Linux X64 gpu) / Tests - GPU (Julia 1) has the same three QNDF failures; downgrade-sublibraries / test (lib/DiffEqBase) has the same identity assertion and three callback errors; downgrade-sublibraries / test (lib/OrdinaryDiffEqDifferentiation) has the same ScalarOperator diag error. No observed test regressions. No review comments exist.
  • Independent review: Codex CLI 0.156.1 / gpt-6-astra rated it medium, high confidence: the narrow dispatch fix has matching baseline CI failures, but changes public trait behavior and controller stepping without controller-level regression coverage.
  • Merge: needs human review (the description discloses numerical changes but incorrectly claims “No public API change”; resolve SemVer treatment of changed public behavior before merging).

🤖 Risk assessment posted by an AI agent (fleet master) — harness: Codex CLI 0.156.1 / gpt-6-astra; dispatched by Devin CLI 3000.11.3 fleet-master head, model Fusion (claude-opus-5-5 medium + swe-2 medium)
Conversation: local transcript (no session URL)

ChrisRackauckas and others added 2 commits October 8, 2026 00:15
…edIRK

The Feagin10/14 alg_adaptive_order and IRKC alg_can_repeat_jac methods
were defined without importing the names, so they created local
functions that OrdinaryDiffEqCore never dispatches to. Import them, and
drop IRKC's alg_adaptive_order, which equals Core's fallback.

Fixes SciML#4811

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Devin <noreply@cognition.ai>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Agent-Harness: Devin CLI devin 3000.11.3 (9c803229faa4) (source edits) / Claude Code (tests, verification)
Agent-Model: swe-2-high / claude-opus-5-5[1m]
Agent-Session: https://claude.ai/code/session_015tNYhuzygK9z8yhh6MNCAz ; Devin local log ~/.local/share/devin/cli/logs/devin_20261007-230500_3918525.log
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Devin <noreply@cognition.ai>
Agent-Harness: Devin CLI 3000.11.3 (conflict resolution), Claude Code 2.1.285 (orchestration)
Agent-Model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium
Agent-Session: local Claude session 3c311569-dda6-4687-bc9f-65febb212c33 (fleet master); Devin log /Users/chrisrackauckas/sandbox/master/fusion-fixes/SciML_OrdinaryDiffEq.jl-4812/log.txt
@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Merged the default branch into this PR (clean merge, no conflicts; head af19755) so CI runs on current master. Its earlier failures in SciMLSensitivity Core1 and the downgrade jobs were fixed on master after this PR's last CI run.


🤖 Posted by an AI agent — harness: Devin CLI 3000.11.3 (merge), Claude Code 2.1.285 (posting) · model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium
Conversation: local Claude session 3c311569-dda6-4687-bc9f-65febb212c33 (fleet master)

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Independent review (Codex CLI 0.166.0 / gpt-6.1-sol), session 01a19791-98e2-7201-bf7b-19f6c7633e4a, reviewed head fbc267e

  • Verdict: MERGE
  • Risk: medium-low (ML2: non-default numerical-controller correction with independent analytic/convergence evidence and personally reproduced failing-before/passing-after assertions).
  • Round / slot: 1 / 1
  • Blocking priorities: none

Review written by the reviewer named above in a session other than the PR author's, and copied here by the posting agent without change to its findings. The posting agent did not re-run the reviewer's commands.

Summary: Corrects the core dispatch of Feagin10/14 adaptive-order traits and IRKC's Jacobian-reuse trait, and removes a redundant local IRKC method. The added assertions fail on the unfixed base and pass at head, both focused test files pass at head, and the default PI trajectories match.

Blast radius: Feagin10/14 adaptive stepping with I/PID controllers and the declared IRKC Jacobian-reuse trait. The only ODE-subpackage consumer of the latter trait is FIRK, so IRKC execution currently does not consume it. No default algorithm selection, default PI gains, public signatures, dependencies, or existing tests change.

Evidence: Added assertions: head 3/3 pass; base 3/3 fail (9 versus 8, 13 versus 12, true versus false). Both focused files pass at head, including convergence and matrix-exponential references. Default PI saved time/value arrays are identical for both Feagin methods on an exponential-decay problem. The final independent controller-factor probe passed 2 PID assertions and failed 2 overly strict I-controller precision assertions; its planned trajectory tests did not execute. CI: 131 successful checks, 3 skipped matrix placeholders, 1 failing SciMLSensitivity check with the exact same failure independently found on master.

Blocking findings

None.

Non-blocking findings

None.

What I ran

Local artifact locations in these command records are represented by environment-variable placeholders; source references are repository-relative. Julia was 1.13.2 on aarch64 Linux. Exactly three Julia runs completed; no test was rerun.

  • Read the complete review rules, then ran git fetch origin '+refs/pull/4812/head:refs/remotes/pr/4812' master, git fetch origin '+refs/heads/master:refs/remotes/origin/master', git checkout --detach pr/4812, git rev-parse HEAD origin/master, git merge-base origin/master HEAD, and git diff origin/master...HEAD (exit 0). Reviewed all five changed files and trait/controller callers; root AGENTS.md and CLAUDE.md are absent. The fetched master tip is d035621; GitHub's reported PR base and the merge-base are the Base SHA above. Sealed INITIAL.md with sha256sum INITIAL.md > INITIAL.sha256 before reading author context.
  • gh pr view 4812 --repo SciML/OrdinaryDiffEq.jl --json number,url,state,isDraft,headRefOid,baseRefName,baseRefOid (exit 0): open draft, head matches TARGET. Subsequently read the PR body and gh issue view 4811 --repo SciML/OrdinaryDiffEq.jl --json title,body (exit 0). Used gh api --paginate repos/SciML/OrdinaryDiffEq.jl/pulls/4812/commits (exit 0) to select the last one-parent PR commit, 0f2da21, for the author trailers; did not use trailers from merged-in base commits.
  • Head: JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 TMPDIR="$REVIEW_TMP" JULIA_DEPOT_PATH="$REVIEW_DEPOT:" JULIA_PKG_PRECOMPILE_AUTO=0 timeout 3600 julia +1.13.2 --startup-file=no --project="$HEAD_ENV" "$TEST_HARNESS" head "$HEAD_TREE" (exit 0). The temporary environment sources local libraries and adds the focused files' test dependencies. The harness calls Pkg.instantiate(; allow_autoprecomp=false) and includes lib/OrdinaryDiffEqFeagin/test/ode_feagin_tests.jl and lib/OrdinaryDiffEqStabilizedIRK/test/irkc_tests.jl in separate modules, preserves failures, and exits nonzero if either file fails. Output: adaptive-order assertions 2/2; JLArray analytic-reference checks 24/24; Feagin convergence assertions pass; IRKC trait 1/1, power iteration 4/4, matrix-exponential in-place/out-of-place comparison 2/2; both FILE_PASS.
  • Base: git archive 59ba40e4b5bbae713d8df7b792f6ea62f033ff78 -o "$BASE_ARCHIVE" and extraction (exit 0), followed by JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 TMPDIR="$REVIEW_TMP" JULIA_DEPOT_PATH="$REVIEW_DEPOT:" JULIA_PKG_PRECOMPILE_AUTO=0 timeout 3600 julia +1.13.2 --startup-file=no --project="$BASE_ENV" "$TEST_HARNESS" base "$HEAD_TREE" (exit 1, expected). The same added head tests run against the two unfixed base libraries; unchanged local dependencies retain identical head source and dependency versions. Base instantiation additionally disables registry updates. Output: Evaluated: 9 == 8, Evaluated: 13 == 12, Evaluated: true == false; both FILE_FAIL. Each file stops at its failing added testset, so the remaining base numerical tests were not run. The harness still computes default PI trajectories for u'=-u, u(0)=1, t in [0,1], abstol=reltol=1e-10. A Python comparison of the complete printed time/value arrays finds both identical between base and head.
  • Independent probe: JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 TMPDIR="$REVIEW_TMP" JULIA_DEPOT_PATH="$REVIEW_DEPOT:" JULIA_PKG_PRECOMPILE_AUTO=0 timeout 3600 julia +1.13.2 --startup-file=no --project="$HEAD_ENV" "$ADVERSARIAL_HARNESS" (exit 1). For each Feagin method, initialized I and PID controllers with error estimate 0.25, disabled I-controller safety scaling/clipping, and compared controller factors with the independent power law from embedded orders 8/12. PID with coefficients (1,0,0) and identity limiter returned exactly 4^(1/9) = 1.1665290395761165 and 4^(1/13) = 1.1125314760964868; both assertions passed. I returned 0.8572440147399902 and 0.8988509774208069 versus exact-power references 0.8572439828530728 and 0.8988509731955419. Both failed the reviewer's inappropriate rtol=1e-12. Source inspection of the resolved FastPower 1.5.1 confirms its documented Float32 logarithm/exponent approximation; the unchanged I-controller call at lib/OrdinaryDiffEqCore/src/integrators/controllers.jl:675 uses that approximation. These differences are consistent with that existing approximation, rather than a dispatch regression; the old exponents would instead be 1/10 and 1/14. The testset failure aborted the planned BigFloat analytic logistic trajectory checks before they ran. No tolerance was changed and no fourth Julia run was made. G1 evidence rests on the passing analytic/convergence tests and independently derived controller factors; this probe is explicitly not reported as wholly passing.
  • gh pr checks 4812 --repo SciML/OrdinaryDiffEq.jl (exit 1 because one check fails). Inspected sublibrary CI, including passing Feagin and StabilizedIRK Core checks on lts/1/pre and QA on 1, and downgrade CI, where both libraries pass. Ran gh run list --repo SciML/OrdinaryDiffEq.jl --branch master --event push --limit 5 --json databaseId,conclusion,headSha,url,workflowName (exit 0). Retrieved failed logs with gh run view 38872050698 --repo SciML/OrdinaryDiffEq.jl --log-failed and gh run view 41249816054 --repo SciML/OrdinaryDiffEq.jl --log-failed (exit 0 after redirecting gh's cache into writable scratch space). PR failure and master IntegrationTest both fail in SciMLSensitivity Core4 at test/Core4/ensembles.jl:19: EnsembleThreads(), AssertionError: mi2 !== nothing, Enzyme src/rules/parallelrules.jl:233; both report 15 passed, 0 failed, 1 errored, 2 broken. The initial log-download attempts failed solely because gh's default cache was read-only.

What I did not verify

The planned analytic logistic trajectory checks under I/PID did not run because the final probe stopped at its I-controller precision assertions. Thus no end-to-end adaptive-trajectory accuracy claim is made for those non-default controllers beyond the independently checked factor formulas and existing solver accuracy tests. No full package suites or Pkg.test(), local QA/docs builds, hardware GPU execution, AD transformations, Reactant, MPI, or local downstream suites were run. The diff introduces no GPU kernel, AD rule, Reactant, or MPI implementation. PredictiveController execution was not exercised locally; source inspection shows it reads the corrected adaptive-order trait, but its generic execution also expects nonlinear-solver cache fields absent from Feagin. Numerical base tests beyond the deliberately failing new assertions were not executed. Equality of default PI output was checked on the stated scalar decay problem, not every possible input. IRKC's declaration test verifies the corrected trait; there is no active IRKC reuse call site to exercise.

🤖 Posted by an AI agent — harness: Claude Code · model: claude-sonnet-5-5
Conversation: https://claude.ai/code/session_01379heiiB35TtywhR7uSU74

@ChrisRackauckas-Claude
ChrisRackauckas-Claude marked this pull request as ready for review November 2, 2026 02:02
@ChrisRackauckas
ChrisRackauckas merged commit 6fc965e into SciML:master Nov 2, 2026
134 of 135 checks passed
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.

Feagin10/14 and IRKC alg_utils methods are dead local functions (not imported from OrdinaryDiffEqCore)

2 participants