Skip to content

Allow ODE solutions to carry traced return codes - #1564

Draft
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:agent/parametric-ode-retcode
Draft

Allow ODE solutions to carry traced return codes#1564
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:agent/parametric-ode-retcode

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Draft. Ignore this PR until reviewed by @ChrisRackauckas.

What changed and why

ODESolution.retcode was fixed to ReturnCode.T. An OrdinaryDiffEq solve staged inside Reactant.@jit must carry a traced return code through the device loop, so Reactant cannot reconstruct the solution with that concrete field type. This appends the return-code type to ODESolution's parameters and keeps the documented ODESolution{T,N} constructor unchanged. It also lets successful_retcode classify scalar carriers convertible to ReturnCode.T.

This is the SciMLBase prerequisite for the OrdinaryDiffEq Reactant solve work. The generic successful_retcode fallback intentionally matches the one in #1563; whichever PR merges second should drop the duplicate line during conflict resolution.

Verification

After rebasing onto current upstream/master:

$ GROUP=Core julia +1.12.4 --project=. --startup-file=no -e 'using Pkg; Pkg.test()'
Test Summary:      | Pass  Total   Time
Solution interface |   84     84  18.7s
Test Summary: | Pass  Total     Time
Remake        | 4605   4605  4m30.7s
Testing SciMLBase tests passed

$ JULIA_CONDAPKG_BACKEND=Null JULIA_PYTHONCALL_EXE=/usr/bin/python3 GROUP=QA julia +1.12.4 --project=. --startup-file=no -e 'using Pkg; Pkg.test()'
Test Summary: | Pass  Total     Time
QA            |  123    123  3m18.6s
Testing SciMLBase tests passed

$ julia +release --startup-file=no -m Runic --check --diff Project.toml src/retcodes.jl src/solutions/ode_solutions.jl test/solution_interface.jl
$ typos Project.toml src/retcodes.jl src/solutions/ode_solutions.jl test/solution_interface.jl

The default CondaPkg-backed QA run also failed on unchanged master because the machine's shared Pixi cache contains zero-byte Python standard-library files. A standalone Pixi reproducer produced the same init_fs_encoding failure; unchanged master passed all 123 QA assertions with a fresh cache. No test was skipped or silenced.

Reviewer judgment

Appending a type parameter is observable to downstream code that spells every ODESolution parameter explicitly. The documented constructor takes only {T,N} and repository tests cover it, but the 3.51.0 minor bump should be reconsidered if full structural parameterization is treated as supported public API.

Not verified

  • Downstream package suites; the companion OrdinaryDiffEq draft PR will exercise the Reactant path against this branch.
  • GPU-specific paths, which this change does not touch.

🤖 Generated with Codex CLI 0.151.0 (model: unknown). Session: local session ID 01a04f92-0d12-7990-926c-f3e5a23f3a31

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