Skip to content

Support compiled ODE return codes and specialization - #1564

Merged
ChrisRackauckas merged 3 commits into
SciML:masterfrom
ChrisRackauckas-Claude:agent/parametric-ode-retcode
Sep 23, 2026
Merged

ChrisRackauckas merged 3 commits into
SciML:masterfrom
ChrisRackauckas-Claude:agent/parametric-ode-retcode

Conversation

@ChrisRackauckas-Claude

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

Copy link
Copy Markdown
Member

Draft. Ignore this PR until reviewed by @ChrisRackauckas.

ODESolution.retcode can carry a traced scalar through a compiled solver loop, while the documented ODESolution{T,N} constructor remains available. successful_retcode also accepts scalar carriers convertible to ReturnCode.T.

A SciMLBase-owned ReactantCore extension now reports FullSpecialize for AutoSpecialize ODE functions during compilation. Both instance and type dispatch are covered; ordinary execution and explicit specialization choices retain their behavior. This removes the need for OrdinaryDiffEq to define methods on SciMLBase types. ReactantCore is an optional MIT-licensed dependency.

Verification

Local Julia 1.12.4 Pkg.test() groups:

GROUP=Core
Remake        | 4605   4605  4m17.5s
Testing SciMLBase tests passed

GROUP=Reactant
Reactant specialization | 4  4  5m04.1s
Testing SciMLBase tests passed

GROUP=QA
QA | 123  123  8m15.9s
Testing SciMLBase tests passed

The final QA command was:

GROUP=QA JULIA_PKG_PRECOMPILE_AUTO=0 TMPDIR="$PWD/../OrdinaryDiffEq-shared-reactant/.work/tmp" PIXI_CACHE_DIR="$PWD/../OrdinaryDiffEq-shared-reactant/.work/pixi-base-review" RATTLER_CACHE_DIR="$PWD/../OrdinaryDiffEq-shared-reactant/.work/pixi-base-review" julia +1.12.4 --project=. -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing"])'

The new specialization regression fails with the unfixed SciMLBase:

Test Failed at test/reactant_specialization.jl:21
Evaluated: Float32[0.0, 0.0] == Float32[1.0, 2.0]

The same test passes with the extension (4/4 above). The docs build, Runic, spelling, and whitespace checks also passed locally. Reactant is installed only for its dedicated test group, leaving the LTS default test dependencies unchanged.

The pre-existing master QA failure was bisected and fixed separately in the prerequisite linked below. Its immediate parent passed 123/123; the introducing commit failed on the stale Markdown @doc_str import; the separate fix passed 123/123 before incorporation here.

Review limits

Appending the return-code parameter is observable to code spelling every structural ODESolution parameter. The documented {T,N} constructor is preserved and tested. GPU execution and downstream package suites were not run; the companion OrdinaryDiffEq change provides integration coverage.

CI follow-up (2026-09-12)

Core (both architectures), QA, and Reactant CI groups passed. SciMLSensitivity Core1 subsequently received signal 11 in Julia 1.13 LLVM code; this downstream failure remains unresolved: https://github.com/SciML/SciMLBase.jl/actions/runs/34686906579/job/103535370853.

Catalyst downstream CI failed during test-environment setup, before its assertions: Permission denied while writing the installed package’s test/extensions/Project.toml. The same failure occurs on the separate Markdown-import cleanup branch. This CI failure remains unresolved; the local Core, Reactant, QA, and docs results above are the verified coverage.

Links

🤖 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.

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
ChrisRackauckas and others added 2 commits September 12, 2026 05:34
The docstring cleanup in fae101f removed the final use of @doc_str,
leaving the import rejected by the existing explicit-import QA check.

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 specialization dispatch with the owning package and cover its compiled
and ordinary behavior. Include current master and the separate stale-import
QA fix while preserving the parametric ODESolution return-code change.

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 Allow ODE solutions to carry traced return codes Support compiled ODE return codes and specialization Sep 12, 2026
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review September 23, 2026 08:39
@ChrisRackauckas
ChrisRackauckas merged commit 140337a into SciML:master Sep 23, 2026
71 of 73 checks passed
ChrisRackauckas added a commit that referenced this pull request Sep 23, 2026
Ships #1564: compiled ODE return codes and specialization are supported. Minor because it adds handling users can rely on.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.273
Agent-Model: claude-opus-5[1m]
Agent-Session: 6a01e420-3436-4518-83cc-6cd853283cfb (local transcript; this harness publishes no conversation URL)
ChrisRackauckas added a commit that referenced this pull request Sep 23, 2026
Ships #1564: compiled ODE return codes and specialization are supported. Minor because it adds handling users can rely on.



Agent-Harness: Claude Code 2.1.273
Agent-Model: claude-opus-5[1m]
Agent-Session: 6a01e420-3436-4518-83cc-6cd853283cfb (local transcript; this harness publishes no conversation URL)

Co-authored-by: Claude <noreply@anthropic.com>
ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/SciMLBase.jl that referenced this pull request Sep 26, 2026
The compatibility constructor keeps every existing public spelling and
call working. The only observed downstream effect is a concreteness
assertion on SCCNonlinearSolve's internal `sols` buffer (a performance
property of its own code, not a public-API break), and the identical
ODESolution change in SciML#1564 shipped as a minor release. Leave the
version untouched per project policy for behavior-preserving changes.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Devin <noreply@cognition.ai>
Agent-Harness: Devin CLI 3000.11.3
Agent-Model: swe-2-high
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/SciMLBase.jl/jobs/1619-devin/log.txt on amdci2.julia.csail.mit.edu
ChrisRackauckas added a commit that referenced this pull request Sep 26, 2026
* Make NonlinearSolution's retcode field type a parameter

`NonlinearSolution.retcode` was declared `::ReturnCode.T`, so a return
code carried by another scalar type (e.g. a Reactant `TracedEnum`
produced inside a compiled solver loop) cannot be stored in it.
Mirror the ODESolution change (#1564): the field becomes `retcode::RC`
with `RC` a new trailing type parameter, and `solution_new_retcode`
gains a `NonlinearSolution` method that preserves the carrier type.

A `NonlinearSolution{T,N,uType,R,P,A,O,uType2,S,Tr}` type application
now denotes a non-callable UnionAll, so a constructor covering that
ten-parameter spelling keeps downstream code that spells out the
parameters working, inferring `RC` from the `retcode` argument.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Devin <noreply@cognition.ai>
Agent-Harness: Devin CLI 3000.11.3
Agent-Model: swe-2-high
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/SciMLBase.jl/jobs/1619-devin/log.txt on amdci2.julia.csail.mit.edu

* Revert version bump; change is non-breaking

The compatibility constructor keeps every existing public spelling and
call working. The only observed downstream effect is a concreteness
assertion on SCCNonlinearSolve's internal `sols` buffer (a performance
property of its own code, not a public-API break), and the identical
ODESolution change in #1564 shipped as a minor release. Leave the
version untouched per project policy for behavior-preserving changes.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Devin <noreply@cognition.ai>
Agent-Harness: Devin CLI 3000.11.3
Agent-Model: swe-2-high
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/SciMLBase.jl/jobs/1619-devin/log.txt on amdci2.julia.csail.mit.edu

* Drop caller name from ten-parameter constructor test comment

State the constructibility invariant without naming an external
call site, matching the package comment convention.

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/NonlinearSolve.jl/jobs/1332-cursor/log.txt on amdci2.julia.csail.mit.edu

---------

Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com>
Co-authored-by: Devin <noreply@cognition.ai>
Co-authored-by: Cursor Agent <noreply@cursor.com>
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