Skip to content

Share ordinary solver paths with Reactant - #4436

Draft
ChrisRackauckas-Claude wants to merge 53 commits into
SciML:masterfrom
ChrisRackauckas-Claude:agent/reactant-jit-solve
Draft

ChrisRackauckas-Claude wants to merge 53 commits into
SciML:masterfrom
ChrisRackauckas-Claude:agent/reactant-jit-solve

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Aug 30, 2026 •

Copy link
Copy Markdown
Member

Please ignore this draft until reviewed by @ChrisRackauckas.

What changed and why

Explicit ODE solves inside Reactant compilation run the ordinary solve! loop, step acceptance/rejection, FSAL updates, initial-step estimator and I/PI/PID controllers (no separate Reactant solver). Options that cannot be traced (implicit algorithms, callbacks, saveat, user tstops, custom unstable_check/isoutofdomain, force_dtmin, step limiters, …) throw an ArgumentError before tracing; #4657 tracks them.

The compiled error check is the host's check. DiffEqBase.de_check_error is a cascade over ordered predicates (existing failure code, NaN dt, maxiters, dtmin, dt <= eps(t), unstable_check, last_step_failed), and DiffEqBase.staged_check_error evaluates the same predicates without branching for traced state. SciMLBase.check_error(::ODEIntegrator) routes to de_check_error, so host and compiled loops share one definition; host order, short-circuiting and messages are unchanged. OrdinaryDiffEqCoreReactantExt (Reactant weakdep, MIT) supplies the traced primitives whose generic fallbacks differ from the host: an exact dt <= eps(t) comparison on bit patterns (compiled CPU code flushes subnormals), the spacing eps(t) of a traced time (Reactant's eps(::TracedRNumber) returns eps(T)), and FastPower's approximate power for the controllers (TracedRNumber is not <: Real, so fastpower fell back to x^y, turning rejected NaN/overflow steps into NaN dt; that, not the error check, caused the round-9 DtLessThanMin/DtNaN → Unstable mismatches). The compiled power classifies zero and infinity on bits and rounds a Float64 whose Float32 conversion is subnormal onto the subnormal grid in integer arithmetic, so it follows FastPower on Float32-subnormal inputs too; traced Float16 controller powers throw an ArgumentError.

The extension's only non-public Reactant names are Reactant.TracedRNumber (methods for traced numbers have no other dispatch handle) and Reactant.Ops.bitcast_convert (Reactant defines no reinterpret for traced numbers); everything else goes through ReactantCore.promote_to_traced, Base.convert, integer ^ and local bit masks. GlobalDiffEq, which calls DiffEqBase.has_callbacks, requires DiffEqBase 7.22 (where it becomes public) and OrdinaryDiffEqCore 4.19 (this release).

The Reactant group has its own test/Reactant/Project.toml (Reactant 0.2.289, ReactantCore 0.1.23, [sources] for the in-repo packages), activated like test/gpu.

Part of #3369.

Verification

All commands, Julia 1.12.7, SciMLBase 3.57.0, Reactant 0.2.289.

Failing before / passing after. The new regressions, run against 2e8b79c89 (previous head) and against this head with the same test file (scratch/new_tests_wrapped.jl = the new testsets of test/Reactant/reactant_tests.jl with OrdinaryDiffEqTsit5):

# 2e8b79c89
new Reactant regressions                      |   12     8      5     25
  Compiled failure retcodes equal the host's  |   12     8            20
    small first step                          |    1     1             2   compiled Unstable  vs host Success
    dtmin after rejected steps                |    4     2             6   compiled Unstable  vs host DtLessThanMin (p=NaN, p=1e30)
    NaN dt                                    |    1     1             2   compiled Unstable  vs host DtNaN
    PIDController                             |    4     2             6   compiled Unstable  vs host DtNaN (p=NaN, p=1e30)
    existing failure code, adaptive = false   |    1     1             2   compiled Success   vs host Unstable
    existing failure code, adaptive = true    |    1     1             2   compiled Success   vs host Unstable
  Staged error check / eps / controller power: 5 errors (UndefVarError: names added here)
# this head
new Reactant regressions |  931    931

Round 10. Controller-power regressions (now including subnormal Float32 inputs, normal Float64 inputs that convert to subnormal Float32, and the Float16 rejection): 1780 pass / 461 fail on 298450497, 2241/2241 on 160742b80. The reviewer's round10/scratch/subnormal_power.jl: 3/6 → 6/6. ExplicitImports over the loaded extension: non-public names are Reactant.TracedRNumber, Reactant.Ops.bitcast_convert, plus the extension's own parent hooks OrdinaryDiffEqCore.controller_fastpower/dt_below_time_eps/value_eps. GlobalDiffEq GROUP=Core (resolves DiffEqBase 7.22.0, OrdinaryDiffEqCore 4.19.0): passed (175 assertions). OrdinaryDiffEqCore Core and QA (Aqua 26/26, JET 30 + 1 pre-existing broken): passed. round10/scratch/ftz_flag.jl with XLA_FLAGS=--xla_cpu_ftz=false: still flushes, still host Unstable / compiled DtLessThanMin.

Reactant group at 160742b80 (GROUP=Reactant julia +1.12 --project=. -e 'using Pkg; Pkg.test()', through the new env):

Reactant Tests                                | 3014     1   3015  11m23.1s
  Compiled failure retcodes match host        |    8     1      9   (adaptive Tsit5, p = NaN: compiled DtLessThanMin, host Unstable)
  Compiled failure retcodes equal the host's  |   20           20
  Staged error check equals the host check    |  513          513   (256 integrator states)
  Compiled eps(t) is exact                    |   14           14   (every binade boundary ± 1 ulp, zero, subnormals, Inf/NaN, random; Float32 and Float64)
  Compiled controller power follows FastPower | 2241         2241
  … all other testsets pass (PID/PI/I controllers, fixed/adaptive, in-place, Vern7, endpoint clipping, NaN initial dt)

The one failure is a pre-existing assertion that cannot hold exactly; see Known limitation below. (Counts at 07922628a were 1957/1958.) It passed on 2e8b79c89 only through the blanket NaN-dt → Unstable remap that round 9 required removing.

Other suites

GROUP=InterfaceI  (root)               → 31 testsets, 654 passed, 7 broken (Complex 4, Stiffness Detection 3; files unchanged from master); "Testing OrdinaryDiffEq tests passed"
lib/OrdinaryDiffEqCore GROUP=Core      → "Testing OrdinaryDiffEqCore tests passed"
lib/OrdinaryDiffEqCore GROUP=QA        → AllocCheck 1/1, JET 30 pass / 1 broken (pre-existing), Aqua 26/26
lib/DiffEqBase GROUP=Core              → "Testing DiffEqBase tests passed"
lib/DiffEqBase GROUP=QA                → Aqua 9/9
julia --project=docs docs/make.jl      → exit 0, no errors (size warnings only); the four new DiffEqBase docstrings render on the developer API page
Runic --check, typos, git diff --check on every file changed since 2e8b79c89 → exit 0

Host parity with master. A 128-scenario matrix (Tsit5 Float32/Float64, OOP/IIP, p ∈ {-1, NaN, 1e30} × {fixed, adaptive, dt+dtmin, NaN dt, maxiters, PID, I, force_dtmin, custom unstable_check, dt = 1.5eps(1.5)}, Rodas5P/ImplicitEuler stiff, stored failure codes with and without do_error_check), comparing retcode, final t and u, and the full text of every log message:

  • this head vs 2e8b79c89: 124/124 Tsit5 scenarios identical, including messages.
  • this head vs master 217e0adef: 116/128 identical. The 12 that differ are all in-place p = NaN with automatic initial dt: master returns DtNaN (its in-place initial-dt estimate misses the NaN behind the fast-math norm and returns dt = NaN), this PR returns Unstable after the init_NaN fallback that out-of-place solves already use. That difference comes from the PR's earlier initdt rework, not from this round.
  • round-6 probe.jl initial-dt table: identical to master except the same in-place NaN row (NaN / dt_NaN vs 1e-323 / init_NaN).
  • allocations (warmed, save_everystep=false): Tsit5 4360 B and Rodas5P 10896 B on both trees, identical final states; @allocated SciMLBase.check_error(integrator) = 0 on both.

Known limitation (finding)

XLA's CPU runtime flushes subnormal floats to zero. When a host solve's step size enters the subnormal range, the compiled solve cannot follow it. Concretely, adaptive Tsit5 from t0 = 0 with p = NaN and the default dtmin = 0: the host's rejected dt shrinks to 1.4e-45 and stops with Unstable (dt <= eps(0)), while the compiled dt underflows to 0 and stops with DtLessThanMin. With dtmin = floatmin(Float32) or 1f-30 both report the same code (checked for p = NaN and 1e30). The dt <= eps(t) predicate itself is exact on subnormal inputs; the divergence is in the step size the compiled arithmetic produces. I found no exact fix (it would need subnormal arithmetic in compiled code) and left the existing assertion failing rather than weakening it.

This is waiting on a policy decision. A strict documented-exception variant (asserting the backend code, stopping time and retained state for this case, host == compiled for dtmin = floatmin(Float32) and 1f-30, and docs text) is prepared but not committed; it passes 53/53 locally.

Related residual: the compiled initial-dt fallback near t = 0 uses floatmin(T) where the host uses a subnormal eps(t0).

What I did not verify

  • Full Everything, GPU, Downstream, and sublibrary groups other than those listed; Julia LTS/pre.
  • Compiled implicit/Newton failures (implicit algorithms are rejected before tracing), and time types other than Float32/Float64 under compilation.
  • CI on this head.

CI triage (previous head 2e8b79c89)

276 success, 9 failure. Round 9 matched all nine against master or an unrelated branch: DiffEqBase LTS Core and Downgrade (high_level_solve.jl 94–101), Differentiation Core and Downgrade (diag(::ScalarOperator)), Rosenbrock QA (Rosenbrock32 DAE inference), Delay Regression (Waltman), root GPU (QNDF diag_cu mismatches), SciMLSensitivity Core1 (Mooncake / complex adjoints), NonlinearSolve Core (LineSearchException; unchanged subtree, same failure on an unrelated branch). Expect the Reactant group to show the one failure above.

What a reviewer should push back on

  • SciMLBase.check_error(::ODEIntegrator) now dispatches to DiffEqBase.de_check_error, the logic SciMLBase's generic method also implements; verified identical output (messages included) over the matrix above.
  • Reactant.TracedRNumber and Reactant.Ops.bitcast_convert are the extension's remaining non-public Reactant accesses; no public equivalent exists in Reactant 0.2.289.
  • Four new public DiffEqBase names (de_check_error, staged_check_error, check_error_failed_retcode, check_error_dt_below_time_eps), DiffEqBase 7.22.0, OrdinaryDiffEqCore 4.19.0 requiring it, GlobalDiffEq requiring both.
  • The in-place NaN initial-dt host difference from master (12 scenarios above) predates this round; keeping it is a judgment call.
  • activate_reactant_env follows activate_gpu_env, so a local run rewrites test/Reactant/Project.toml's OrdinaryDiffEq source to an absolute path (as the GPU group does).
  • The subnormal limitation and its failing assertion.

Risk assessment

  • Risk: medium
  • Blast radius: every ODE solve's error check now goes through DiffEqBase.de_check_error (same conditions and order); controller powers go through controller_fastpower (identity on the host). Compiled behaviour changes only inside Reactant tracing. New public DiffEqBase API.
  • Evidence: failing-before/passing-after above; Reactant 1957/1958 (one documented limitation); InterfaceI, Core, QA, docs green; host parity identical to the previous head and to master outside the pre-existing in-place NaN case; allocations unchanged.
  • Independent review: Codex CLI 0.160.0 (gpt-6-astra), round 10 at 298450497: medium risk, CHANGES (FTZ divergence, subnormal controller power, non-public Reactant names, GlobalDiffEq floor). The last three are addressed at 160742b80; the FTZ policy awaits @ChrisRackauckas. Re-review pending.
  • Merge: needs human review: public API additions, a known compiled/host divergence, and one failing Reactant assertion.

🤖 Generated with Claude Code (model: opus) — Claude Code 2.1.288, local session, transcript at <job>/log.txt. Earlier rounds: Cursor Agent CLI (model auto), <job>/.

Risk assessment

  • Risk: high
  • Blast radius: Every OrdinaryDiffEq solve. The PR rewrites the hot paths: the solve! inner loop, loopheader!/_loopfooter! accept/reject, modify_dt_for_tstops!, handle_dt!, both ode_determine_initdt paths, and all controllers. It also moves every ODE error check onto the refactored DiffEqBase.de_check_error. ReactantCore becomes a hard (non-weak) dependency of OrdinaryDiffEqCore, so every user loads it. ODEIntegrator gets two new type parameters (CountType, FlagType), and iter/success_iter/accept_step/last_stepfail/next_step_tstop are no longer fixed to Int/Bool. PIDControllerCache.err changes from Vector to NTuple, which breaks any outside code that writes cache.err[i] = …. I searched SciML code on GitHub and found no positional ODEIntegrator{…} constructions and no mutation of err. Downstream users are DelayDiffEq, StochasticDiffEq*, GlobalDiffEq (its compat now requires DiffEqBase ≥ 7.22 and OrdinaryDiffEqCore ≥ 4.19) and LowOrderRK (the RKMCache FSAL buffer changed).
  • Evidence: Head 160742b80 has 276 checks passing, 9 failing and 3 skipped. 8 of the 9 failures are pre-existing:
    • Same counts on master (75bc9dfc5, 217e0adef, 4a5c0e71b):
      • tests / GPU (julia 1): 170 pass / 3 fail / 12 broken on both.
      • lib/OrdinaryDiffEqRosenbrock [QA]: 39 pass / 1 error on both.
      • lib/OrdinaryDiffEqNonlinearSolve Core: 4 / 1 error on both.
      • lib/OrdinaryDiffEqDifferentiation Core: 5 / 1 error on both.
      • downgrade-sublibraries (lib/OrdinaryDiffEqDifferentiation): 5 / 1 error on both.
      • downgrade-sublibraries (lib/DiffEqBase): high_level_solve.jl:94–101, 29 / 1 fail / 3 error on both.
      • SciMLSensitivity.jl/Core1: fails on every master commit I checked.
    • lib/DiffEqBase / Julia lts / Tests - Core: this job does not run on master. It fails on the same high_level_solve.jl:94–101 assertions with the same counts as master's downgrade job on Julia 1.11, so it is a pre-existing problem on Julia versions before 1.12, not caused by the PR.
    • One new failure, tests / Reactant (Julia 1): 3014 pass / 1 fail at reactant_tests.jl:114 ("Compiled failure retcodes match host": the compiled solve returns DtLessThanMin, the host returns Unstable, caused by XLA flushing subnormals to zero). This group does not exist on master; the PR adds it, and the assertion is known to fail. The PR leaves that assertion failing on purpose and says so, but it is still a new red check and fails the no-regression bar. CI ran this group on Julia 1.13.1; the author's local runs were on 1.12.7.
  • Independent review: Devin CLI / fusion-claude-opus-5-5-high-sidekick-swe-2-medium rated it high, medium confidence: it is a large rewrite of every solve's core loop, initial-dt and controller paths, with a new hard dependency and changes to internal struct types. Host CI is otherwise no worse than master, but the new Reactant group is red, and several host-path changes are not in the description.
  • Merge: needs human review. Findings:
    1. New red check: the Reactant group fails one assertion. The FTZ/subnormal policy is still waiting on @ChrisRackauckas.
    2. Non-public Reactant names: Reactant.TracedRNumber and Reactant.Ops.bitcast_convert. Both are disclosed.
    3. Public API additions: five new public DiffEqBase names: has_callbacks, de_check_error, staged_check_error, check_error_failed_retcode, check_error_dt_below_time_eps. The body says "four" and mentions has_callbacks separately. Version bumps are minor (DiffEqBase 7.22.0, OrdinaryDiffEqCore 4.19.0), which fits additive changes.
    4. User-visible retcode change: in-place solves with NaN parameters and automatic initial dt now return Unstable instead of DtNaN. This is disclosed, covering 12 scenarios.
    5. Not disclosed:
      • ReactantCore becomes a hard dependency of OrdinaryDiffEqCore (compat 0.1.21). The body does not state its license.
      • The ODEIntegrator type-parameter and field-type changes, and the PIDControllerCache.err type change.
      • Host-path semantic edits:
        • The inner loop now exits on should_exit & accept_step, not should_exit.
        • dtpropose is now set in the non-adaptive zero-dtcache branch.
        • The tstop tolerance check now tests eltype(prob.tspan) instead of t isa AbstractFloat.
        • The tdir sign fix in handle_dt! now runs for every dt.
        • within_compile() calls are added to the step loop.
      • The get_fsalfirstlast change for LowOrderRK's RKMCache.
      • The parity matrix in the body covers neither user tstops nor callbacks.
    6. Tests: I found no weakened tests. The changed ode_initdt test is now wrapped in @test_logs, which makes it stricter.
    7. Open review thread: Chris's comment "we really need saveat for reactant" (2026-09-27) is deferred to Reactant compilation: remaining unsupported solve options (saveat, callbacks, implicit, tstops, ...) #4657, not resolved.
    8. Draft status: the PR is still a draft, and its body asks that it be ignored until Chris has reviewed it.

🤖 Risk assessment posted by an AI agent (fleet master) — harness: Devin CLI / fusion-claude-opus-5-5-high-sidekick-swe-2-medium; dispatched by Devin CLI 3000.11.3 fleet-master caretaker, model Fusion (claude-opus-5-5 medium + swe-2 medium)
Conversation: local transcript (no session URL)

Merge with master (2026-10-16)

Merged master at d727918 into this branch (a7f5e26). One textual conflict, lib/DiffEqBase/Project.toml: master released 7.21.4, this branch keeps 7.22.0 for its new public names.

OrdinaryDiffEqCore 4.19.0 is now registered from master (#4635) without this branch's Reactant extension or DiffEqBase 7.22 requirement. This branch's Core release therefore moves to 4.20.0, and GlobalDiffEq's compat to OrdinaryDiffEqCore = "4.20". Mentions of "OrdinaryDiffEqCore 4.19" above refer to that release.

Checks after the merge (Julia 1.13.2):

  • lib/GlobalDiffEq GROUP=Core: passed (175), resolving DiffEqBase 7.22.0 and OrdinaryDiffEqCore 4.20.0.
  • GROUP=Reactant: 3014 pass / 1 fail. The failure is the known limitation above (reactant_tests.jl:114, adaptive Tsit5 with p = NaN: compiled DtLessThanMin, host Unstable), identical on the pre-merge head in CI.
  • GROUP=InterfaceI: passed.
  • lib/DelayDiffEq GROUP=Regression: passed, including master's new tracked-discontinuity coalescing test.

The red lib/OrdinaryDiffEqNonlinearSolve Core job on the previous head fails the same way on master (https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/38482834012/job/115632748374). The red GPU job (QNDF, dae_tests.jl:481) is fixed on master by #4869, which this merge brings in; it was not run locally.


🤖 Posted by an AI agent — harness: Claude Code 2.1.301 · model: claude-opus-5-5
Conversation: local session ID e04110a1-f6b1-432c-a13f-5d2e7c50cbb7 (headless, no URL)

Review round 2 findings (2026-10-16)

An independent review (codex-cli, gpt-6.1-sol) of a7f5e26 returned two findings. Head after this round: 090086f.

1. The Reactant group still fails reactant_tests.jl:114. Not fixed: @ChrisRackauckas needs to choose an option. The failing case is adaptive Tsit5 with p = NaN: compiled DtLessThanMin, host Unstable. Probes with Reactant 0.2.293 (Reactant_jll 0.0.421) show the result depends on the XLA backend:

  • CPU backend (what CI's ubuntu-latest uses): compiled code treats subnormal inputs as zero and flushes subnormal results, for both Float32 and Float64. For x = nextfloat(0f0), x > 0 is false and x * 2^30 is 0; floatmin(T) / 5 is 0. The group gives 3014 pass / 1 fail.
    • An exact fix would need integer emulation of every operation on a subnormal dt: the controller division, the dtmin comparison, t + dt, and the stage arithmetic of any step accepted at that size. The last cannot be done in general.
  • CUDA backend (Reactant picks it when a GPU is free): no flushing, so this case returns Unstable like the host and line 114 passes. Instead, Compiled controller power follows FastPower fails 3 assertions per float type. The worst relative error is 3.45e-7 against the 2eps(Float32) tolerance, caused by CUDA's exp2. CI does not run this group on a GPU.

Options:

  • (a) Narrow documented exception. On the CPU backend, compiled solves do not follow host step sizes below floatmin(T). This is reachable only when dtmin < floatmin(T) and |t| is below about 2^-100 (Float32) or 2^-967 (Float64), with the default step-rejection factor. Replace the assertion for that case with strict checks of the compiled code, time and state, plus host == compiled for dtmin = floatmin(T).
  • (b) Change the host so it never steps below floatmin(T), e.g. a default dtmin = floatmin(T) for float time. Host retcodes for such solves would change from Unstable to DtLessThanMin. Not implemented or tested.
  • (c) Keep exact parity as a requirement and leave this assertion failing until subnormal emulation exists.

The assertion is unchanged.

2. Non-public Reactant names: documented and enforced as a narrow exception; not promoted upstream.

  • Reactant 0.2.293 neither exports, declares public, nor documents Reactant.TracedRNumber or Reactant.Ops.bitcast_convert, and it defines no reinterpret for traced numbers.
  • The new test/Reactant/explicit_imports.jl runs first in the Reactant group. It applies ExplicitImports' check_all_explicit_imports_are_public and check_all_qualified_accesses_are_public to the loaded OrdinaryDiffEqCoreReactantExt. It ignores only those two names, plus the extension's methods on OrdinaryDiffEqCore's own hooks (controller_fastpower, dt_below_time_eps, value_eps).
  • Result: 3/3 pass. Adding using Reactant: TracedRArray to the extension makes it fail with NonPublicExplicitImportsException.
  • lib/OrdinaryDiffEqCore/AGENTS.md records the rule. ExplicitImports is MIT-licensed and is a dependency of the test/Reactant environment only.
  • Making these names public needs a change in EnzymeAD/Reactant.jl: declare TracedRNumber public, and either add Base.reinterpret for traced numbers or declare Ops.bitcast_convert public. That repository is outside SciML, so no issue or PR was opened there.

Checks (Julia 1.13.2, CPU backend via CUDA_VISIBLE_DEVICES=""):

  • GROUP=Reactant: Reactant Extension Imports | 3 3, Reactant Tests | 3014 1 3015. The one failure is item 1.
  • Runic --check, typos and git diff --check on the changed files: clean.
  • QA was not run: no package exports, public API or package dependencies changed.

Breaking change

None. No public name is removed or renamed, and no public signature changes.

Required version bumps:

  • DiffEqBase: minor, to 7.22.0 (already set). It adds five public names.
  • OrdinaryDiffEqCore: minor, to 4.20.0 (already set). It adds the Reactant extension, the ReactantCore dependency and the DiffEqBase 7.22 floor.
  • GlobalDiffEq: patch, 1.7.3 → 1.7.4. Its source and compat change; the version is not bumped here.

One host behaviour changes: in-place solves with NaN parameters and automatic initial dt return Unstable instead of DtNaN, as out-of-place solves already do. This changes which failure code is reported and needs no major bump.


🤖 Posted by an AI agent — harness: Claude Code 2.1.301 · model: claude-opus-5-5
Conversation: local session ID e04110a1-f6b1-432c-a13f-5d2e7c50cbb7 (headless, no URL)

Review round 3 findings (2026-10-16)

An independent review (codex-cli, gpt-6.1-sol) of 090086f returned one blocking finding: the line-114 retcode mismatch. Head after this round: a7fc4eb.

Line 114 is still red. No compiled-side change can fix it, so the contract needs @ChrisRackauckas's decision. The options are (a)/(b)/(c) in the round 2 section. New evidence from the CPU backend (CI's), Tsit5 on u' = -u/tend over (0, tend), exact u(tend) = e^-1 = 0.367879:

tend host compiled, CPU, 090086f compiled, CPU, this head compiled, CUDA, this head
1f-36 (Float32) Success, 0.367880 Success, 0.988314 Success, 0.367876 Success, 0.367880
1f-37 Success, 0.367880 (9 subnormal steps) Success, 0.889076 Success, 0.367771 Success, 0.367880
5f-38 Success, 0.367880 Success, 0.790419 DtLessThanMin at t = floatmin Success, 0.367880
1e-306 (Float64) Success, 0.367880 Success, 0.977994 Success, 0.367853 Success, 0.367880
1e-307 Success, 0.367880 Success, 0.800443 DtLessThanMin at t = floatmin Success, 0.367880
  • The host succeeds using subnormal step sizes. Compiled code on CPU cannot represent those steps: the stage arithmetic (dt times tableau coefficients, t + dt) flushes, not only the controller or the error check. So the CPU backend cannot reproduce the host whenever the host steps below floatmin(T).
  • On CUDA, which does not flush, all of these match the host. Line 114 also passes there, but CUDA's exp2 fails the controller-power tolerance (round 2 section).

Fixed this round: on the CPU backend, compiled solves returned Success with a wrong state for end times below 100 floatmin(T) (bold entries above). CUDA was not measured before the fix.

  • Cause: the compiled tstop-snap tolerance was 100 * value_eps(t), and the traced value_eps raises a subnormal spacing to floatmin(T). That gave a tolerance of 100 floatmin(T), larger than the whole interval, so the first step snapped t to the end time.
  • Fix: the tolerance now goes through a new internal hook, OrdinaryDiffEqCore.tstop_tolerance(x).
    • On the host it is 100 * eps(x), so host values are unchanged.
    • The Reactant extension's traced method gives 100 times the spacing where compiled arithmetic represents it, and floatmin(T) where the spacing flushes to zero.
  • Result: the three cases between about 5 floatmin(T) and 100 floatmin(T) are now correct. The two smallest now stop with DtLessThanMin (a CPU-only mismatch under the decision above) instead of returning a wrong answer.
  • Regression test: the new End time $tend testset in test/Reactant/reactant_tests.jl covers tend ∈ (1f-37, 1f-36, 1e-306). It checks the retcode against the host, t == [tend], and u ≈ e^-1 with the file's rtol = 5e-4.

Fail before the fix, then pass after (CPU backend, same test file):

# 090086f6c (fix stashed)
End time 1.0e-37: Evaluated: Float32[0.88907635] ≈ Float32[0.36787945] (rtol=0.0005)
End time 1.0e-36: Evaluated: Float32[0.9883137] ≈ Float32[0.36787945] (rtol=0.0005)
End time 1.0e-306: Evaluated: [0.9779942008648451] ≈ [0.36787944117144233] (rtol=0.0005)
end-time regression |    9     3     12
# this head
end-time regression |   12     12

Checks (Julia 1.13.2):

  • GROUP=Reactant with CUDA_VISIBLE_DEVICES="": Reactant Extension Imports | 3 3 and Reactant Tests | 3026 1 3027. The one failure is line 114.
  • GROUP=InterfaceI: passed: 32 testsets, 660 pass, 7 broken (the existing Complex and Stiffness Detection markers).
  • lib/OrdinaryDiffEqCore GROUP=Core: passed.
  • Runic, typos and git diff --check: clean.
  • QA was not run: tstop_tolerance is internal (not exported or public), and no dependencies changed. The ## Breaking change section above still holds: the required bumps are DiffEqBase minor (7.22.0) and OrdinaryDiffEqCore minor (4.20.0).

🤖 Posted by an AI agent — harness: Claude Code 2.1.301 · model: claude-opus-5-5
Conversation: local session ID e04110a1-f6b1-432c-a13f-5d2e7c50cbb7 (headless, no URL)

🤖 Automated review section from an AI agent running as Chris Rackauckas's account — not written or reviewed by Chris.

Risk assessment (independent review, Codex CLI 0.164.0-alpha.11.1 gpt-6-astra, slot 1, head a7fc4eb)

  • Risk: high (H6: introduces lib/OrdinaryDiffEqCore/AGENTS.md with dependency API exceptions; H2: changes default in-place NaN initialization behavior.)
  • Verdict: CHANGES
  • Session: 01a18da8-0055-70e2-850a-45982d205850
  • Blocking priorities: P1, P2

Review round 1, written by the reviewer named above (Codex CLI 0.164.0-alpha.11.1 / gpt-6-astra) 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 PR shares ordinary solver loops, initialization and controllers with Reactant compilation and adds a staged error-check API. Current-head CI still contradicts the required host/compiled return-code contract, and the new extension depends on non-public Reactant APIs.

Blast radius: Every ordinary solve's loop/error checks, initial step, controllers and FSAL buffers; new Reactant extension, public DiffEqBase API and GlobalDiffEq compatibility floors.

Evidence: Exact head verified; all 33 changed files and surrounding solver paths inspected. Reactant CI on Julia 1.13.2 reports 3026 passed, 1 failed, 0 errored, 0 broken. Recent master separately reproduces the unrelated NonlinearSolve Newton failure. Analytic exponential tests provide G1 evidence; the Reactant path was exercised for G2 but failed. PID reinitialization and compiled-executable reuse tests address parts of G3.

Blocking findings

  1. [P1] test/Reactant/reactant_tests.jl:114; lib/OrdinaryDiffEqCore/src/solve.jl:1128 — confirmed by running (PR CI, not a local Reactant run). The adaptive NaN case returns compiled enum value 6 while the host returns ReturnCode.Unstable. The current-head Reactant job fails exactly the assertion traced.retcode == host.retcode, with 3026 passing and 1 failing assertions. This is a PR-added test group, not an established master failure. The implementation and documentation require identical return codes, while CPU subnormal flushing gives a different stopping state. Obtain the explicit contract decision, implement the selected behavior, and retain independent assertions on retcode, stopping time and state; do not merely skip or loosen the failing assertion.
  2. [P2] lib/OrdinaryDiffEqCore/ext/OrdinaryDiffEqCoreReactantExt.jl:7; test/Reactant/explicit_imports.jl:12 — suspected from reading, with the author's later description confirming API status. New extension methods import Reactant.TracedRNumber and Reactant.Ops.bitcast_convert even though they are not public; QA explicitly ignores both. A repository instruction exception does not satisfy issue Add @reexport using DiffEqBase #58's public-dependency-API requirement. Obtain supported upstream public interfaces and require the version providing them, or use a supported local implementation where feasible; preserve meaningful import checks.

Non-blocking findings

  1. lib/OrdinaryDiffEqCore/Project.toml:33 — ReactantCore is a new hard dependency. Name its license explicitly alongside the already disclosed MIT Reactant weak dependency; the body currently names Reactant's license but not ReactantCore's.

What I ran

  • gh pr view 4436 --repo SciML/OrdinaryDiffEq.jl --json number,url,state,isDraft,headRefOid,baseRefName,baseRefOid,title,files,statusCheckRollup — exit 0, OPEN/draft, head above. API comparison base is d727918; Base header identifies the fetched current master used for the three-dot review.
  • git fetch origin +refs/pull/4436/head:refs/remotes/pr/4436 +refs/heads/master:refs/remotes/origin/master; detached worktree at the exact head; git rev-parse HEAD; git diff origin/master...HEAD; git log -1 --first-parent --no-merges --format=%B — all exit 0. The first-parent non-merge commit supplies the PR author's trailers rather than a merged master's author. Root AGENTS.md/CLAUDE.md are absent; the added sublibrary AGENTS.md was inspected as review data.
  • gh pr checks 4436 --repo SciML/OrdinaryDiffEq.jl --json name,state,bucket,link,workflow — exit 0; raw states inspected.
  • gh run view 38933313620 --repo SciML/OrdinaryDiffEq.jl --log-failed — retrieval exit 0. Reactant failing job: Julia 1.13.2, Expression: traced.retcode == host.retcode, compiled integer 6 versus host Unstable; package test exit 1.
  • gh run view 38933313778 --repo SciML/OrdinaryDiffEq.jl --log-failed — retrieval exit 0. Newton LineSearchException is also present in recent master Sublibrary CI, with 4 passed and 1 errored, independently read. gh run list --repo SciML/OrdinaryDiffEq.jl --branch master --event push --limit 5 and the corresponding per-workflow lists were inspected.
  • After freezing independent findings, read the PR description and linked issues Error when solving an ODE using Reactant arrays #3369 and Reactant compilation: remaining unsupported solve options (saveat, callbacks, implicit, tstops, ...) #4657. The author explicitly discloses the remaining return-code failure; earlier reviews in the description refer to older heads, so no same-head REVIEWER_GRADE is assigned.

What I did not verify

No local Reactant, GPU, full downstream, or performance run; local Julia 1.13.3 was used for other batch PRs only. CPU-versus-CUDA assertions and author's local performance numbers were not independently reproduced. Matching a recent-master failure signature is not a dependency-identical base/head reproduction. No upstream PR was modified.

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

🤖 Automated review section from an AI agent running as Chris Rackauckas's account — not written or reviewed by Chris.

Fix by Codex CLI 0.170.0 gpt-6.2-astra (head f1d9947)

Merged master ace83e0140 into the published branch. Host and compiled solves use the same timestep clamp and error predicates. The Reactant adapter preserves subnormal bounds during arithmetic. A compiled fixed step snapped to an endpoint now integrates the full interval, and an adaptive solve rejected on its first NaN step returns Unstable at the initial time and state. Capturing the accepted timestep before callbacks preserves upstream interpolation semantics. PID snapshots restore the ordered error-history tuple. ReactantCore, the new hard dependency, is MIT-licensed.

On Julia 1.13.3 with the CPU backend, the same focused endpoint and failed-step probe went from 14 passed, 5 failed to 19/19. In four failing cases, the solver had reported success at the expected endpoint with state approximately 0.9 when the analytic answer was 1. The fifth failure was the return code. The PID snapshot checks went from 25 passed, 1 failed, 3 errored (including setindex!(::Tuple{Float64,Float64,Float64}, …)) to 29/29.

GROUP=Reactant julia +1.13.3 --compiled-modules=existing --project=. -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'
# Reactant Extension Imports | 3  3
# Reactant Tests | 3110  3110
# Testing OrdinaryDiffEq tests passed

GROUP=QA julia +1.13.3 --compiled-modules=existing --project=. -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'
# Quality Assurance Tests | 111  111

GROUP=Core julia +1.13.3 --project=lib/OrdinaryDiffEqCore -e 'using Pkg; Pkg.test(; julia_args=["--check-bounds=auto"])'
# Controller snapshot/restore | 29  29
# Tolerance Default Equality | 110  110
# Testing OrdinaryDiffEqCore tests passed

GROUP=Core julia +1.13.3 --compiled-modules=existing --project="$nls_env" -e 'using Pkg; Pkg.test("OrdinaryDiffEqNonlinearSolve"; julia_args=["--compiled-modules=existing"])'
# Newton Tests | 4  1  5
# LineSearchException: Search direction is not a direction of descent. Step length: 0.0

julia +1.13.3 --compiled-modules=existing --project=docs test/InterfaceI/tstop_callback_interpolation.jl
# Callback interpolation on a tstop-clamped step | 672  672
# saveat and ContinuousCallback on a tstop-clamped first step | 30  30
# saveat on composite switch during a non-first clamped step | 26  26

julia +1.13.3 --compiled-modules=existing --project=docs docs/make.jl
# Automatic version="7.8.2" for inventory from ../Project.toml
# Docs build exited 0.

git diff --cached --name-only -z upstream/master -- '*.jl' | xargs -0 julia +1.13.3 --compiled-modules=existing --project=@runic -m Runic --check
git diff --cached --unified=0 upstream/master | sed -n '/^+++ /d;s/^+//p' | typos -
git diff --cached --check upstream/master
# All three exited 0 with no diagnostics.

Pre-existing failures. The nonlinear test environment (nls_env) used the checkout’s DiffEqBase, OrdinaryDiffEqCore, OrdinaryDiffEqNonlinearSolve, OrdinaryDiffEqSDIRK and DiffEqDevTools. OrdinaryDiffEqNonlinearSolve Core passed its developer API (27/27) and NLAnderson resize tests (352/352), then raised LineSearchException: Search direction is not a direction of descent. Step length: 0.0 in Newton (4 passed, 1 errored). Clean master reproduced the same error and counts. DiffEqBase QA also reproduced a master stale-import error (18 passed, 1 errored). Master Newton CI · Newton bisect · Master DiffEqBase QA · Stale imports issue

Open review finding (P2). Reactant 0.2.308 reports Base.ispublic false for both TracedRNumber and Ops.bitcast_convert. Compiling reinterpret(UInt32, x) on a traced Float32 threw ArgumentError: Source type for reinterpret must be isbits. The extension still needs the two existing exceptions. GPU and downstream groups were outside this validation.

Next counted review must come from a smart model in a fresh session, not this fix session.


🤖 Posted by an AI agent — harness: Codex CLI 0.170.0 · model: gpt-6.2-astra
Conversation: local session 01a2034e-aa38-7cf1-a299-e5c62234c577 (no session URL)

🤖 Automated review section from an AI agent running as Chris Rackauckas's account — not written or reviewed by Chris.

Fix by Codex CLI 0.170.0 gpt-6.2-astra (head de448df)

F2 fixed. F1 remains blocking. The Feagin and IMEXMultistep QA projects now resolve DiffEqBase and OrdinaryDiffEqCore from the same checkout. On both projects the QA activation failed before the change with restricted to versions 7.23.0 - 7 by OrdinaryDiffEqCore … no versions left. Both now resolve checkout versions 7.23.0 and 4.21.0 respectively.

On Julia 1.13.3, I ran each package's QA entry point with SciMLTesting and SafeTestsets in the harness environment:

export JULIA_LOAD_PATH="@:$QA_HARNESS:@stdlib"
for package in Feagin IMEXMultistep; do
    GROUP=QA julia +1.13.3 --startup-file=no --compiled-modules=existing --project="$QA_HARNESS" -e 'pkg = abspath("lib/OrdinaryDiffEq" * ARGS[1]); using SciMLTesting; activate_group_env(joinpath(pkg,"test","qa"); parent=[pkg,pwd()]); include(joinpath(pkg,"test","runtests.jl"))' "$package"
done
# Feagin
# Allocation Tests |    3      3
# JET Tests        |    1      1
# Aqua             |   21     21
# IMEXMultistep
# Discontinuity restart | 72  72
# SciMLBase reexport    |  2   2
# Allocation Tests      |  2 broken (existing)
# JET Tests             |  1   1
# Aqua                  | 21  21

GROUP=Reactant julia +1.13.3 --compiled-modules=existing --project=. -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'
# Reactant Extension Imports |    3      3  1m19.2s
# Reactant Tests | 3110   3110  8m37.2s
# Testing OrdinaryDiffEq tests passed

GROUP=QA julia +1.13.3 --compiled-modules=existing --project=. -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'
# Quality Assurance Tests |  111    111  31.2s
# Testing OrdinaryDiffEq tests passed

GROUP=Core julia +1.13.3 --project=lib/OrdinaryDiffEqCore -e 'using Pkg; Pkg.test(; julia_args=["--check-bounds=auto"])'
# Controller snapshot/restore |   29     29  3.2s
# Tolerance Default Equality |  110    110  2m36.4s
# Testing OrdinaryDiffEqCore tests passed

git diff --cached --check
git diff --cached --unified=0 | sed -n '/^+++ /d;s/^+//p' | typos -
# Both exited 0. Runic had no Julia inputs in the two-file TOML diff.

The reviewer's bounded-step reproducer still fails on the committed solver. Both methods take two steps. Euler returns 0.0146484375 instead of 0.00439453125, and Tsit5 returns a negative state. Two local prototypes passed the supplied reproducer. One restarts the algorithm on a genuinely subnormal last interval, losing multistep history. The other retains the cache but fails to compile a supported stage limiter typed to ODEIntegrator. Neither prototype is included.

Reactant 0.2.308 still needs a public traced-scalar dispatch and underlying scalar type interface, and a public bit-preserving reinterpret for traced scalars. The existing exemptions remain. I verified on CPU; GPU and downstream suites were not run locally.

Next counted review must come from a smart model in a fresh session, not this fix session.


🤖 Posted by an AI agent — harness: Codex CLI 0.170.0 · model: gpt-6.2-astra
Conversation: local session 01a203eb-9091-74b0-b7b6-8937b6a453a4 (no session URL)

🤖 Automated review section from an AI agent running as Chris Rackauckas's account — not written or reviewed by Chris.

Fix by Codex CLI 0.170.0 gpt-6.2-astra (head 990f805)

Compiled initialization now throws ArgumentError when the larger endpoint magnitude has subnormal spacing and abs(dtmax) is smaller than the span. The reviewer's bounded Euler and Tsit5 cases retain all three host steps. On the unfixed head, the first new case produced 4 passes and 1 failure with Expected: ArgumentError / No exception thrown. The prior endpoint probe recorded 8 passes and 4 failures.

Open scope decision. A spacing-only guard passed all 20 new assertions in isolation and immediately raised ArgumentError in the existing constant-slope test at 1.0f-37. All four fixed-step and three adaptive tiny-endpoint cases require compiled success despite their subnormal endpoint spacing. The bounded guard preserves those cases. A span-sized or larger bound still leaves tiny timespans outside the rejection, including inputs with potentially subnormal stage arithmetic.

AB3 and AB4 now carry the startup counter and the selected derivative lags across compiled steps. Both in-place and out-of-place forms are covered. The Adams sublibrary now depends directly on MIT-licensed ReactantCore. On the old head the five-step AB3 regression produced 5 passes and 4 failures. Its counter was 1 and its endpoint was 0.001930277398124236 against the rational reference 0.001687117534814846. On the fix the ordinary-scale reproducer with a shortened final step returned 0.0026060195998356735, five steps, and counter 3 on both host and compiled CPU.

Julia 1.13.3, CPU, two Julia threads. The following commands were run from the repository root.

julia +1.13.3 --startup-file=no --compiled-modules=existing --project=test/Reactant test/Reactant/adams_history.jl
# Compiled Adams history | 9  9  (each of four combinations)

GROUP=Reactant julia +1.13.3 --compiled-modules=existing --project=. -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'
# Reactant Extension Imports |    3      3  1m22.9s
# Reactant Tests | 3166   3166  10m04.6s
# Testing OrdinaryDiffEq tests passed

GROUP=QA julia +1.13.3 --compiled-modules=existing --project=. -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'
# Quality Assurance Tests |  111    111  46.9s

GROUP=Core julia +1.13.3 --project=lib/OrdinaryDiffEqCore -e 'using Pkg; Pkg.test(; julia_args=["--check-bounds=auto"])'
# Tolerance Default Equality |  110    110  2m38.1s
# Testing OrdinaryDiffEqCore tests passed

for group in ALL Threaded; do
    GROUP="$group" julia +1.13.3 --compiled-modules=existing --project=lib/OrdinaryDiffEqAdamsBashforthMoulton -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'
done
# ABM Convergence Tests | 24  24
# Adams Variable Coefficients Tests | 68  68
# ABM Discontinuity Restart Tests | 283  283
# Allocation Tests | 12 passed, 11 existing broken
# JET Tests | 1  1
# Aqua | 21  21
# ABM Threaded Convergence Tests | 6  6
# Regression test for threading versions vs non threading versions | 13  13
# Testing OrdinaryDiffEqAdamsBashforthMoulton tests passed

julia +1.13.3 --startup-file=no --compiled-modules=existing --project=docs docs/make.jl
# Automatic `version="7.8.2"` for inventory from ../Project.toml

git diff --name-only -z de448df1af HEAD -- '*.jl' | xargs -0 julia +1.13.3 --project=@runic -m Runic --check
git diff --check de448df1af HEAD
git diff -U0 de448df1af HEAD | sed -n '/^+++ /d;s/^+//p' | typos -
# All exited 0.

The first Core run used --compiled-modules=existing and failed its precompilation assertion with 0 > 0. The normal precompilation run above exercised that assertion. GPU and downstream suites were not run locally. All nine failing checks on the previous PR head matched failures in master push jobs.

Next counted review must come from a smart model in a fresh session, not this fix session.


🤖 Posted by an AI agent — harness: Codex CLI 0.170.0 · model: gpt-6.2-astra
Conversation: local session 01a20492-4785-73a1-a784-f6071574ca78 (no session URL)

🤖 Automated review section from an AI agent running as Chris Rackauckas's account — not written or reviewed by Chris.

Fix by Codex CLI 0.170.0 gpt-6.2-astra (head 5641cb3)

Compiled initialization rejects fixed grids that need multiple host steps at subnormal time spacing for state- or time-dependent right-hand sides. This covers omitted, span-sized and double-span dtmax in Float32 and Float64. The constant-slope exception requires the default stage limiter and a single ordinary fixed-arity RHS method whose lowered Julia code leaves both arguments unused. Generated, variadic and overloaded methods conservatively fail this check. The four constant-slope and three adaptive tiny-time solves passed unchanged.

ABM32, ABM43 and AB5 now reject compiled initialization with an ArgumentError naming their unsupported startup state. AB3 and AB4 share their in-place lag updates on host and compiled paths. Core copies the FSAL derivative into the integrator when tracing gives the cache its own storage. The rational reference checks cover startup buffer positions, the five-step solution and derivative history.

Release summary. DiffEqBase 7.23.0 provides has_callbacks. OrdinaryDiffEqCore 4.21.0 requires DiffEqBase 7.23. GlobalDiffEq 1.7.4 uses the DiffEqBase API and retains compatibility with OrdinaryDiffEqCore 4.

Verification. Julia 1.13.3, CPU backend, two Julia threads. The same focused driver ran the checked-in Floatmin-scale spacing and Adams regression testsets against the starting and fixed versions.

julia +1.13.3 --startup-file=no --compiled-modules=existing --project="$BASE_REACTANT_ENV" "$PROBE"
# Review regressions                 |  103    27    130  2m45.4s
julia +1.13.3 --startup-file=no --compiled-modules=existing --project=test/Reactant "$PROBE"
# Review regressions |  130    130  2m40.1s

GROUP=Reactant julia +1.13.3 --compiled-modules=existing --project=. -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'
# Reactant Extension Imports |    3      3  26.5s
# Reactant Tests | 3240   3240  9m04.6s
# Testing OrdinaryDiffEq tests passed

GROUP=QA julia +1.13.3 --compiled-modules=existing --project=. -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'
# Quality Assurance Tests |  111    111  46.7s
# Testing OrdinaryDiffEq tests passed

GROUP=Core julia +1.13.3 --project=. --compiled-modules=existing -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'
# Testing OrdinaryDiffEq tests passed (the root Core group is empty).

GROUP=Core julia +1.13.3 --project=lib/OrdinaryDiffEqCore -e 'using Pkg; Pkg.test(; julia_args=["--check-bounds=auto"])'
# Controller snapshot/restore |   29     29  3.0s
# Tolerance Default Equality |  110    110  2m37.6s
# Testing OrdinaryDiffEqCore tests passed

for group in ALL Threaded; do
    GROUP="$group" julia +1.13.3 --compiled-modules=existing --project=lib/OrdinaryDiffEqAdamsBashforthMoulton -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'
done
# ABM Convergence Tests |   24     24  1m07.6s
# Adams Variable Coefficients Tests |   68     68  15.1s
# ABM Discontinuity Restart Tests |  283    283  1m03.7s
# Allocation Tests |   12      11     23  23.7s
# JET Tests     |    1      1  1.9s
# Aqua          |   21     21  53.0s
# Testing OrdinaryDiffEqAdamsBashforthMoulton tests passed
# ABM Threaded Convergence Tests |    6      6  18.8s
# Regression test for threading versions vs non threading versions |   13     13  25.9s
# Testing OrdinaryDiffEqAdamsBashforthMoulton tests passed

julia +1.13.3 --startup-file=no --compiled-modules=existing --project=docs docs/make.jl
# [ Info: Automatic `version="7.8.2"` for inventory from ../Project.toml

git diff --name-only -z 990f805eda HEAD -- '*.jl' | xargs -0 julia +1.13.3 --project=@runic -m Runic --check
git diff -U0 990f805eda HEAD | sed -n '/^+++ /d;s/^+//p' | typos -
git diff --check 990f805eda HEAD
# All exited 0 with no diagnostics.

The original head failed 12 grid-rejection assertions, six Adams initialization rejections and nine lag/FSAL assertions. Host trajectories, return codes, startup counters, lags and FSAL buffers were byte-identical for 80 cases covering all five Adams methods, both RHS forms and one through eight steps. Both comparison files had SHA-256 c3dc37d14f61aca046e09242ef7bd14313ed4ccf9c72f50dc3b86964aef629c9. A separate host run with ReactantCore 0.1.21 reproduced all 80 final-state and counter records.

All ten failures on the starting head also occurred on master pushes. The additional Core LTS failure measured a sparse diagonal-check timing ratio of 9.334 against a limit of 8.0. A master push measured 9.367 on the same assertion. Clean current master passed 10/10 locally. PR timing job · Master timing job

The step-exit flag is still read on opposite sides of the footer in the two existing loops. Combining those reads would change their ordering. Local checks covered CPU execution. GPU and downstream suites were not rerun locally.

Next counted review must come from a smart model in a fresh session, not this fix session.


🤖 Posted by an AI agent — harness: Codex CLI 0.170.0 · model: gpt-6.2-astra
Conversation: local session 01a20576-6211-7b91-b55e-192c15cedc68 (no session URL)

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Implementation/CI plan:

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.151.0
Agent-Model: unknown
Agent-Session: local session ID 01a04f92-0d12-7990-926c-f3e5a23f3a31
Comment on lines +1001 to +1004
if ReactantCore.within_compile()
isnothing(dt) && integrator.opts.adaptive && auto_dt_reset!(integrator)
return nothing
end

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.

This isn't doing the tdir flip? Why not do this the other way around and just if not in a compile, do the error messages?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Addressed in 5ad0c97: handle_dt!(integrator, dt) always runs auto_dt_reset! (when needed) and the tdir sign fix via abs(dt) * tdir on the shared path. Only the host diagnostics (sign/isnan error messages) are gated behind !ReactantCore.within_compile(), because those predicates cannot drive ordinary if on traced values. Adaptive Reactant suite is 208/208 after this change (previously failed on TracedRNumber{Bool} in the old dt > 0 branch).

Comment thread lib/OrdinaryDiffEqCore/src/solve.jl Outdated
Comment on lines +932 to +936
if ReactantCore.within_compile()
return integrator.opts.adaptive ?
_traced_adaptive_solve!(integrator, integrator.controller_cache) :
_traced_fixed_step_solve!(integrator)
end

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.

Why is this treated as separate code instead of integrating it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Agreed — the separate _traced_adaptive_solve! / _traced_fixed_step_solve! entry points are gone. SciMLBase.solve! is now one shared loop: ReactantCore.@trace while around _solve_step!, with compile-only finalization (_traced_finalize_solution) after the traced loop. Host-only pieces (error checks, handle_tstop!, postamble) stay behind within_compile() gates rather than a second solver.

throw(ArgumentError("implicit algorithms are not supported inside Reactant compilation"))
!adaptive && isnothing(dt) &&
throw(ArgumentError("dt is required for fixed-step solves inside Reactant compilation"))
isempty(saveat) || throw(ArgumentError("saveat is not supported inside Reactant compilation"))

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.

doesn't reactant want a constant size output? That would require using saveat

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes — a constant-size compiled output would naturally be driven by saveat (or a fixed save_everystep count). Under compile today we force save_everystep=false / save_end=true so the traced solution is a single endpoint, which is statically sized without needing a dynamic save queue. Supporting saveat is the right next step once we can materialize a fixed-length traced timeseries from a compile-time-known grid; leaving the throw until that lands rather than half-supporting a growing BinaryHeap.

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.

we really need saveat for reactant

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Tracked in #4657 together with the other options still rejected under compilation (save_everystep, tstops, callbacks, implicit algorithms, etc.). This PR keeps the explicit ArgumentError for saveat inside Reactant compilation.

Cursor Agent CLI 2026.09.26-dd393fe, model auto.

Comment on lines +207 to +208
!adaptive && isnothing(dt) &&
throw(ArgumentError("dt is required for fixed-step solves inside Reactant compilation"))

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.

why is this different? dt with tstops is the only other way, but tstops aren't supported, so this is an unnecessary check?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Kept on purpose: under compile, fixed-step still needs a concrete dt because auto-dt only runs for adaptive algorithms, and tstops/d_discontinuities are also rejected in the same gate. Without dt, a non-adaptive compiled solve has no step size to advance. Happy to drop the check once fixed-step can take a compile-time-constant alternative (e.g. a static tstop grid), but today it is not redundant with the tstops rejection.

Comment on lines +205 to +206
isimplicit(alg) &&
throw(ArgumentError("implicit algorithms are not supported inside Reactant compilation"))

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.

why?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Implicit algorithms still need nonlinear solves / W-factorization paths that are not yet exercised on the shared traced step. The gate fails fast at _ode_init rather than tracing into unsupported caches. Explicit adaptive/fixed-step (Tsit5 etc.) is what the Reactant suite covers; lifting this is follow-up once OrdinaryDiffEqNonlinearSolve / W construction is Reactant-safe end-to-end.

ChrisRackauckas and others added 2 commits September 5, 2026 09:17
Route compiled solves through the ordinary step loop, initial-step estimator,
FSAL update, and I/PI controllers. Promote loop-carried state for tracing and
retain narrow adapters for static output and endpoint handling.

Cover custom controllers, zero dynamics, in-place fixed steps, and rejected
first steps. Merge current master to resolve the test-group configuration and
retain upstream fixes.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.153.4
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/05/rollout-2026-09-05T07-40-10-01a0715e-73c9-7e21-a18b-c5b0504a4bf3.jsonl
Keep the ordinary integrator's active FSAL aliases and select cache buffers at
the tracing boundary. Composite cache initialization buffers need not belong to
the active solver.

The existing composite tests fail 2 of 16 checks without this correction and
pass all 16 with it. Reactant passes 178/178 and QA passes 109/109.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.153.4
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/05/rollout-2026-09-05T07-40-10-01a0715e-73c9-7e21-a18b-c5b0504a4bf3.jsonl
@ChrisRackauckas-Claude ChrisRackauckas-Claude changed the title Trace explicit ODE solves under Reactant Share ordinary solver paths with Reactant Sep 5, 2026
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Reworked the implementation to use the ordinary solver loop, initial-step estimator, controllers, acceptance/rejection, and FSAL update. Removed the separate traced solver and initial-step implementations. The remaining compilation checks handle traced state, buffer aliases, endpoint stops, and output/error boundaries.

Local verification: Reactant 178/178; QA 109/109; full InterfaceI passed in 2367.4 seconds; targeted composite tests 16/16; docs build, Runic, and typos passed. The new IController regression errors on the original implementation and passes with this revision; the updated body includes the code and output.

Commits:

The PR remains a draft and should be ignored until reviewed by @ChrisRackauckas. CI is running.

🤖 Generated with Codex CLI 0.153.4 (model: gpt-6-astra). Session: local transcript /home/crackauc/.codex/sessions/2026/09/05/rollout-2026-09-05T07-40-10-01a0715e-73c9-7e21-a18b-c5b0504a4bf3.jsonl.

if isinplace(integrator.sol.prob)
recursivecopy!(integrator.fsalfirst, integrator.fsallast)
fsalfirst, fsallast = if ReactantCore.within_compile()
get_fsalfirstlast(integrator.cache, integrator.u)

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.

why would this be a function call only within compile?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Both execution modes now use the same FSAL-buffer accessor and copy. Composite/default/constant caches retain their active integrator buffers because their initialization accessor does not identify the current runtime buffers.

Updated in abb04b3. Clean local Reactant suite: 208/208; QA: 109/109.

Comment on lines +282 to +288
if ReactantCore.within_compile()
dt = integrator.opts.adaptive ? integrator.dt : integrator.dtcache
integrator.dt = integrator.tdir * min(
abs(dt), abs(first_tstop(integrator) - integrator.tdir * integrator.t)
)
return nothing
end

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.

why is clamping ignored in reactant compile?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed the compilation-only timestep-clipping implementation. Both modes now use the normal stop flags, clipping, roundoff tolerance, and restoration of the proposed timestep.

Updated in abb04b3. Clean local Reactant suite: 208/208; QA: 109/109.

integrator.accept_step = (
!integrator.isout &&
!integrator.isout &
accept_step_controller(

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.

This function modifies?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The built-in acceptance predicates only inspect controller state, but eager evaluation was unnecessary. The shared path now evaluates the predicate only when the candidate is in-domain, preserving short-circuit behavior for custom controllers as well.

Updated in abb04b3. Clean local Reactant suite: 208/208; QA: 109/109.

Comment thread lib/OrdinaryDiffEqCore/src/initdt.jl Outdated
# because it also checks if partials are NaN
# https://discourse.julialang.org/t/incorporating-forcing-functions-in-the-ode-model/70133/26
if isnan(d₁)
if !ReactantCore.within_compile() && isnan(d₁)

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.

why would reactant compile not do a NaN check?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The NaN checks and fallback are now part of the common initial-step control flow, including compiled solves. Added native/compiled fallback parity tests for both RHS forms. The IIP path also checks the derivative directly because the fast-math norm can hide NaNs from a later scalar check; Float32/Float64 native regressions cover that fallback.

Updated in abb04b3. Clean local Reactant suite: 208/208; QA: 109/109.

Comment thread lib/OrdinaryDiffEqCore/src/initdt.jl Outdated
end
return tdir * max(dtmin, min(100dt₀, dt₁, dtmax_tdir))
result_dt = tdir * max(dtmin, min(100dt₀, dt₁, dtmax_tdir))
if ReactantCore.within_compile()

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.

What exactly is this doing?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That deferred correction was compensating for skipped early decisions during tracing. Removed it: NaN and constant-derivative decisions now occur in the shared initial-step path.

Updated in abb04b3. Clean local Reactant suite: 208/208; QA: 109/109.

Comment thread lib/OrdinaryDiffEqCore/src/reactant.jl Outdated
Comment on lines +3 to +5
# Function wrappers hide types from Reactant and provide no compile-time reuse inside `@jit`.
SciMLBase.specialization(::ODEFunction{iip, SciMLBase.AutoSpecialize}) where {iip} =
ReactantCore.within_compile() ? SciMLBase.FullSpecialize : SciMLBase.AutoSpecialize

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.

This is piracy, should go to SciMLBase

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Moved specialization dispatch to a ReactantCore extension owned by SciMLBase, with instance/type and outside-compilation tests: SciML/SciMLBase.jl#1564. OrdinaryDiffEq no longer defines those methods.

Updated in abb04b3. Clean local Reactant suite: 208/208; QA: 109/109.

Comment thread lib/OrdinaryDiffEqCore/src/solve.jl Outdated
Comment on lines +789 to +791
if ReactantCore.within_compile() && adaptive &&
!(controller_cache isa Union{IControllerCache, PIControllerCache})
throw(ArgumentError("only IController and PIController are supported inside Reactant compilation"))

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.

Why?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed the I/PI whitelist. PID now uses the common controller implementation with a traceable error history, and is covered by the compiled solve tests.

Updated in abb04b3. Clean local Reactant suite: 208/208; QA: 109/109.

ChrisRackauckas and others added 8 commits September 12, 2026 06:49
Use shared FSAL access, stop clipping, controller acceptance, and initial-step
control flow. Support PID tuple history and keep specialization in SciMLBase.
Cover compiled clipping, PID and NaN parity plus native controller reinit
and NaN initial-step regressions. Merge current upstream solver changes.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.153.4
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/05/rollout-2026-09-05T07-40-10-01a0715e-73c9-7e21-a18b-c5b0504a4bf3.jsonl
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.153.4
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/05/rollout-2026-09-05T07-40-10-01a0715e-73c9-7e21-a18b-c5b0504a4bf3.jsonl
Resolve the Project.toml test-target conflict by keeping master's
FunctionWrappersWrappers entry and this branch's Reactant extras. Raise
the SciMLBase floor to 3.56 for the released parametric-retcode work,
drop the SciMLBase PR branch pin, point the Reactant test group at
EnzymeAD/Reactant.jl main, and keep handle_dt!/stats paths
Reactant-compatible after the merge.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/4436-cursor/log.txt on amdci2.julia.csail.mit.edu
Traced enums landed on Reactant main but are not released yet
(latest registry is still v0.2.288). Resolve Reactant/ReactantCore
from main so the Reactant group exercises the merged enum design.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/4436-cursor/log.txt on amdci2.julia.csail.mit.edu
Avoid traced `dt > 0` / `iszero(dt)` as ordinary `if` conditions during
compilation. Keep auto_dt_reset! and the tdir sign correction on the
shared path; restrict host-only error/NaN diagnostics to non-compile
runs, matching the review request on the compile early-return.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/4436-cursor/log.txt on amdci2.julia.csail.mit.edu
Move the initial-dt epsilon warning into the non-NaN branch so JET no
longer sees an undefined dt₀ after ReactantCore.@trace if, and teach
InterfaceIII/StochasticDiffEq CustomArray tests DiffEqBase.NAN_CHECK.
Drop root Project.toml Reactant main sources (GROUP=Reactant still pins
via runtests.jl) so Downgrade does not resolve Reactant from git.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/4436-cursor/log.txt on amdci2.julia.csail.mit.edu
Bring in Trapezoid non-diagonal mass-matrix support (SciML#4631), BDF JET
FullSpecialize (SciML#4627), and other master fixes needed for Sublibrary CI.
…acks

update_fsal! was routing through get_fsalfirstlast, which returns throwaway
zero(...) for RKM/ExpRK and wiped inplace FSAL (order ~0). Restore
integrator.fsalfirst/fsallast copies. Match DelayDiffEq's tstop_tol via
eps(magnitude). Handle ScalarOperator in _mmdiag. Treat empty CallbackSet
as no callbacks for GlobalErrorEstimation (DiffEqBase Julia≥1.12 erasure).

Co-authored-by: Cursor <cursoragent@cursor.com>
ChrisRackauckas and others added 4 commits September 30, 2026 16:10
The Reactant-safe `&`/`|` tiny-dt fallback always evaluates
`eps(::Type)`, which MethodErrors on DynamicQuantities.Quantity and
broke Downstream. Unwrap via SciMLBase.value like dtmin.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI
Agent-Model: auto
Re-emit master's :dt_epsilon message on the IIP path, drop the OOP
tiny-dt fallback (SciML#4601 is IIP-only), and reject non-constant
ScalarOperator mass matrices in ESDIRK instead of returning a wrong
constant answer.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI 2026.10.01-14929f9
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/4436-cursor/log.txt on amdci2.julia.csail.mit.edu
Restore OrdinaryDiffEqSDIRK and the Differentiation ScalarOperator
mass-matrix test to match master. ESDIRK λI/ScalarOperator support
belongs in a separate follow-up, not this Reactant PR.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI 2026.10.01-14929f9
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/4436-cursor/log.txt on amdci2.julia.csail.mit.edu
Compiled fixed-step solves skipped check_error! and reported Success with
NaN solutions. Trace the default unstable/maxiters/dtmin predicates,
stop the loop on failure, and preserve the host retcode through finalize.
Reject custom unstable_check under compile; cover fixed and adaptive
regressions; drop history-oriented initdt comments.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI 2026.10.01-14929f9
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/4436-cursor/log.txt on amdci2.julia.csail.mit.edu
ChrisRackauckas and others added 10 commits October 2, 2026 18:20
Factor de_check_error into ordered predicates that the host cascade and
DiffEqBase.staged_check_error both evaluate, route ODEIntegrator check_error
through them, and replace the compiled approximation. A Reactant extension
supplies the exact dt <= eps(t) comparison (by bit pattern, since compiled
CPU code flushes subnormals) and FastPower's approximation for traced
controller powers, whose x^y fallback turned rejected NaN steps into NaN dt.
The compiled loop stops on the shared maxiters check and keeps an existing
failure code.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.288
Agent-Model: opus
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/odecheck-claude/log.txt on amdci2.julia.csail.mit.edu
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.288
Agent-Model: opus
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/odecheck-claude/log.txt on amdci2.julia.csail.mit.edu
Reactant's eps(::TracedRNumber) returns eps of the type, so compiled solves
used eps(T) where the host uses eps(t) in the initial-dt fallback and the
tstop snapping tolerance. value_eps gives traced floats their spacing,
raised to floatmin where compiled code would flush a subnormal spacing.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.288
Agent-Model: opus
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/odecheck-claude/log.txt on amdci2.julia.csail.mit.edu
test/Reactant/Project.toml replaces the runtime Pkg.add of exact Reactant
versions and is activated like test/gpu. New tests assert compiled retcodes
equal the host's for the round-9 cases (small first step, dtmin after
rejected NaN/overflow steps, NaN dt, PIDController, existing failure code),
that staged_check_error equals check_error over 256 integrator states, that
the compiled dt <= eps(t) comparison and value_eps are exact, and that the
compiled controller power follows FastPower.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.288
Agent-Model: opus
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/odecheck-claude/log.txt on amdci2.julia.csail.mit.edu
OrdinaryDiffEqCore calls de_check_error, staged_check_error and
check_error_failed_retcode and extends check_error_dt_below_time_eps, so
they are declared public, documented on the developer API page, and
DiffEqBase moves to 7.22.0 with OrdinaryDiffEqCore requiring it.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.288
Agent-Model: opus
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/odecheck-claude/log.txt on amdci2.julia.csail.mit.edu
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.288
Agent-Model: opus
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/odecheck-claude/log.txt on amdci2.julia.csail.mit.edu
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.288
Agent-Model: opus
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/odecheck-claude/log.txt on amdci2.julia.csail.mit.edu
Classify zero and infinity on magnitude bits (the compiler rewrites the
float tests into comparisons that treat a subnormal as zero), and round a
normal Float64 whose Float32 conversion is subnormal onto the subnormal grid
in integer arithmetic, since compiled conversion flushes it. Traced Float16
controller powers throw an ArgumentError instead of silently using x^y.
The extension drops Reactant.promote_to, Ops.convert and Ops.shift_left and
Base internals for ReactantCore.promote_to_traced, Base.convert, integer
powers and local bit masks; TracedRNumber and Ops.bitcast_convert remain.
The controller regressions add the review's subnormal cases.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.288
Agent-Model: claude-opus-5-5
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/odecheck-claude/log.txt on amdci2.julia.csail.mit.edu
GlobalDiffEq calls DiffEqBase.has_callbacks, public from DiffEqBase 7.22.
OrdinaryDiffEqCore moves to 4.19.0 (Reactant extension, DiffEqBase 7.22)
and GlobalDiffEq requires that release.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.288
Agent-Model: claude-opus-5-5
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/odecheck-claude/log.txt on amdci2.julia.csail.mit.edu
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-4436/log.txt

# Conflicts:
#	lib/GlobalDiffEq/src/companion.jl
#	lib/GlobalDiffEq/src/estimation.jl
@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 to resolve conflicts (head e00ade7). Re-review the resolution before merging.

Conflict resolution report

STATUS: RESOLVED

Note: the Reactant group has 1 failing assertion. The PR description already reports it at the PR head 160742b80 (3014 pass / 1 fail, "Compiled failure retcodes match host", adaptive Tsit5, p = NaN: compiled DtLessThanMin vs host Unstable). The merge produces the same failure and the same counts. Every other test I ran passes.

Conflicting files

Both sides fixed the same bug: GlobalDiffEq rejected solves that carried DiffEqBase's empty type-erased CallbackSet (Julia >= 1.12).

Both versions behave the same: nothing or an empty CallbackSet counts as no callback, and anything else counts as a callback.

  • lib/GlobalDiffEq/src/companion.jl (3 hunks): kept the PR's DiffEqBase.has_callbacks. In _validate_estimation_problem I used master's shorter form, DiffEqBase.has_callbacks(values(prob.kwargs)) && throw(...). It is equivalent to the PR's haskey(...) && has_callbacks((; callback = ...)), because has_callbacks calls get(kwargs, :callback, nothing).
  • lib/GlobalDiffEq/src/estimation.jl (1 hunk): kept DiffEqBase.has_callbacks(kwargs).
  • lib/GlobalDiffEq/src/GlobalDiffEq.jl (auto-merged, edited by hand): removed master's _has_callbacks / _is_empty_callback. After the resolution nothing in the repo called them, and they duplicated the public DiffEqBase function the PR adopts. Master's behaviour (ignore empty erased callbacks) is kept through DiffEqBase.has_callbacks.

Runic (julia +1.12 --project=@runic -m Runic -i on the three files): no changes.

Tests (Julia 1.12.7 for Reactant; default juliaup channel elsewhere)

Logs are in scratch/.

  1. cd lib/GlobalDiffEq && julia --project -e 'using Pkg; Pkg.instantiate()', then GROUP=Core julia --project -e 'using Pkg; Pkg.test()': passed. Basic functionality 1/1, Algorithm traits 3/3, Companion error estimators 43/43, Adjoint error estimation and control 35/35, GLEE solvers 91/91, BigFloat support 2/2. Log: scratch/globaldiffeq_core_test.log
  2. cd lib/GlobalDiffEq && GROUP=QA julia --project -e 'using Pkg; Pkg.test()' (Aqua, ExplicitImports, JET): 23 pass, 1 broken, 0 fail. The broken entry is pre-existing. Log: scratch/globaldiffeq_qa_test.log
  3. cd lib/DiffEqBase && julia --project -e 'using Pkg; Pkg.instantiate()', then julia --project -e 'using Test; include("test/problem_kwargs_merging.jl")': merge_problem_kwargs API 27/27, has_callbacks API 7/7. Log: scratch/diffeqbase_kwargs_test.log
  4. Repo root: GROUP=Reactant julia +1.12 --project=. -e 'using Pkg; Pkg.test()': Reactant Tests 3014 pass / 1 fail / 3015 total (4m29s). The failure is the one described in the note above, at test/Reactant/reactant_tests.jl:114. All other testsets pass: Staged error check 513/513, Compiled eps(t) 14/14, Compiled controller power 2241/2241, Compiled failure retcodes equal the host's 20/20, and the controller, fixed-step and Vern7 sets. Log: scratch/reactant_test.log

The Reactant harness's Pkg.develop rewrote test/Reactant/Project.toml [sources] to an absolute path. I reverted that with git checkout, so the working tree is clean. All Julia processes I started have exited.


🤖 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 and others added 4 commits October 16, 2026 12:53
Conflict in lib/DiffEqBase/Project.toml: master released 7.21.4, this
branch declares 7.22.0 for the new public error-check names and
has_callbacks. Kept 7.22.0.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.301
Agent-Model: claude-opus-5-5
Agent-Session: local session ID e04110a1-f6b1-432c-a13f-5d2e7c50cbb7 (headless claude -p, no URL)
OrdinaryDiffEqCore 4.19.0 is registered from master without the Reactant
extension or the DiffEqBase 7.22 requirement, so the release containing
them is 4.20.0, and GlobalDiffEq requires that release.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.301
Agent-Model: claude-opus-5-5
Agent-Session: local session ID e04110a1-f6b1-432c-a13f-5d2e7c50cbb7 (headless claude -p, no URL)
OrdinaryDiffEqCoreReactantExt uses two Reactant names that are neither
exported, declared public nor documented, and have no public
equivalent: TracedRNumber (the only dispatch type for traced numbers)
and Ops.bitcast_convert (Reactant has no reinterpret for traced
numbers). test/Reactant/explicit_imports.jl runs ExplicitImports over
the loaded extension and allows exactly those two, plus the extension's
methods on OrdinaryDiffEqCore's own hooks, so any further non-public
access fails the group.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.301
Agent-Model: claude-opus-5-5
Agent-Session: local session ID e04110a1-f6b1-432c-a13f-5d2e7c50cbb7 (headless claude -p, no URL)
The compiled tstop-snap tolerance was 100 * value_eps(t), and the traced
value_eps raises a subnormal spacing to floatmin(T). For a solve ending
below 100 floatmin(T) the tolerance exceeded the whole interval, so the
first step snapped t to the end time and the compiled solve returned
Success with a wrong state (u' = -u/tend, Float32 tend = 1f-37: 0.889
instead of exp(-1)).

The tolerance goes through tstop_tolerance(x), 100 * eps(x) on the host
(unchanged values). The Reactant extension returns 100 times the spacing
where compiled arithmetic represents it and floatmin(T) where the
spacing flushes to zero.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.301
Agent-Model: claude-opus-5-5
Agent-Session: local session ID e04110a1-f6b1-432c-a13f-5d2e7c50cbb7 (headless claude -p, no URL)
@ChrisRackauckas

Copy link
Copy Markdown
Member

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

PR: #4436

Reviewed head: a7fc4eb
Raw SHA-256: ee8d4a4d0d19667e35176ab7dd3df2b33b75d80132ba7cac5e1e0cb3e82262b6
Source SHA-256: 04033897ed9ce87bff315818244c733754cf1be577da5d2ab1fab036c36e6b74
Source: standard-review-v1 (harness-log)
Reviewer session: 01a1d406-4bc9-7ad3-9581-cdd8d48c4bac
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes

Risk assessment

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

Review report

VERDICT: CHANGES
Round: 2
Head: a7fc4eb
Slot: 1
CI: CI unreadable; review only; merge gates unchanged
Session: 01a1d406-4bc9-7ad3-9581-cdd8d48c4bac

Risk

medium-high (MH1: shared solve!, initialization and check_error dispatch change on the Tsit5, Verner and default-solver main lanes).

Blocking findings

  • Verdict: CHANGES
  • Round: 2
  • Blocking priorities: P1, P2
  1. [P1] Compiled endpoint snapping returns Success with approximately 10% state error. lib/OrdinaryDiffEqCore/ext/OrdinaryDiffEqCoreReactantExt.jl:59 substitutes floatmin(T) for a subnormal spacing. In lib/OrdinaryDiffEqCore/src/integrators/integrator_utils.jl:385, this tolerance can mark a step as reaching the endpoint while retaining a smaller dt. The state integrates that smaller interval and the time snaps forward.

    Confirmed by running scratch/probes.jl: solve u′ = p, u(0) = 0, p = 1/tend, using Tsit5 with adaptive=false and dt = 0.3*tend. The analytic endpoint is 1 within input rounding. Both in-place and out-of-place cases fail:

    Type tend Host endpoint Compiled endpoint
    Float32 1f-37 1.0000001 / 0.9999999 0.8999999
    Float64 1e-307 0.9999999999999998 0.8999999999999997

    All four compiled cases return Success and report tend. The probe records 8 passing and 4 failing assertions. Preserve an ULP-scale snapping decision for subnormal spacings, or otherwise ensure the reported time matches the interval actually integrated. Add fixed-step analytic regressions; the new adaptive tiny-end-time tests pass despite this defect.

  2. [P2] The shipped compiled/host return-code parity test fails for a NaN parameter. test/Reactant/reactant_tests.jl:114 fails in the adaptive Tsit5 case. An independent fresh-process probe, scratch/retcode_probe.jl, reproduces it with f(u,p,t)=p.*u, u0=Float32[1], p=Float32[NaN], and tspan=(0f0,1f0): host Unstable, compiled DtLessThanMin, both at time zero. Five other probe cases pass; this assertion fails.

    This violates lib/OrdinaryDiffEqCore/AGENTS.md's explicit return-code parity requirement. The floating comparison in lib/DiffEqBase/src/check_error.jl:124, before the bit-exact epsilon check, is a suspected subnormal-sensitive cause from reading; I did not isolate that predicate experimentally. Correct the compiled failure classification while retaining the parity assertion. The 513-assertion staged-check matrix passes on host integrators and does not establish parity under compilation.

Non-blocking findings

None.

What I ran

AI reviewer: Codex CLI 0.164.0, model gpt-6.1-sol; local session above, no session URL available.

  • git diff origin/master...HEAD, affected source/tests and instructions, latest commit attribution trailers, and the required risk criteria. Final git diff --check origin/master...HEAD passed; git status --porcelain=v1 was empty and HEAD matched the SHA above.

  • julia --version: 1.13.2. No checked-in Manifest exists. Created a scratch environment from test/Reactant/Project.toml plus affected test dependencies, with local source paths pointing at this checkout. Resolved Reactant 0.2.308, ReactantCore 0.1.26, SciMLBase 3.58.0, FastPower 1.5.1, and AllocCheck 0.2.7. Preserved the supplied JULIA_DEPOT_PATH and used the requested job TMPDIR. Runs used one Julia thread, CPU Reactant, hidden CUDA devices, and memory-capped scopes.

  • From repo/:

    julia --startup-file=no --compiled-modules=existing --project=../scratch/review_env ../scratch/run_review.jl
    julia --startup-file=no --compiled-modules=existing --project=../scratch/review_env ../scratch/followup_review.jl

    Both exited 1 with the confirmed failures above. Evidence: main log, follow-up log.

  • Passed: Reactant extension import checks; full affected initialization, controller, keyword-merging, tstop, backward, composite, equality and LowOrderRK convergence files; ExponentialRK allocation file, including all 5 new FSAL assertions. Its 18 pre-existing broken static allocation checks remain broken.

  • After the Reactant file stopped at its failed parity test, ran its remaining unchanged testsets separately: failure-code cases 20/20, adaptive tiny endpoints 12/12, staged checks 513/513, compiled epsilon checks 14/14, controller powers 2241/2241 passed.

  • Passed on follow-up: dtmin direction 6/6, and GlobalDiffEq basic, algorithm-traits, companion, GLEE and BigFloat test files. Initial attempts at these files lacked a direct OrdinaryDiffEqTsit5 dependency in my scratch environment; I corrected that environment and reran them successfully. Those import failures are not PR findings.

  • uv run --locked python --version: Python 3.15.0, with warning that --locked has no effect outside a project. This checkout has no uv.lock or Python project; this does not verify a project-locked Python interpreter.

What I did not verify

GPU backends, differentiation through compiled solves, minimum dependency versions, Julia LTS, full QA/Downstream suites, documentation build, or GlobalDiffEq's adjoint tests. PR body, comments, reviews and CI were not inspected. No author risk rating or earlier same-head opinion was consulted.

AUTHOR_GRADE: {"task":"feature","score":3,"difficulty":5,"rounds":2,"author_harness":"Claude Code 2.1.301","author_model":"claude-opus-5-5","note":"Broad host and compiled precision tests pass, but four analytic probes return Success with roughly 10% state error. The new Reactant suite also fails return-code parity for NaN input, reproduced independently in a fresh process."}

Head link: a7fc4eb


🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol
Conversation: local session 01a1d406-4bc9-7ad3-9581-cdd8d48c4bac (no session URL)

ChrisRackauckas and others added 2 commits November 22, 2026 09:36
Keep subnormal timestep bounds intact when clamping a traced step and
when selecting a failure code. Integrate the remaining interval when a
fixed step snaps to the endpoint. Preserve the accepted timestep across
callbacks and restore the immutable PID error history as a tuple.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.170.0
Agent-Model: gpt-6.2-astra
Agent-Job: SciML__OrdinaryDiffEq.jl__4436--20261122T125003Z-codex-gpt-6.2-astra
Agent-Session: local session 01a2034e-aa38-7cf1-a299-e5c62234c577 (no session URL)
Both QA environments develop OrdinaryDiffEqCore, which requires
DiffEqBase 7.23 for the staged error API. Resolve its companion
dependency from the same source tree.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.170.0
Agent-Model: gpt-6.2-astra
Agent-Job: SciML__OrdinaryDiffEq.jl__4436--20261122T154126Z-codex-gpt-6.2-astra
Agent-Session: local session 01a203eb-9091-74b0-b7b6-8937b6a453a4 (no session URL)
@ChrisRackauckas

Copy link
Copy Markdown
Member

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

Decision from the repo maintainer (Chris, 2026-11-22): the two private Reactant names used by the extension — TracedRNumber and Ops.bitcast_convert — are allowed to remain. The existing import-test exemptions for them stand, and no upstream public-API request is being filed for now. An independent review flagged these imports as a durability risk (they are not Base.ispublic on Reactant 0.2.308 and no public equivalent exists in that version); this comment records that the risk is consciously accepted by the maintainer, so it is not an open finding requiring a code change.


🤖 Posted by an AI agent — harness: Claude Code · model: qwen3.8-flash-next
Conversation: local session topic-reactant-work (no session URL)

ChrisRackauckas and others added 6 commits November 22, 2026 14:24
When the time grid has subnormal spacing, the CPU backend can flush a
required interval and the endpoint snap can exceed the requested dtmax.
Reject the bounded case during initialization. Keep the existing
zero-origin solves with the default span-sized bound covered.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.170.0
Agent-Model: gpt-6.2-astra
Agent-Job: SciML__OrdinaryDiffEq.jl__4436--20261122T184331Z-codex-gpt-6.2-astra
Agent-Session: local session 01a20492-4785-73a1-a784-f6071574ca78 (no session URL)
Trace the startup counter and select the numerical step from its runtime
value. Keep the in-place derivative lags in fixed loop-carried buffers
and propagate out-of-place history updates beyond the traced branch.
Check the final state and both derivative lags against rational Adams
and Runge-Kutta recurrences for five bounded steps.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.170.0
Agent-Model: gpt-6.2-astra
Agent-Job: SciML__OrdinaryDiffEq.jl__4436--20261122T184331Z-codex-gpt-6.2-astra
Agent-Session: local session 01a20492-4785-73a1-a784-f6071574ca78 (no session URL)
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.170.0
Agent-Model: gpt-6.2-astra
Agent-Job: SciML__OrdinaryDiffEq.jl__4436--20261122T225241Z-codex-gpt-6.2-astra
Agent-Session: local session 01a20576-6211-7b91-b55e-192c15cedc68 (no session URL)
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.170.0
Agent-Model: gpt-6.2-astra
Agent-Job: SciML__OrdinaryDiffEq.jl__4436--20261122T225241Z-codex-gpt-6.2-astra
Agent-Session: local session 01a20576-6211-7b91-b55e-192c15cedc68 (no session URL)
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.170.0
Agent-Model: gpt-6.2-astra
Agent-Job: SciML__OrdinaryDiffEq.jl__4436--20261122T225241Z-codex-gpt-6.2-astra
Agent-Session: local session 01a20576-6211-7b91-b55e-192c15cedc68 (no session URL)
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.170.0
Agent-Model: gpt-6.2-astra
Agent-Job: SciML__OrdinaryDiffEq.jl__4436--20261122T225241Z-codex-gpt-6.2-astra
Agent-Session: local session 01a20576-6211-7b91-b55e-192c15cedc68 (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.

2 participants