Skip to content

Add SDEProblem specialization constructor route - #1580

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:codex/sde-specialization
Sep 6, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:codex/sde-specialization

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

What changed and why

Implement the documented SDEProblem{isinplace, specialize}(f, g, u0, tspan, p; kwargs...) constructor by routing through SDEFunction{isinplace, specialize}, matching the existing ODE constructor pattern. Regression coverage exercises both in-place and out-of-place construction for all six specialization markers. SciMLBase moves to 3.51.0 because this makes the public specialization constructor usable.

Ignore this PR until it has been reviewed by @ChrisRackauckas.

Failing before the fix

On clean master 3d95609f7dc1c86a8fded41b9d357bcf25b83ad3, the new constructor assertion cannot run:

julia --project=. -e 'using Test, SciMLBase; ...; prob = SDEProblem{true, SciMLBase.AutoDespecialize}(f!, g!, [1.0], (0.0, 1.0), [0.1]); @test SciMLBase.specialization(prob.f) === SciMLBase.AutoDespecialize'
ERROR: MethodError: no method matching (SDEProblem{true, SciMLBase.AutoDespecialize})(::typeof(f!), ::typeof(g!), ::Vector{Float64}, ::Tuple{Float64, Float64}, ::Vector{Float64})

Passing after the fix

The same assertion on this branch exits successfully:

SDE specialization assertion passed

The committed regression test covers the full marker matrix:

Problem building tests | 147 passed

Verification

GROUP=Core julia --project=. -e 'using Pkg; Pkg.test()'
Problem building tests | 147 passed
Remake | 4605 passed
Testing SciMLBase tests passed

PIXI_CACHE_DIR=/home/crackauc/sandbox/tmp_20260904_111048_68452/pixi-fresh-cache GROUP=QA julia --project=. -e 'using Pkg; Pkg.test()'
QA | 123 passed
Testing SciMLBase tests passed

julia --project=docs docs/make.jl
Document checks and HTML rendering completed; exit code 0

julia --project=. -e 'using Runic; exit(Runic.main(ARGS))' -- --check src/problems/sde_problems.jl test/problem_building_test.jl
exit code 0

typos Project.toml src/problems/sde_problems.jl test/problem_building_test.jl
exit code 0

The first QA attempt exposed a machine-local corrupt pixi cache with zero-byte Python standard-library files. Clean master and this branch both passed 123/123 with the same fresh cache, so no source workaround was added.

Not run locally: GPU, downstream, or allowed-to-fail jobs.

Reviewer judgment: the 3.51.0 minor bump follows the repository precedent for making a new specialization constructor route public.

🤖 Generated with Codex CLI 0.153.4 (model: unknown; session: local thread 01a06c1d-564b-7ef0-ada6-d83a233b55e2; no shareable URL was exposed).

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: OpenAI Codex <[email protected]>
Agent-Harness: Codex CLI 0.153.4
Agent-Model: unknown
Agent-Session: local thread 01a06c1d-564b-7ef0-ada6-d83a233b55e2
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

The downstream specialization/precompile consumer is now available as a draft at SciML/OrdinaryDiffEq.jl#4467. It replaces the rejected typed-reference implementation in SciML/OrdinaryDiffEq.jl#4457.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

CI investigation (2026-09-05): the two DownstreamAD failures reproduce on clean SciMLBase master 3d95609f with Mooncake 0.5.52. The focused result is 6 passed, 3 errored, 1 broken; all three errors originate in Mooncake._copy_output while copying an Any-field NamedTuple.

A standalone non-SciML Mooncake reproduction and git bisect run confirmed this is pre-existing and unrelated to the SDE constructor change. The existing reports are:

The bisected first SciMLBase commit exposing the upstream behavior is a932b02. The candidate Mooncake reconstruction fix passed both the direct reproduction and a public DifferentiationInterface.gradient reproduction locally.

@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review September 6, 2026 00:49
@ChrisRackauckas
ChrisRackauckas merged commit 9edbe68 into SciML:master Sep 6, 2026
67 of 69 checks passed
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