Repository navigation
Share ordinary solver paths with Reactant - #4436
ChrisRackauckas-Claude wants to merge 53 commits into
Conversation
|
Implementation/CI plan:
|
5e7c058 to
fcef277
Compare
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
fcef277 to
9f78a3c
Compare
| if ReactantCore.within_compile() | ||
| isnothing(dt) && integrator.opts.adaptive && auto_dt_reset!(integrator) | ||
| return nothing | ||
| end |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).
| if ReactantCore.within_compile() | ||
| return integrator.opts.adaptive ? | ||
| _traced_adaptive_solve!(integrator, integrator.controller_cache) : | ||
| _traced_fixed_step_solve!(integrator) | ||
| end |
There was a problem hiding this comment.
Why is this treated as separate code instead of integrating it?
There was a problem hiding this comment.
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")) |
There was a problem hiding this comment.
doesn't reactant want a constant size output? That would require using saveat
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
we really need saveat for reactant
There was a problem hiding this comment.
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.
| !adaptive && isnothing(dt) && | ||
| throw(ArgumentError("dt is required for fixed-step solves inside Reactant compilation")) |
There was a problem hiding this comment.
why is this different? dt with tstops is the only other way, but tstops aren't supported, so this is an unnecessary check?
There was a problem hiding this comment.
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.
| isimplicit(alg) && | ||
| throw(ArgumentError("implicit algorithms are not supported inside Reactant compilation")) |
There was a problem hiding this comment.
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.
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
|
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 |
| if isinplace(integrator.sol.prob) | ||
| recursivecopy!(integrator.fsalfirst, integrator.fsallast) | ||
| fsalfirst, fsallast = if ReactantCore.within_compile() | ||
| get_fsalfirstlast(integrator.cache, integrator.u) |
There was a problem hiding this comment.
why would this be a function call only within compile?
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
why is clamping ignored in reactant compile?
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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.
| # 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₁) |
There was a problem hiding this comment.
why would reactant compile not do a NaN check?
There was a problem hiding this comment.
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.
| end | ||
| return tdir * max(dtmin, min(100dt₀, dt₁, dtmax_tdir)) | ||
| result_dt = tdir * max(dtmin, min(100dt₀, dt₁, dtmax_tdir)) | ||
| if ReactantCore.within_compile() |
There was a problem hiding this comment.
What exactly is this doing?
There was a problem hiding this comment.
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.
| # 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 |
There was a problem hiding this comment.
This is piracy, should go to SciMLBase
There was a problem hiding this comment.
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.
| if ReactantCore.within_compile() && adaptive && | ||
| !(controller_cache isa Union{IControllerCache, PIControllerCache}) | ||
| throw(ArgumentError("only IController and PIController are supported inside Reactant compilation")) |
There was a problem hiding this comment.
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.
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>
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
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
Merged the default branch into this PR to resolve conflicts (head e00ade7). Re-review the resolution before merging. Conflict resolution reportSTATUS: RESOLVED Note: the Reactant group has 1 failing assertion. The PR description already reports it at the PR head Conflicting filesBoth sides fixed the same bug: GlobalDiffEq rejected solves that carried DiffEqBase's empty type-erased
Both versions behave the same:
Runic ( Tests (Julia 1.12.7 for Reactant; default juliaup channel elsewhere)Logs are in
The Reactant harness's 🤖 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 |
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)
PR: #4436 Reviewed head: a7fc4eb Risk assessment
Review reportVERDICT: CHANGES Riskmedium-high (MH1: shared solve!, initialization and check_error dispatch change on the Tsit5, Verner and default-solver main lanes). Blocking findings
Non-blocking findingsNone. What I ranAI reviewer: Codex CLI 0.164.0, model
What I did not verifyGPU 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 |
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)
Decision from the repo maintainer (Chris, 2026-11-22): the two private Reactant names used by the extension — 🤖 Posted by an AI agent — harness: Claude Code · model: qwen3.8-flash-next |
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)
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, usertstops, customunstable_check/isoutofdomain,force_dtmin, step limiters, …) throw anArgumentErrorbefore tracing; #4657 tracks them.The compiled error check is the host's check.
DiffEqBase.de_check_erroris a cascade over ordered predicates (existing failure code, NaNdt,maxiters,dtmin,dt <= eps(t),unstable_check,last_step_failed), andDiffEqBase.staged_check_errorevaluates the same predicates without branching for traced state.SciMLBase.check_error(::ODEIntegrator)routes tode_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 exactdt <= eps(t)comparison on bit patterns (compiled CPU code flushes subnormals), the spacingeps(t)of a traced time (Reactant'seps(::TracedRNumber)returnseps(T)), and FastPower's approximate power for the controllers (TracedRNumberis not<: Real, sofastpowerfell back tox^y, turning rejected NaN/overflow steps into NaNdt; that, not the error check, caused the round-9DtLessThanMin/DtNaN→Unstablemismatches). The compiled power classifies zero and infinity on bits and rounds aFloat64whoseFloat32conversion is subnormal onto the subnormal grid in integer arithmetic, so it follows FastPower on Float32-subnormal inputs too; tracedFloat16controller powers throw anArgumentError.The extension's only non-public Reactant names are
Reactant.TracedRNumber(methods for traced numbers have no other dispatch handle) andReactant.Ops.bitcast_convert(Reactant defines noreinterpretfor traced numbers); everything else goes throughReactantCore.promote_to_traced,Base.convert, integer^and local bit masks. GlobalDiffEq, which callsDiffEqBase.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(Reactant0.2.289, ReactantCore0.1.23,[sources]for the in-repo packages), activated liketest/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 oftest/Reactant/reactant_tests.jlwithOrdinaryDiffEqTsit5):Round 10. Controller-power regressions (now including subnormal
Float32inputs, normalFloat64inputs that convert to subnormalFloat32, and the Float16 rejection): 1780 pass / 461 fail on298450497, 2241/2241 on160742b80. The reviewer'sround10/scratch/subnormal_power.jl: 3/6 → 6/6. ExplicitImports over the loaded extension: non-public names areReactant.TracedRNumber,Reactant.Ops.bitcast_convert, plus the extension's own parent hooksOrdinaryDiffEqCore.controller_fastpower/dt_below_time_eps/value_eps. GlobalDiffEqGROUP=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.jlwithXLA_FLAGS=--xla_cpu_ftz=false: still flushes, still hostUnstable/ compiledDtLessThanMin.Reactant group at
160742b80(GROUP=Reactant julia +1.12 --project=. -e 'using Pkg; Pkg.test()', through the new env):The one failure is a pre-existing assertion that cannot hold exactly; see Known limitation below. (Counts at
07922628awere 1957/1958.) It passed on2e8b79c89only through the blanket NaN-dt→Unstableremap that round 9 required removing.Other suites
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:2e8b79c89: 124/124 Tsit5 scenarios identical, including messages.217e0adef: 116/128 identical. The 12 that differ are all in-placep = NaNwith automatic initial dt: master returnsDtNaN(its in-place initial-dt estimate misses the NaN behind the fast-math norm and returnsdt = NaN), this PR returnsUnstableafter theinit_NaNfallback that out-of-place solves already use. That difference comes from the PR's earlier initdt rework, not from this round.probe.jlinitial-dt table: identical to master except the same in-place NaN row (NaN / dt_NaNvs1e-323 / init_NaN).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 = 0withp = NaNand the defaultdtmin = 0: the host's rejecteddtshrinks to1.4e-45and stops withUnstable(dt <= eps(0)), while the compileddtunderflows to0and stops withDtLessThanMin. Withdtmin = floatmin(Float32)or1f-30both report the same code (checked for p = NaN and 1e30). Thedt <= 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)and1f-30, and docs text) is prepared but not committed; it passes 53/53 locally.Related residual: the compiled initial-dt fallback near
t = 0usesfloatmin(T)where the host uses a subnormaleps(t0).What I did not verify
Everything, GPU, Downstream, and sublibrary groups other than those listed; Julia LTS/pre.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.jl94–101), Differentiation Core and Downgrade (diag(::ScalarOperator)), Rosenbrock QA (Rosenbrock32DAE inference), Delay Regression (Waltman), root GPU (QNDFdiag_cumismatches), 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 toDiffEqBase.de_check_error, the logic SciMLBase's generic method also implements; verified identical output (messages included) over the matrix above.Reactant.TracedRNumberandReactant.Ops.bitcast_convertare the extension's remaining non-public Reactant accesses; no public equivalent exists in Reactant 0.2.289.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.activate_reactant_envfollowsactivate_gpu_env, so a local run rewritestest/Reactant/Project.toml'sOrdinaryDiffEqsource to an absolute path (as the GPU group does).Risk assessment
DiffEqBase.de_check_error(same conditions and order); controller powers go throughcontroller_fastpower(identity on the host). Compiled behaviour changes only inside Reactant tracing. New public DiffEqBase API.298450497: medium risk, CHANGES (FTZ divergence, subnormal controller power, non-public Reactant names, GlobalDiffEq floor). The last three are addressed at160742b80; the FTZ policy awaits @ChrisRackauckas. Re-review pending.🤖 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
solve!inner loop,loopheader!/_loopfooter!accept/reject,modify_dt_for_tstops!,handle_dt!, bothode_determine_initdtpaths, and all controllers. It also moves every ODE error check onto the refactoredDiffEqBase.de_check_error.ReactantCorebecomes a hard (non-weak) dependency of OrdinaryDiffEqCore, so every user loads it.ODEIntegratorgets two new type parameters (CountType,FlagType), anditer/success_iter/accept_step/last_stepfail/next_step_tstopare no longer fixed toInt/Bool.PIDControllerCache.errchanges fromVectortoNTuple, which breaks any outside code that writescache.err[i] = …. I searched SciML code on GitHub and found no positionalODEIntegrator{…}constructions and no mutation oferr. Downstream users are DelayDiffEq, StochasticDiffEq*, GlobalDiffEq (its compat now requires DiffEqBase ≥ 7.22 and OrdinaryDiffEqCore ≥ 4.19) and LowOrderRK (theRKMCacheFSAL buffer changed).160742b80has 276 checks passing, 9 failing and 3 skipped. 8 of the 9 failures are pre-existing: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 samehigh_level_solve.jl:94–101assertions 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.tests / Reactant (Julia 1): 3014 pass / 1 fail atreactant_tests.jl:114("Compiled failure retcodes match host": the compiled solve returnsDtLessThanMin, the host returnsUnstable, 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.Reactant.TracedRNumberandReactant.Ops.bitcast_convert. Both are disclosed.has_callbacks,de_check_error,staged_check_error,check_error_failed_retcode,check_error_dt_below_time_eps. The body says "four" and mentionshas_callbacksseparately. Version bumps are minor (DiffEqBase 7.22.0, OrdinaryDiffEqCore 4.19.0), which fits additive changes.Unstableinstead ofDtNaN. This is disclosed, covering 12 scenarios.ReactantCorebecomes a hard dependency of OrdinaryDiffEqCore (compat0.1.21). The body does not state its license.ODEIntegratortype-parameter and field-type changes, and thePIDControllerCache.errtype change.should_exit & accept_step, notshould_exit.dtproposeis now set in the non-adaptive zero-dtcachebranch.eltype(prob.tspan)instead oft isa AbstractFloat.handle_dt!now runs for everydt.within_compile()calls are added to the step loop.get_fsalfirstlastchange for LowOrderRK'sRKMCache.ode_initdttest is now wrapped in@test_logs, which makes it stricter.🤖 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/GlobalDiffEqGROUP=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 withp = NaN: compiledDtLessThanMin, hostUnstable), identical on the pre-merge head in CI.GROUP=InterfaceI: passed.lib/DelayDiffEqGROUP=Regression: passed, including master's new tracked-discontinuity coalescing test.The red
lib/OrdinaryDiffEqNonlinearSolveCore 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 withp = NaN: compiledDtLessThanMin, hostUnstable. Probes with Reactant 0.2.293 (Reactant_jll 0.0.421) show the result depends on the XLA backend:ubuntu-latestuses): compiled code treats subnormal inputs as zero and flushes subnormal results, for both Float32 and Float64. Forx = nextfloat(0f0),x > 0isfalseandx * 2^30is0;floatmin(T) / 5is0. The group gives 3014 pass / 1 fail.dt: the controller division, thedtmincomparison,t + dt, and the stage arithmetic of any step accepted at that size. The last cannot be done in general.Unstablelike the host and line 114 passes. Instead,Compiled controller power follows FastPowerfails 3 assertions per float type. The worst relative error is 3.45e-7 against the2eps(Float32)tolerance, caused by CUDA'sexp2. CI does not run this group on a GPU.Options:
floatmin(T). This is reachable only whendtmin < floatmin(T)and|t|is below about2^-100(Float32) or2^-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 fordtmin = floatmin(T).floatmin(T), e.g. a defaultdtmin = floatmin(T)for float time. Host retcodes for such solves would change fromUnstabletoDtLessThanMin. Not implemented or tested.The assertion is unchanged.
2. Non-public Reactant names: documented and enforced as a narrow exception; not promoted upstream.
public, nor documentsReactant.TracedRNumberorReactant.Ops.bitcast_convert, and it defines noreinterpretfor traced numbers.test/Reactant/explicit_imports.jlruns first in the Reactant group. It applies ExplicitImports'check_all_explicit_imports_are_publicandcheck_all_qualified_accesses_are_publicto the loadedOrdinaryDiffEqCoreReactantExt. It ignores only those two names, plus the extension's methods on OrdinaryDiffEqCore's own hooks (controller_fastpower,dt_below_time_eps,value_eps).using Reactant: TracedRArrayto the extension makes it fail withNonPublicExplicitImportsException.lib/OrdinaryDiffEqCore/AGENTS.mdrecords the rule. ExplicitImports is MIT-licensed and is a dependency of thetest/Reactantenvironment only.TracedRNumberpublic, and either addBase.reinterpretfor traced numbers or declareOps.bitcast_convertpublic. 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.--check,typosandgit diff --checkon the changed files: clean.Breaking change
None. No public name is removed or renamed, and no public signature changes.
Required version bumps:
One host behaviour changes: in-place solves with NaN parameters and automatic initial
dtreturnUnstableinstead ofDtNaN, 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/tendover(0, tend), exactu(tend) = e^-1 = 0.367879:tend1f-36(Float32)1f-375f-38t = floatmin1e-306(Float64)1e-307t = floatmindttimes 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 belowfloatmin(T).exp2fails the controller-power tolerance (round 2 section).Fixed this round: on the CPU backend, compiled solves returned
Successwith a wrong state for end times below100 floatmin(T)(bold entries above). CUDA was not measured before the fix.100 * value_eps(t), and the tracedvalue_epsraises a subnormal spacing tofloatmin(T). That gave a tolerance of100 floatmin(T), larger than the whole interval, so the first step snappedtto the end time.OrdinaryDiffEqCore.tstop_tolerance(x).100 * eps(x), so host values are unchanged.100times the spacing where compiled arithmetic represents it, andfloatmin(T)where the spacing flushes to zero.5 floatmin(T)and100 floatmin(T)are now correct. The two smallest now stop withDtLessThanMin(a CPU-only mismatch under the decision above) instead of returning a wrong answer.End time $tendtestset intest/Reactant/reactant_tests.jlcoverstend ∈ (1f-37, 1f-36, 1e-306). It checks the retcode against the host,t == [tend], andu ≈ e^-1with the file'srtol = 5e-4.Fail before the fix, then pass after (CPU backend, same test file):
Checks (Julia 1.13.2):
GROUP=ReactantwithCUDA_VISIBLE_DEVICES="":Reactant Extension Imports | 3 3andReactant 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/OrdinaryDiffEqCoreGROUP=Core: passed.typosandgit diff --check: clean.tstop_toleranceis internal (not exported orpublic), and no dependencies changed. The## Breaking changesection 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)
Risk assessment (independent review, Codex CLI 0.164.0-alpha.11.1 gpt-6-astra, slot 1, head a7fc4eb)
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
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.@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
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 5and the corresponding per-workflow lists were inspected.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
Fix by Codex CLI 0.170.0 gpt-6.2-astra (head f1d9947)
Merged master
ace83e0140into 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 returnsUnstableat 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.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 raisedLineSearchException: Search direction is not a direction of descent. Step length: 0.0in 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 issueOpen review finding (P2). Reactant 0.2.308 reports
Base.ispublicfalse for bothTracedRNumberandOps.bitcast_convert. Compilingreinterpret(UInt32, x)on a traced Float32 threwArgumentError: 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)
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:
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)
Fix by Codex CLI 0.170.0 gpt-6.2-astra (head 990f805)
Compiled initialization now throws
ArgumentErrorwhen the larger endpoint magnitude has subnormal spacing andabs(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 withExpected: 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
ArgumentErrorin the existing constant-slope test at1.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.
The first Core run used
--compiled-modules=existingand failed its precompilation assertion with0 > 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)
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
dtmaxin 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
ArgumentErrornaming 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.
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)