Skip to content

Preserve specialization in extended jump problems - #626

Closed
ChrisRackauckas-Claude wants to merge 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:agent/preserve-jump-specialization
Closed

ChrisRackauckas-Claude wants to merge 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:agent/preserve-jump-specialization

Conversation

@ChrisRackauckas-Claude

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

Copy link
Copy Markdown
Member

What changed

Variable-rate jump augmentation now preserves the source ODEFunction, SDEFunction, or DDEFunction specialization policy instead of reconstructing every function with the default AutoSpecialize. This lets ModelingToolkit AutoDespecialize remain active through JumpProblem and stabilizes the solver-facing problem/function types when only the concrete parameter representation changes.

The implementation uses the public, backward-compatible instance API SciMLBase.specialization(prob.f), so this does not raise JumpProcesses SciMLBase compat. DAE augmentation is intentionally excluded: clean master has an independent broken DAE extension path, and its separate functional repair will preserve specialization with its own discriminating test.

Ignore this draft until reviewed by @ChrisRackauckas.

Failing before

I applied the new regression test to unmodified upstream master and ran test/extended_jump_array.jl in a resolved local test environment:

Extended problems preserve specialization: Test Failed
Evaluated: AutoSpecialize == AutoDespecialize

Extended problems preserve specialization | 0 passed, 3 failed, 3 total

All three ODE/SDE/DDE cases lost AutoDespecialize before the source fix.

A same-system ModelingToolkit discriminator also showed that replacing only tunable parameters from Float64 to Float32 left the inner functions as AutoSpecialize and produced different solved problem/function types.

Passing after

The identical regression file on the final commit exits successfully:

Test Summary:                             | Pass  Total  Time
Extended problems preserve specialization |    3      3  1.2s

The full relevant group passed on the registered release graph (SciMLBase 3.46.0, DiffEqBase 7.14.0, OrdinaryDiffEq 7.6.0):

GROUP=InterfaceI julia +release --startup-file=no --project=. -e "using Pkg; Pkg.test(coverage=false)"
ExtendedJumpArray Tests | 29 pass / 29 total
Testing JumpProcesses tests passed
2036.866942 seconds

The same-system discriminator after the fix reports both inner specializations as AutoDespecialize and equal solved problem/function types.

Other verification

  • JuliaFormatter 2.12.4 with SciMLStyle: idempotent on both changed files.
  • typos over added lines: exit 0.
  • git diff --check: exit 0.
  • GROUP=QA: 16 pass / 1 fail. The sole failure is the unchanged clean-master public-reexport allowlist defect already isolated in Allow intentional public reexports in QA #623; ExplicitImports and all other QA checks pass.
  • Docs were not built because this changes no public API or documentation.
  • GPU and Julia pre were not run locally.

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

Risk assessment (independent review, Codex Desktop (Codex core 0.164.0-alpha.11.1) gpt-6.1-sol, slot 1, head 3113bf1)

  • Risk: low (L6: Restores the requested specialization without adding public signatures or changing the jump equations.)
  • Verdict: MERGE
  • Session: 01a18db8-25fc-7b72-9d35-a1341e0ae484
  • Blocking priorities: none

Review round 1, written by the reviewer named above (Codex Desktop (Codex core 0.164.0-alpha.11.1) / gpt-6.1-sol) 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: Carries each source ODE/SDE/DDE function specialization through variable-rate jump augmentation. The focused regression distinguishes the old AutoSpecialize fallback from the requested AutoDespecialize policy.

Blast radius: VR_FRM extended ODE, SDE and DDE problem wrappers; DAE is intentionally outside this diff.

Evidence: InterfaceI and InterfaceII checks are green. QA reports an unapproved public reexport; the code change does not alter the module export list, but the sampled current default-branch runs do not reproduce that exact failure. Local head specialization assertions pass 3/3; the identical base control fails all 3 (exit 1).

Blocking findings

None.

Non-blocking findings

None.

What I ran

gh pr view 626 --repo SciML/JumpProcesses.jl --json number,url,state,isDraft,headRefOid,baseRefName,baseRefOid,title,files,commits,statusCheckRollup
git fetch origin "+refs/pull/626/head:refs/remotes/pr/626" "master" "ce9509e04a165492eee64492f44e25d78f48a887"
git checkout --detach 3113bf10f649538befd02b198421b50a6d8b6179
git rev-parse HEAD
git diff ce9509e04a165492eee64492f44e25d78f48a887...HEAD
git diff --check ce9509e04a165492eee64492f44e25d78f48a887...HEAD
git log -1 --no-merges --format=%B 3113bf10f649538befd02b198421b50a6d8b6179
gh pr checks 626 --repo SciML/JumpProcesses.jl
gh pr view 626 --repo SciML/JumpProcesses.jl --json body,closingIssuesReferences

HEAD was verified equal to 3113bf10f649538befd02b198421b50a6d8b6179. git diff --check exited 0. The diff was compared to the recorded live base through its merge base, not directly against unrelated base-only commits. Root/nested agent instructions and surrounding changed-code callers were inspected. Author metadata above is from the newest non-merge commit only; absent trailers are intentionally unknown.

Local Julia processes ran sequentially with JULIA_NUM_THREADS=4, OPENBLAS_NUM_THREADS=1, an isolated temporary directory and a task-owned first depot (existing global depot read as a fallback). Commands used julia --startup-file=no --compiled-modules=no --project=<isolated-environment> after Pkg.develop selected the exact checkout. Focused tests were extracted unchanged from the named committed testset except for explicitly described reviewer probes; full Pkg.test was not run. Machine-specific scratch paths are omitted to follow the review-file rule.
Local head, Julia 1.13.0, exit 0:

Extended problems preserve specialization |    3      3  0.9s

Local base, Julia 1.13.0, exit 1:

Extended problems preserve specialization: Test Failed at <redacted>:32
Extended problems preserve specialization |    3      3  1.2s

Focused input: the testset Extended problems preserve specialization from test/extended_jump_array.jl.

CI inspection: gh run view <run-id> --repo SciML/JumpProcesses.jl --log-failed, and for selected green jobs gh run view <run-id> --job <job-id> --repo SciML/JumpProcesses.jl --log. Default-branch samples used gh run list --repo SciML/JumpProcesses.jl --branch master --event push --limit 5 --json databaseId,conclusion,headSha,url,name; completed failing runs were read rather than assuming equivalence from status alone.

11 checks successful/skipped/neutral; 1 checks failed/cancelled/pending at the captured snapshot. These counts include external status checks.

Sampled current default-branch runs (status alone is not used to waive failures):

What I did not verify

The full ODE/SDE/DDE solver and downstream suites were not rerun locally. Current default-branch green status is not proof that the older PR QA failure can be ignored.

This review continues the interrupted Codex session 01a18dad-6f75-7ae1-b6dc-3a84553833ec, retaining its exact-head checkouts, CI logs and sequential test evidence. The continuation session is 01a18db8-25fc-7b72-9d35-a1341e0ae484. Initial risk ratings were saved before author descriptions; those descriptions contained embedded earlier reviews, so complete prior-review blindness was not maintained. The initial findings were frozen before the explicit same-head review comparison; additional corroboration is identified as post-freeze. This limitation is disclosed rather than claiming full blind-first compliance.

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

@ChrisRackauckas

Copy link
Copy Markdown
Member

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

On current master (d856087) this PR looks superseded; the branch is left unchanged and the PR open for a decision.

  • master already rebuilds the extended function with the input's specialization in all four extend_problem methods (ODE, SDE, DDE, DAE) through extended_specialization in src/variable_rate.jl, covered by test/specialization.jl ("VR_FRM keeps the problem's specialization").
  • The one behavioral difference is intentional on master: AutoDespecialize (and AutoRespecialize, FunctionWrapperSpecialize) become AutoSpecialize, because under AutoDespecialize the integrator hands the jump callbacks a parameter container instead of prob.p. This PR's test asserts that AutoDespecialize is kept, which conflicts with master's documented choice and its test.
  • Checked locally that the DDE path, which master's tests do not cover, keeps FullSpecialize and NoSpecialize and maps AutoDespecialize to AutoSpecialize, as the ODE path does. The DAE path is covered by the test in Fix variable-rate jumps for DAE problems #627.

Nothing from this PR needs porting.


🤖 Posted by an AI agent — harness: Claude Code · model: claude-opus-5-5
Conversation: local session 216d420e-42ab-48ea-92e5-624683af7850 (no session URL)

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