Skip to content

Preserve QNDF controller steps during clock alignment - #4651

Open
xbtmkmmm5 wants to merge 4 commits into
SciML:masterfrom
xbtmkmmm5:fix/qndf-clock-rounding
Open

xbtmkmmm5 wants to merge 4 commits into
SciML:masterfrom
xbtmkmmm5:fix/qndf-clock-rounding

Conversation

@xbtmkmmm5

Copy link
Copy Markdown

Clock-aligning every adaptive step proposal can change a QNDF controller request
to keep its current step by a few floating-point bits. QNDF then rescales its
difference history and resets nconsteps, changing later step and order choices.
This restores the original QNDF step sequence by marking the QNDF family with
the existing ismultistep trait and preserving multistep controller proposals.
Other methods retain clock alignment, including the tight-tolerance Rodas5P
reference used by the implicit Taylor convergence tests. The trait's default
also covers the shared SDE/RODE path.

Addresses #4638. No tests, tolerances or solver parameters were changed.

Local validation:

  • Original implicit Taylor convergence file: 4/4 on Julia 1.12.6.
  • Original BDF regression and time-reversal files: 42/42 and 20/20 on Julia 1.10.12.
  • Original GPU case's CPU setup: the complete step/history trace exactly matches
    a run with the clock-rounding hunk removed (29 accepted, 2 rejected steps).
  • ODE/DAE/SDE/RODE trait dispatch and Runic formatting checks pass.

CUDA validation is pending on the GPU runner; the CPU comparison alone does not
establish that the GPU job passes. Local solver tests used CI baseline 746463b;
this patch applies cleanly to master 85110ac, with the same QNDF implementation
and GPU test case.

ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/OrdinaryDiffEq.jl that referenced this pull request Oct 7, 2026
…ment

The clock alignment added in 498c765 (SciML#4592) snaps the proposed step so
t + dt lands exactly on the floating-point grid, perturbing dt by up to
one ulp of t. Delay-integrator lag and discontinuity bookkeeping is tied
to the un-shifted step size; on the RADAR5 Waltman problem the perturbed
trajectory diverges (u ~ 1e178 feeds a ~5e-21 lag denominator, the
Jacobian goes non-finite, and GenericFactorization(lu!) throws
"matrix contains Infs or NaNs"). This made lib/DelayDiffEq
GROUP=Regression fail under Pkg.test / CI, which run with
--check-bounds=yes. Exempt AbstractDDEIntegrator from the alignment,
matching the multistep carve-out of SciML#4651; ODE integrators are
unchanged.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <[email protected]>
Agent-Harness: Devin CLI 3000.11.3
Agent-Model: swe-2-high
Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/qa-hygiene/jobs/dde-waltman/log.txt on amdci2
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

🤖 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 01a1980a-fcfe-7cf3-9cef-4b3241fb3695, reviewed head 7b17a3b

  • Verdict: CHANGES
  • Risk: medium-high (MH1: an inactive composite constituent changes active Tsit5 step proposals and can reintroduce accumulated state/time drift).
  • Round / slot: 1 / 1
  • Blocking priorities: P2

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: The patch preserves adaptive QNDF controller proposals to avoid unnecessary history rescaling. Its composite-algorithm check also disables clock alignment for an active single-step solver when an inactive QNDF member is present, requiring correction.

Blast radius: Adaptive QNDF1/QNDF2/QNDF and their QBDF aliases, composites containing them, and the shared OrdinaryDiffEqCore proposal hook; other algorithms retaining a false trait still use clock alignment.

Evidence: Blind assessment sealed before author context; head and merge-base time-reversal tests each pass 20/20. Reviewer proposal-invariance assertions fail for all three QNDF types at the merge-base and pass at the head. Independent exponential checks pass both revisions; the head analytic clock probe fails for an active Tsit5 composite (maximum error 2.34e-7 versus 5.96e-9 standalone). GPU CI exercises the reported regression and passes.

Blocking findings

  1. [P2] Preserve clock alignment for the active single-step constituent — lib/OrdinaryDiffEqCore/src/integrators/integrator_utils.jl:1221 (confirmed by running). The new condition tests ismultistep(integrator.alg), but lib/OrdinaryDiffEqCore/src/alg_utils.jl:300 computes this trait with any over every composite member. Consequently CompositeAlgorithm((Tsit5(), QNDF()), i -> 1) disables alignment although it runs only Tsit5. For the analytic problem u′ = 1, u(1e8) = 0, over (1e8, 1e8 + 10), with dt=0.1, abstol=reltol=1e-12 and controller=PIController(Tsit5(); qmin=1.0, qmax=1.0), both solves return Success, but the composite has maximum error 2.3396950687981644e-7 versus 5.960464455334602e-9 standalone. The independent bound is eps(1e8) + 200eps(10.0) = 1.4901516465215536e-8, allowing the initial unaligned step and state-arithmetic roundoff. An inactive fallback should not change the active solver's clock intervals: this restores the state/time drift that the retained alignment code prevents. Check the active cache/algorithm constituent, keeping QNDF proposals untouched only while QNDF is active, and add an analytic accuracy regression for mixed composites and switching.

Non-blocking findings

None.

What I ran

Git inspection used git rev-parse HEAD origin/master, git fetch origin master '+refs/pull/4651/head:refs/remotes/pr/4651', git diff --stat origin/master...HEAD, git diff origin/master...HEAD, and git merge-base origin/master HEAD (exit 0). The diff merge-base and PR-reported base are 85110ac2a61a5e8a372476496a51de0c24b9fa0b; the header records fetched master. Base tests use an isolated archive of that merge-base, not today's master. The checkout was already detached at the live PR head. codex --version reported codex-cli 0.166.0 (exit 0). Read the specified commit body with git log -1 --format=%B 7b17a3b975fb4f0220a2d0d4e8262afda3bfeb33; neither author trailer exists.

All Julia runs use Julia 1.13.2, four Julia threads, one OpenBLAS thread, an isolated temporary directory and environments outside the checkout. In these command transcriptions, $SHARED_DEPOT denotes the supplied shared depot; machine-specific values are omitted.

JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 JULIA_PKG_PRECOMPILE_AUTO=0 TMPDIR="$PWD/tmp" JULIA_DEPOT_PATH="$SHARED_DEPOT:" timeout 3600 julia +1.13.2 --startup-file=no --project=env-head tmp/run-head.jl
JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 JULIA_PKG_PRECOMPILE_AUTO=0 TMPDIR="$PWD/tmp" JULIA_DEPOT_PATH="$SHARED_DEPOT:" timeout 3600 julia +1.13.2 --startup-file=no --project=env-base tmp/run-base.jl
JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 JULIA_PKG_PRECOMPILE_AUTO=0 TMPDIR="$PWD/tmp" JULIA_DEPOT_PATH="$SHARED_DEPOT:" timeout 3600 julia +1.13.2 --startup-file=no --project=env-head tmp/probe-head.jl

Head run: instantiated an isolated environment with local dependency paths, without registry updates or automatic package precompilation, then included lib/OrdinaryDiffEqBDF/test/bdf_time_reversal_tests.jl: exit 0, 20 passed / 20 total.

Merge-base run: the same existing test file passed 20/20. Reviewer checks then produced 24 passed, 3 failed, 1 errored (exit 1). The three expected failures assert dtpropose == 0.1 for QNDF1/QNDF2/QNDF at t=1e8; each observed 0.09999999403953552. Twelve exponential-decay solves, covering all three types, scalar/in-place state and both time directions, passed 24 return-code/analytic-accuracy assertions. The clock subtest errored because my probe supplied obsolete top-level qmin/qmax options; this is a reviewer-script error, not a package defect. The head clock probe uses controller=PIController(Tsit5(); qmin=1.0, qmax=1.0) instead. The base run was not repeated.

The PR adds no regression test. Its existing time-reversal test passes both revisions, so that file does not demonstrate this fix failing before. The reviewer's proposal-invariance checks fail before and pass after for all three QNDF types. This verifies the local proposal contract, not the original GPU failure from my own runs.

Final head probe: exit 1, 30 passed, 1 failed, 0 errored. All three held-proposal assertions pass (proposed=0.1 requested=0.1), and all 24 exponential return-code/accuracy assertions pass. These compare against exp(-t) with the conservative first-order global-error scale 4sqrt(1e-7) at local tolerances 1e-7; they are smoke accuracy checks, not a measured convergence-order claim. The sole failure is the composite clock-accuracy assertion in finding 1. Both clock solves take 36 accepted steps and return Success; standalone proposes 0.09999999403953552, while the composite proposes 0.1. Maximum errors are 5.960464455334602e-9 and 2.3396950687981644e-7, respectively. Exactly three Julia processes were launched, sequentially, with no reruns.

Inspected gh pr view 4651 --repo SciML/OrdinaryDiffEq.jl --json title,body,statusCheckRollup, gh issue view 4638 --repo SciML/OrdinaryDiffEq.jl --json title,body, and gh pr checks 4651 --repo SciML/OrdinaryDiffEq.jl: 254 successful, eight failed and one skipped check. Read failed logs with gh run view <id> --repo SciML/OrdinaryDiffEq.jl --log-failed for Sublibrary CI, Downgrade Sublibraries, and IntegrationTest. Initial log retrieval hit a read-only cache; redirecting XDG_CACHE_HOME to the isolated temporary directory succeeded.

Failures concern GlobalDiffEq callbacks, DelayDiffEq's Waltman problem, ScalarOperator diag, Trapezoid mass-matrix support, DiffEqBase despecialization, and SciMLSensitivity's hybrid loss/Mooncake cases. Compared recent completed master runs using gh run list --repo SciML/OrdinaryDiffEq.jl --branch master --event push --status completed --limit 5, plus the same query restricted to each failing workflow. Master sublibrary logs and master integration logs show different failures; recent completed downgrade runs succeed. I did not establish the PR's eight failures as baseline failures or attribute them to this patch.

Read the head GPU job log with gh run view 36300938795 --repo SciML/OrdinaryDiffEq.jl --job 108568986757 --log: QNDF [jac=CSC, mass=diag_cu] ... ✓, GPU/CPU maximum absolute difference 1.28e-11, and GPU Tests: 173 passed, 12 broken. These broken tests predate the patch. BDF Core, implicit Taylor Core, root AD and stochastic Core checks also report success. GPU exercise is established in CI (G2).

What I did not verify

No local GPU execution or local reproduction of the original GPU mismatch; GPU evidence is from the head CI log. No full package suite, full downstream suite, additional Julia versions, local AD/SDE/RODE/DelayDiffEq runs, or rebase onto current master. The author's historical step/history trace comparison was not reproduced. The base clock-accuracy comparison was not completed because of the reviewer-script keyword error; no second base run was made.

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

ChrisRackauckas added a commit that referenced this pull request Nov 17, 2026
* DelayDiffEq: exempt DDE integrators from calc_dt_propose! clock alignment

The clock alignment added in 498c765 (#4592) snaps the proposed step so
t + dt lands exactly on the floating-point grid, perturbing dt by up to
one ulp of t. Delay-integrator lag and discontinuity bookkeeping is tied
to the un-shifted step size; on the RADAR5 Waltman problem the perturbed
trajectory diverges (u ~ 1e178 feeds a ~5e-21 lag denominator, the
Jacobian goes non-finite, and GenericFactorization(lu!) throws
"matrix contains Infs or NaNs"). This made lib/DelayDiffEq
GROUP=Regression fail under Pkg.test / CI, which run with
--check-bounds=yes. Exempt AbstractDDEIntegrator from the alignment,
matching the multistep carve-out of #4651; ODE integrators are
unchanged.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <[email protected]>
Agent-Harness: Devin CLI 3000.11.3
Agent-Model: swe-2-high
Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/qa-hygiene/jobs/dde-waltman/log.txt on amdci2

* Restore aligned clock intervals for adaptive DDE steps

Remove the DDE exemption from adaptive step alignment. The analytic
large-origin controls fail with accumulated drift before this correction,
and the unchanged Waltman test changes from 2/26 to 26/26 passing.
Add analytic delayed-history and independent-integrator state coverage
to the official Regression group.

DelayDiffEq Regression and QA, Core functional tests, Runic and typos
pass locally. Core QA encounters an inotify EMFILE resource error that
also reproduces on clean latest default and in a standalone OS probe.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.163.0
Agent-Model: gpt-6.1-sol
Agent-Session: local session 01a15cce-5c97-7b23-a6f0-e11b87e67806 (no session URL)

---------

Co-authored-by: ChrisRackauckas-Claude <[email protected]>
Co-authored-by: Devin <[email protected]>
Co-authored-by: Codex <[email protected]>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

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

Classified the eight failures from the 7b17a3b run against the four-file QNDF-only diff:

I found no failure tied to the QNDF clock-alignment change, so I made no code commit. The PR head remains 7b17a3b975.


🤖 Posted by an AI agent — harness: Codex CLI 0.170.0 · model: gpt-6-luna
Conversation: local job 5043-codex (no session URL)

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

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

Current-master comparison for the six remaining red checks

I ran the requested groups on current master 8d5d18912a4f065e558ecc27866f1e4192cdb56d and read the PR-head failure logs. The PR log signatures do not fully match the task labels: the NonlinearSolve Core log shows Trapezoid rejecting non-diagonal mass matrices; the Waltman NaN is in DelayDiffEq Regression. The NonlinearSolve full Core run on master currently errors earlier in Newton tests, so I ran its mass-matrix test file separately.

CI leg Master result PR result Verdict Command / run evidence
sublibrary-ci / lib/OrdinaryDiffEqNonlinearSolve / Tests - Core Full Core stops in Newton Tests with LineSearchException; focused mass-matrix tests pass (92/92 and 88/88 accuracy assertions). The PR log has Trapezoid non-diagonal-mass-matrix errors (including the singular-mass test); it does not show the Waltman NaN named in the task. ENV/FLAKY/UNREPRODUCED for the full group; the reported Trapezoid errors do not reproduce in the focused master test. GROUP=Core julia --project=lib/OrdinaryDiffEqNonlinearSolve -e 'using Pkg; Pkg.test()'; focused mass_matrix_tests.jl. PR job, master job.
sublibrary-ci / lib/OrdinaryDiffEqDifferentiation / Tests - Core Passes with master-resolved SciMLOperators 1.30.4, and also passes with CI-equivalent 1.30.1. diag(::SciMLOperators.ScalarOperator) MethodError with SciMLOperators 1.30.1. PR-INTRODUCED by the requested master-pass/PR-fail comparison. The trace is in TRBDF2/ScalarOperator, outside the QNDF code named in the brief. GROUP=Core julia --project=lib/OrdinaryDiffEqDifferentiation -e 'using Pkg; Pkg.test()'; pinned run GROUP=Core julia --project=<isolated env> -e 'using Pkg; Pkg.test("OrdinaryDiffEqDifferentiation")'. PR job.
downgrade-sublibraries / test (lib/OrdinaryDiffEqDifferentiation) Passes with SciMLOperators pinned to the PR downgrade run’s 1.30.0. Same diag(::ScalarOperator) MethodError; PR downgrade log resolves SciMLOperators 1.30.0. PR-INTRODUCED by the requested master-pass/PR-fail comparison. GROUP=Core julia --project=<isolated env> -e 'using Pkg; Pkg.test("OrdinaryDiffEqDifferentiation")' (SciMLOperators 1.30.0). PR job.
sublibrary-ci / lib/DelayDiffEq [Regression] / Tests - Regression Waltman Problem Tests pass, 26/26. Waltman factorization throws ArgumentError: matrix contains Infs or NaNs. PR-INTRODUCED by the requested master-pass/PR-fail comparison. GROUP=Regression julia --project=lib/DelayDiffEq -e 'using Pkg; Pkg.test()'; PR job, master job.
sublibrary-ci / lib/GlobalDiffEq / Tests - Core Core passes locally, including 43 Companion error-estimator and 35 adjoint/control assertions. Companion global error control throws ArgumentError: GlobalErrorEstimation does not currently support callbacks. PR-INTRODUCED at the Core-group level. The current master group passes; its current test does not exercise the callback path in the PR log. GROUP=Core julia --project=lib/GlobalDiffEq -e 'using Pkg; Pkg.test()'; PR job.
Downstream SciMLSensitivity Core1/Core5 Latest master IntegrationTest at the target SHA passes both Core1 and Core5. Core1: Mooncake MethodError: no constructors have been defined for Any. Core5: Hybrid DE assertion evaluates 11.248298f0 < 1.0 as false. PR-INTRODUCED by the current-master group comparison. This differs from the prior “known-red on master” note; the latest master run is green for both legs. gh run view 45730309549 --job 139610394543 --log and gh run view 45730309549 --job 139610394527 --log; PR Core1, PR Core5, master IntegrationTest.

PR-INTRODUCED verdicts above are comparison results, not proof that the QNDF change caused each failure. The PR CI is from September; current master tests are from November and dependency resolution differs. In particular, both ScalarOperator errors reproduce in the PR logs but not on master with the exact SciMLOperators versions, and the NonlinearSolve full Core group has a separate current-master Newton error.


🤖 Posted by an AI agent — harness: Codex CLI 0.171.0 · model: gpt-6-luna
Conversation: local job 5043-codex (no session URL)

Merge the current default branch into the QNDF clock-alignment PR so its checks
run against the current base.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.170.0
Agent-Model: gpt-6-luna
Agent-Job: 5043-codex
Agent-Session: local session 01a215a5-5bcf-7ee1-9ae0-0ab391adf4d8 (no session URL)
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

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

Rebased #4651 onto master at 8d5d18912a4f065e558ecc27866f1e4192cdb56d for #5050. The new head is 0d746a5c46fdfe3daeb29cf8d8cf5977de3bab17.

The four-file QNDF patch applied cleanly. Git auto-merged the BDF import, Core trait fallback, and Core step proposal guard. The BDF trait definition applied directly. There were no manual conflict resolutions, and git range-diff reports the same patch. QNDF1, QNDF2, and QNDF retain their controller step proposals through clock alignment.

Local verification

I used Julia 1.13.4, the same resolved environment on both revisions, and JULIA_NUM_THREADS=4 timeout 3600s julia --project=. - with standard input to run the following probe.

using OrdinaryDiffEqBDF, OrdinaryDiffEqCore, Test
@testset "QNDF controller clock proposal" begin
    for alg in (QNDF1(), QNDF2(), QNDF())
        problem = ODEProblem((u, p, t) -> -u, 1.0, (1.0, 2.0))
        integrator = init(problem, alg; dt = 0.1)
        OrdinaryDiffEqCore.calc_dt_propose!(integrator, 0.1)
        @test integrator.dtpropose == 0.1
    end
end
master (exit 1)
   Evaluated: 0.10000000000000009 == 0.1
Test Summary:                  | Fail  Total  Time
QNDF controller clock proposal |    3      3  3.2s

rebased head (exit 0)
Test Summary:                  | Pass  Total  Time
QNDF controller clock proposal |    3      3  2.2s

I also ran the existing BDF restart tests on the rebased head.

JULIA_NUM_THREADS=4 timeout 3600s julia --project=. lib/OrdinaryDiffEqBDF/test/bdf_restart_tests.jl
Test Summary:                     | Pass  Total   Time
BDF history after a discontinuity |  512    512  15.1s
Test Summary:                             | Pass  Total  Time
QNDF2 no-event early rejection step count |    3      3  7.3s
Test Summary:                                | Pass  Total  Time
QNDF2 reinit! preserves Success on Robertson |    2      2  1.0s
Test Summary:                                                 | Pass  Total  Time
QNDF2 reinit!(; reinit_cache=false) re-anchors after an event |    4      4  5.0s

CI snapshot as of 2026-11-26 05:23 UTC

Previously failing CI leg Rebased result
SciMLSensitivity.jl/Core1/1 / Downstream Tests - Core1 Running
SciMLSensitivity.jl/Core5/1 / Downstream Tests - Core5 Running
downgrade-sublibraries / test (lib/DiffEqBase) Passed
downgrade-sublibraries / test (lib/OrdinaryDiffEqDifferentiation) Running
sublibrary-ci / lib/DelayDiffEq [Regression] / Julia 1 / Tests - Regression (Julia 1) Passed
sublibrary-ci / lib/GlobalDiffEq / Julia 1 / Tests - Core (Julia 1) Passed
sublibrary-ci / lib/OrdinaryDiffEqDifferentiation / Julia 1 / Tests - Core (Julia 1) Passed
sublibrary-ci / lib/OrdinaryDiffEqNonlinearSolve / Julia 1 / Tests - Core (Julia 1) Failed
  • OrdinaryDiffEqNonlinearSolve Core (Julia 1.13.4) reproduces on the rebased head and on master. Newton Tests hit LineSearchException: Search direction is not a direction of descent. Step length: 0.0 in the Trapezoid test, with 4 passes and 1 error in both runs. The 202 reported package-version entries match between the two logs. Rebased head · Master
  • Dependabot Auto-merge separately reports startup_failure with zero jobs and no downloadable log. A same-pin test comparison is unavailable for this workflow startup. Workflow run
Result Checks
Failed 1
Running 84
Queued 6
Skipped 3
Passed 168
Failed (1)
Running (84)
Queued (6)
Skipped (3)
Passed (168)

The checks marked Running or Queued were pending at the snapshot. Local verification covered the controller probe and the BDF restart tests. Please review whether the existing composite algorithm rule should exempt the entire composite from clock alignment when one of its algorithms is multistep.


🤖 Posted by an AI agent — harness: Codex CLI 0.171.0 · model: gpt-6.2-sol
Conversation: local session 01a2163c-eb1c-7390-80ba-64da555ed130 (no session URL)

Join the validated base merge with the current PR fork branch without
rewriting either history; both tips have the same validated tree.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.170.0
Agent-Model: gpt-6-luna
Agent-Job: 5043-codex
Agent-Session: local session 01a215a5-5bcf-7ee1-9ae0-0ab391adf4d8 (no session URL)
@ChrisRackauckas-Claude

ChrisRackauckas-Claude commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

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

Updated PR head: fde6f90ba79452182488d7946763d3d574b6228a (current master merged; pushed without rewriting history).

The originally implicated legs now pass: Differentiation Julia 1, DelayDiffEq Regression, GlobalDiffEq, DiffEqBase and OrdinaryDiffEqDifferentiation downgrades, and SciMLSensitivity Core1/Core5. The BDF Core Julia 1 and LTS jobs also pass.

All six current red checks compared against base SHA 8d5d18912a: NonlinearSolve Julia 1 Core (PR, base), FIRK downgrade (PR, base), SciMLSensitivity Core2 (PR, base), Julia LTS AD (PR, base), and GPU autoswitch (PR, base) are pre-existing by rack ci compare. ProbNumDiffEq downstream remains red with the appxtrue metric-key contract failure tracked in issue 5041; the comparer labels it different because it cannot match readable failing test identities (PR, base). No current failure is classified base-green.


🤖 Posted by an AI agent — harness: Codex CLI 0.170.0 · model: gpt-6-luna
Conversation: local session 01a215a5-5bcf-7ee1-9ae0-0ab391adf4d8 (no session URL)

@ChrisRackauckas

Copy link
Copy Markdown
Member

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

A counted review of this PR's head 0d746a5c46fdfe3daeb29cf8d8cf5977de3bab17 returned CHANGES (medium-high risk: the step-control change affects solves that never call the QNDF fallback). Context first: every CI failure on this head was verified byte-identical to master runs of the same legs — the reds are pre-existing and not yours to fix. Two findings are yours, both reproduced on a scratch checkout with Julia 1.12.7:

  1. [P1] Adaptive steps advance the state by a different interval than the clock when a QNDF candidate is in a CompositeAlgorithm — even when Tsit5 takes every step. The new guard in lib/OrdinaryDiffEqCore/src/integrators/integrator_utils.jl:1226 bypasses clock alignment for QNDF methods, but the composite trait in lib/OrdinaryDiffEqCore/src/alg_utils.jl:321 uses any, so CompositeAlgorithm((Tsit5(), QNDF()), ...) also bypasses alignment. Measured: u' = 1, u0 = 0 over (2.0^40, 2.0^40 + 32), dt = 0.125 + eps(2.0^40)/2, an IController with qmin = qmax = qmax_first_step = 1 (for the composite: that IController for Tsit5 and a BDFController with the same settings for QNDF), abstol = reltol = 1e-4, maxiters = 1024. On this head QNDF1, QNDF2 and the Tsit5/QNDF composite all take dt = 0.1251220703125 where the clock advances by 0.125, and all three return Success with zero rejections and a final state of about 32.03112793 against the analytic 32; the merge base finished within one clock ULP (0.000244140625). Backward integration reproduces the error with opposite sign. Plain Tsit5 passes on both revisions. Suggested direction (from the review): restore clock alignment in calc_dt_propose! for all adaptive floating-point steps; in the two QNDF perform_step! methods (lib/OrdinaryDiffEqBDF/src/bdf_perform_step.jl:870 and :1012) keep the history transform when the actual interval changes; for the constant-step counter, distinguish an intentional interval change from the representable interval obtained by holding dtprev at the current time — one local option is to treat dt == (t + dtprev) - t as a held interval for floating-point clocks with unchanged order while preserving the existing order and event resets (this adds no integrator state). If the Core trait widening and its BDF import/specialization exist only for this bypass, remove them. Regression tests: the constant-RHS probe above into lib/OrdinaryDiffEqBDF/test/bdf_regression_tests.jl for QNDF1/QNDF2 and into test/InterfaceI/composite_algorithm_test.jl for CompositeAlgorithm((Tsit5(), QNDF()), _ -> 1) — assert success, second accepted interval equals the clock increment, final error within one clock ULP in both directions (the one-ULP allowance covers the user-supplied initial step, which starts half an ULP off the grid).

  2. [P2] The history-reset improvement — the actual goal of this PR — has no regression test. Reproduced independently: u' = 0, u0 = 0, step proposal 2.0^-10 + 2.0^-53, span (1 - 9*2.0^-10, 1 + 16*2.0^-10); on the base nconsteps drops 8 -> 1 at step 9, on this head 8 -> 9, for both scalar and in-place vector problems. The diff currently contains only source changes. Suggested: a QNDF test in lib/OrdinaryDiffEqBDF/test/bdf_regression_tests.jl advancing that problem 16 steps with BDFController(qmin = 1, qmax = 1, qmax_first_step = 1), asserting exact-zero state, 16 accepts, zero rejects and a one-count increase of nconsteps at each accepted step, in both cache variants (the BDF Core test runner already includes that file).

Housekeeping for the next push: commits on this branch carry no Agent-Harness/Agent-Model trailers, which the review records flag; adding them keeps attribution complete. Note also that fork-head runs here wait on a workflow approval before CI can execute, so push a new head when you have the two items above and CI will follow the approval.


🤖 Posted by AI agent — harness: Claude Code · model: qwen3.8-flash-next
Conversation: local session a09f46d7-b920-4f6d-9b42-767a8886bd17 (no session URL)

@ChrisRackauckas

Copy link
Copy Markdown
Member

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

PR: #4651

Reviewed head: fde6f90
Raw SHA-256: d6665b20efe1750528c7155d4194c5f0ec9ab140bf0bfe9cff8e22003f5b9954
Source SHA-256: 5be6eefc727505f0f64388d632de913da5e301347e179831bad119d6bcc1c8fb
Source: operator-attested-codex-v1 (runner attested by pankgeorg)
Reviewer session: 01a22356-59db-72d3-aea4-2cad682900c7
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes
Redaction: ran (substitutions=0)

Risk assessment

  • Risk: medium-high (MH1)
  • Verdict: CHANGES
  • Reviewed head: fde6f90

Review report

VERDICT: CHANGES
PR: #4651
Head: fde6f90
Base: 8d5d189
Reviewer: codex-cli 0.172.0 / gpt-6.2-sol
Session: 01a22356-59db-72d3-aea4-2cad682900c7

Risk

medium-high (MH1: the patch changes numerical behavior in the shared adaptive stepping path used by solve, init followed by step!, and solve!.)

Affected users include callers selecting QNDF1, QNDF2, QNDF, their QBDF aliases, or composites and DelayDiffEq MethodOfSteps wrappers containing them. The change reaches accepted-step proposals and per-integrator BDF history. The built-in default solver selects FBDF for its BDF branch, which retains clock alignment. Modeling compilation is outside the changed path.

Blocking findings

  • P1 · An inactive QNDF member changes the active solver’s result. lib/OrdinaryDiffEqCore/src/integrators/integrator_utils.jl:1226. calc_dt_propose! checks the whole composite, and ismultistep is true if any member is multistep. I solved u′ = 1 over (2^40, 2^40 + 10) with dt = 0.1 and a PI controller held at unit gain. A composite that selected Tsit5 on every step returned Success on both snapshots, but its maximum error against u(t) = u₁ + (t - t₁) after the first step rose from 4.44e-16 to 9.57e-3. Standalone Tsit5 stayed at 4.44e-16. Restore alignment in calc_dt_propose!. If an algorithm-specific exception is retained, apply it to the member that will consume the proposal. Add the composite case and assert success and error below 1e-9.

  • P1 · Direct QNDF solves can return success with a state that has drifted from the clock. lib/OrdinaryDiffEqBDF/src/alg_utils.jl:5. Direct QNDF1 on the same input went from 5.68e-14 error to 9.57e-3. QNDF2 went from MaxIters to Success with 9.57e-3 error, so completion alone would miss the accuracy failure. Keep the state update aligned with elapsed time. In the variable-order QNDF perform_step! implementations at lib/OrdinaryDiffEqBDF/src/bdf_perform_step.jl:870 and :1012, distinguish clock rounding from a controller-requested step-size change when resetting nconsteps. Rescale the differences when the actual interval changes. Add assertions for the analytical clock error and for the history counter across a floating-point spacing boundary. The latter reproduced the intended fix: the counter went from 10 to 1 before and from 10 to 11 at head, with 16 accepts and zero rejects on both.

Nonblocking findings

None.

What I ran

  • diff -qr before head and forward and reverse git apply --check against changes.diff. Both patch checks passed. The snapshots differ in four source files and contain identical tests. There was no separate target/ snapshot.
  • julia --startup-file=no --threads=1 --compiled-modules=existing -O0 --project=.review/<snapshot> with the local numerical probes and the existing bdf_time_reversal_tests.jl and bdf_restart_tests.jl. Julia 1.13.4 ran on aarch64. The initial root package load lacked resolved dependencies, so I used two offline scratch environments with matching dependency versions. Both snapshots passed all 541 existing assertions. The numerical probes exercised all six QNDF/QBDF variants in both time directions and with in-place and out-of-place RHS functions. For scalar forward QNDF at 1e-7 tolerances, the endpoint error against exp(-1) was 1.441e-7 on both snapshots.
  • Ran warmed before/after timings with the same -O0 settings on scalar u′ = -u. QNDF measured 77.0 → 65.5 µs per solve with 34 accepts and seven rejects on both. This is one workload. The supplied benchmark jobs report success without measurements.
  • Matched the exact-head BDF GPU check to the GROUP=GPU dispatch in lib/OrdinaryDiffEqBDF/test/runtests.jl:17. Its QNDF test constructs CuArray inputs unconditionally. Its expected value comes from the same solver on CPU, which establishes CPU/GPU agreement. Exact-head BDF GPU job

What I did not verify

  • The ARM host exposed no GPU device. The dedicated BDF GPU job covers variable-order QNDF. The root GPU job failed on both snapshots, and the supplied records lack case-level results for QNDF1 and QNDF2. If their behavior changes remain, establish coverage with a passing exact-head GPU run that executes both variants and checks against analytical decay. Head GPU job · Target GPU job
  • I traced MethodOfSteps to the shared step footer but did not run the affected wrapper configuration. Extend lib/DelayDiffEq/test/regression/clock_alignment.jl:5 with a mixed composite containing QNDF and run its analytical clock assertion on both snapshots. The existing check uses standalone Tsit5.

Head link: fde6f90


🤖 Posted by an AI agent — harness: codex-cli 0.172.0 · model: gpt-6.2-sol
Conversation: local session 01a22356-59db-72d3-aea4-2cad682900c7 (no session URL)

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.

3 participants