Skip to content

Fix Feagin12 tableau: c[2] should be 0.2, not 2 - #5002

Open
bobby404-K wants to merge 4 commits into
SciML:masterfrom
bobby404-K:fix-feagin12-c2-typo
Open

bobby404-K wants to merge 4 commits into
SciML:masterfrom
bobby404-K:fix-feagin12-c2-typo

Conversation

@bobby404-K

Copy link
Copy Markdown

Fixes #5001

ET.Feagin12 had c[2] = 2, a dropped decimal point. It should be 0.2,
consistent with A[2,1] = 0.2 and with the native Feagin12() solver
(c1 = 1//5).

Because c is only used to evaluate f(u, p, t + c[i]*dt), this only affected
non-autonomous problems solved through ExplicitRK(tableau = ET.Feagin12());
all existing tests used autonomous problems, so it went unnoticed.
The native Feagin12() solver is unaffected.

Changes:

  • Fix c[2] in Feagin12.
  • Add a tableau consistency test that c == sum(A, dims = 2) for the high-order tableaus.
  • Add a non-autonomous convergence test (u' = u*cos(t)) for Feagin12/14.

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Reported by @rcgiri-physics in #5001. A scan of the other explicit tableaus in
OrdinaryDiffEqExplicitTableaus found no other c vs. row-sum mismatches
among the entries written as plain convert(T, big"...") values. The new
consistency test covers Feagin12, Feagin14 and Ono12.

I used Claude (AI) for some assistance with this PR; I reviewed all changes myself and ran the tests locally.

@ChrisRackauckas

Copy link
Copy Markdown
Member

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

@bobby404-K, thanks for the Feagin12 fix. c[2] = 0.2 matches A[2,1] = 0.2, so the one-line source change looks right. Three things to change before this can be reviewed:

  1. lib/OrdinaryDiffEqExplicitTableaus/Project.toml is reshuffled: [extras] moves below [compat], authors and version swap, and the SciMLTesting entries move within the file. None of this is related to the fix. Please restore that file to the base version (the PR then touches only the tableau source and the test).
  2. In test/core_tests.jl the @testset "Tableau consistency: c equals row sums of A" line is indented one level too deep, so the formatter check will fail. Please run the repository formatter (Runic) on the changed files.
  3. The PR body has no risk assessment. A change to a numerical tableau is at least medium risk. Please add the block from the contributor guidelines with the criterion that sets the level. Leave the "Independent review" line out until a review exists.

No CI has run on this head yet. Maintainers decide when workflows are approved for outside contributions, so nothing here depends on you.


🤖 Posted by an AI agent — harness: Claude Code 2.1.325 · model: claude-sonnet-5-5
Conversation: local session 3878b54e-28f2-4a01-a176-a8f5468d1997 (no session URL)

@bobby404-K

bobby404-K commented Nov 17, 2026 •

Copy link
Copy Markdown
Author

Thanks for the review! Addressed all three:

  1. Restored lib/OrdinaryDiffEqExplicitTableaus/Project.toml to the base version — the PR now touches only tableaus_high_order.jl and core_tests.jl.
  2. Ran Runic on the changed files; the @testset indentation is fixed.
  3. Added a risk assessment block (Medium) to the PR body.

@ChrisRackauckas

Copy link
Copy Markdown
Member

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

PR: #5002

Reviewed head: a978d1c
Raw SHA-256: bd2ad1dd00083339554c39fd68a3692e1309fb1faa8ec20221770552e4af0abf
Source SHA-256: cc3504da5c1e00ca16dd4e2b91e984e73e69ab377b0d41852a39faf469b837bf
Source: standard-review-v1 (harness-log)
Reviewer session: f352078d-ce6f-4a72-a7f2-d120e44e7836
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes
Redaction: ran (substitutions=0)

Risk assessment

  • Risk: medium-low (ML2)
  • Verdict: MERGE
  • Reviewed head: a978d1c

Review report

VERDICT: MERGE
Round: 1
Head: a978d1c
Slot: 1
CI: CI is not green
Session: f352078d-ce6f-4a72-a7f2-d120e44e7836
Reviewer: Antigravity CLI 1.5.10; model: gemini-4-carbon-high

  • Blocking priorities: none

Risk

medium-low (ML2: fixes peripheral ExplicitRK tableau OrdinaryDiffEqExplicitTableaus.Feagin12 node c[2] from 2 to 0.2; main OrdinaryDiffEq lanes and OrdinaryDiffEqFeagin.Feagin12 are untouched, autonomous trajectories are bit-for-bit unchanged, and non-autonomous analytic convergence fails before and passes after)

Blocking findings

None.

Non-blocking findings

  • lib/OrdinaryDiffEqExplicitTableaus/src/tableaus_high_order.jl:3705 — c is allocated as zeros(T_time, 25) (line 3702), while c[2] = convert(T, big".2") (matching pre-existing c[3]..c[25] at lines 3706-3782) converts through the state element type T before setindex! converts to T_time. Confirmed by running OrdinaryDiffEqExplicitTableaus.Feagin12(Float32, Float64) on the build host: eltype(tab.c) is Float64, yet tab.c[2] is truncated to Float32 precision (0.20000000298023224, |tab.c[2] - 0.2| = 2.98e-9). Suggested fix: convert time nodes directly with convert(T_time, big".2") (here or across tableaus_high_order.jl in a follow-up).
  • lib/OrdinaryDiffEqExplicitTableaus/test/core_tests.jl:225-236 — setprecision(400) mutates global/task BigFloat precision without a do block (matching earlier testsets in the file), and @testset "Non-autonomous high-order convergence (catches wrong c)" tests Feagin12 and Feagin14 while omitting Ono12 (tested in the adjacent consistency block at line 218) and Feagin10. Confirmed by running test_convergence on the same problem with Ono12(BigFloat) (sim.𝒪est[:l∞] = 11.95) and Feagin10(BigFloat) (sim.𝒪est[:l∞] = 10.02). Suggested fix: scope precision with setprecision(BigFloat, 400) do ... end and include ET.Feagin10(BigFloat) and ET.Ono12(BigFloat).

What I ran

  • julia --version on the build host -> julia version 1.13.2
  • uv run --locked python --version on the build host -> warning: --locked has no effect when used outside of a project / Python 3.15.0 (this is a pure Julia repository using Project.toml with no uv.lock or Python code)
  • typos lib/OrdinaryDiffEqExplicitTableaus/src/tableaus_high_order.jl lib/OrdinaryDiffEqExplicitTableaus/test/core_tests.jl -> exit 0
  • julia --project=@runic -m Runic --check lib/OrdinaryDiffEqExplicitTableaus/src/tableaus_high_order.jl lib/OrdinaryDiffEqExplicitTableaus/test/core_tests.jl -> exit 0
  • GROUP=OrdinaryDiffEqExplicitTableaus julia --project=. -e 'using Pkg; Pkg.test()' on the build host -> 277/277 passed (43.2s)
  • GROUP=OrdinaryDiffEqExplicitTableaus_QA julia --project=. -e 'using Pkg; Pkg.test()' on the build host -> 21/21 Quality Assurance tests (Aqua, ExplicitImports, JET) passed (15.8s)
  • Targeted numerical probes on the build host (confirmed by running in an isolated scratch environment):
    • Row-sum consistency across all 89 ExplicitRKTableau constructors in OrdinaryDiffEqExplicitTableaus: all 9 high-order tableaus (Baker10, Curtis10, Feagin10, Feagin12, Feagin14, Hairer10, MSRK10, Ono10, Ono12) satisfy max|c - sum(A, dims=2)| <= 1.33e-74 and |sum(α) - 1| <= 1.52e-77 at both default 256-bit and 400-bit BigFloat precision; Feagin12 drops from 1.8 before the fix to 9.50e-77 (256-bit) and 7.50e-77 (400-bit), well within atol = 1.0e-60 (and consistent with A[2, 1] = big".2" at line 3783 and $m$-symmetric c[24] = big".2" at line 3781).
    • Failing-before / passing-after check on the PR's non-autonomous linear ODE $u' = u\cos(t)$ with exact solution $u(t) = u_0 e^{\sin t}$ (dts = 1 ./ 2 .^ (6:-1:3), 400-bit BigFloat): unfixed Feagin12 (c[2] = 2) gives sim.𝒪est[:l∞] = 1.05 (fails >= 11.7); fixed Feagin12 (c[2] = 0.2) gives 11.85 (passes >= 11.7); Feagin14 gives 14.49 (passes >= 13.7).
    • Nonlinear non-autonomous probe $u' = -u^2 \sin(t)$, $u(0) = 1$, exact $u(t) = (2 - \cos t)^{-1}$: unfixed Feagin12 gives sim.𝒪est[:l∞] = 0.98; fixed Feagin12 gives 13.05.
    • Cross-implementation check against OrdinaryDiffEqFeagin.Feagin12() (lib/OrdinaryDiffEqFeagin/src/feagin_tableaus.jl:699,975, where c1 = 1 // 5) on a 2D non-autonomous nonlinear ODE (du[1] = cos(t)*u[1] - sin(2t)*u[2]^2, du[2] = exp(-t/3)*u[1]*u[2] + sin(t)*u[2], fixed dt = 0.1, 400-bit BigFloat): ||u_tab(0.8) - u_feagin(0.8)||_∞ = 1.99e-60, matching the 60-digit precision of OrdinaryDiffEqFeagin's string literals.
    • Autonomous ODE invariance check (u' = -0.5u + u^2/10, fixed dt = 0.125, 400-bit BigFloat): sol_unfixed.u == sol_fixed.u is true (bit-for-bit identical).
    • Rooted-tree order conditions (DiffEqDevTools.residual_order_condition for p = 1:12): confirmed autonomous tree residuals are <= 1.78e-77 both before and after, explaining why pre-existing autonomous checks missed c[2] = 2.

What I did not verify

  • GitHub Actions logs behind the CI: CI is not green status (code-only blind review; GitHub was not queried).
  • Unrelated root OrdinaryDiffEq test groups (Interface, Integrators, Regression, Downstream, GPU, AD) and Julia 1.10 LTS, as the diff modifies only lib/OrdinaryDiffEqExplicitTableaus/src/tableaus_high_order.jl and lib/OrdinaryDiffEqExplicitTableaus/test/core_tests.jl.

AUTHOR_GRADE: {"task": "bugfix", "score": 5, "difficulty": 2, "rounds": 1, "author_harness": "unknown", "author_model": "unknown", "note": "Fixes an unambiguous decimal-point typo (c[2] = 2 -> 0.2) in OrdinaryDiffEqExplicitTableaus.Feagin12, restores accidental Project.toml churn, formats cleanly with Runic, and adds both a row-sum consistency check and an analytic non-autonomous BigFloat convergence test that fails before (order 1.05) and passes after (order 11.85)."}

Head link: a978d1c


🤖 Posted by an AI agent — harness: Antigravity CLI 1.5.10 · model: gemini-4-carbon-high
Conversation: local session f352078d-ce6f-4a72-a7f2-d120e44e7836 (no session URL)

@bobby404-K

Copy link
Copy Markdown
Author

@ChrisRackauckas this is ready for a human review when you have time. It fixes the
Feagin12 tableau typo (c[2] = 2 -> 0.2) from #5001 and adds the non-autonomous
convergence test you asked for, plus a c == row-sums consistency check. I also
applied the non-blocking test suggestions from the automated review.

The remaining failing CI jobs look unrelated to the DiffEqDevTools downgrade failure is
tracked in #5006 the ExplicitTableaus Core and QA jobs pass. Happy to change
anything:) Thanks!

@singhharsh1708

Copy link
Copy Markdown
Member

LGTM, Feagin12 goes from order ~1.1 to ~11.6 on u' = u cos(t) with this. Runic still flags the trailing spaces on the blank line at test/core_tests.jl:214.

@bobby404-K

Copy link
Copy Markdown
Author

@singhharsh1708! Thanks! Fixed the trailing whitespace on core_tests.jl:214; Runic is clean now.

@singhharsh1708 singhharsh1708 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@bobby404-K

Copy link
Copy Markdown
Author

@singhharsh1708 Thanks! for reviewing it.

This branch has not been deployed

No deployments
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.

constructFeagin12: c[2] is 2, should be 0.2

3 participants