Skip to content

Fix variable-rate jumps for DAE problems - #627

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:agent/fix-dae-variable-rate-jump
Nov 1, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:agent/fix-dae-variable-rate-jump

Conversation

@ChrisRackauckas-Claude

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

Copy link
Copy Markdown
Member

Please ignore this PR until it has been reviewed by @ChrisRackauckas.

What changed and why

VR_FRM extended a DAE's u0 with the integrated jump-intensity states but left du0 at its original size, so constructing the resulting DAEProblem threw a size mismatch. The DAE wrapper also still used DDE-style function signatures instead of the SciML DAE residual interface.

This extends du0 and differential_vars, evaluates the augmented equations as du_jump - rate(u, p, t) = 0, and preserves the input DAEFunction specialization policy. The regression test covers in-place and out-of-place residual evaluation under FullSpecialize; it also solves the in-place problem with DFBDF.

The OrdinaryDiffEqBDF addition is test-only. It is MIT-licensed and adds no runtime dependency.

Regression evidence

The same official test fails with src/variable_rate.jl restored to the unfixed version:

$ julia +release --startup-file=no --project=. test/extended_jump_array.jl
ERROR: LoadError: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken.
ArgumentError: Sizes of u0 and du0 must be the same.
Test Summary:             | Error  Total  Time
DAE with VariableRateJump |     1      1  2.1s

With this commit applied:

$ julia +release --startup-file=no --project=. test/extended_jump_array.jl
Test Summary:             | Pass  Total   Time
DAE with VariableRateJump |    9      9  17.3s

The historical boundary was bisected to a336dc6, which introduced the DAE remake with an extended u0 but not du0. The original hybrid-problem work at #72 requested DAE coverage but did not add it.

Verification

$ GROUP=InterfaceI JULIA_NUM_PRECOMPILE_TASKS=1 julia +release --startup-file=no --project=. -e 'using Pkg; Pkg.test(coverage=false)'
869 passed across 21 test blocks
Testing JumpProcesses tests passed

$ julia --startup-file=no --project=~/.julia/environments/format-check -e 'using JuliaFormatter; format(".", SciMLStyle(), verbose=true)'
[JuliaFormatter 2.2.0; no tracked diff]

$ git diff --check
[exit 0]

$ git diff --unified=0 upstream/master...HEAD | typos -
[exit 0]

Local GROUP=QA currently reports 16 passed and 1 failed on both this branch and clean upstream/master: SciMLTesting 2.4 enabled the public-reexport check without a repository allowlist. The independent fix is #623; it passes 17/17 locally on SciMLTesting 2.4 and 2.7. That mechanical QA change is intentionally not bundled here, so this PR's CI QA job is expected to remain red until that prerequisite merges.

CI reproduced only that expected failure: 16/17, with No unapproved public reexports as the sole failure in https://github.com/SciML/JumpProcesses.jl/actions/runs/31543893598/job/93952232035.

Not verified

I did not run InterfaceII, GPU, Julia prerelease, or the full Everything matrix locally. The out-of-place DAE residual is evaluated directly by the regression test; an out-of-place DFBDF callback solve is not claimed because that solver configuration does not currently provide the callback's temporary-cache interface.

No documentation build was run because this changes no public API, docstring, or rendered documentation.

Links

🤖 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 2cf84bc)

  • Risk: low (L6: The previous DAE augmentation throws before solving; the repair does not change a working default solver path.)
  • 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: Repairs the broken DAE variable-rate jump wrapper, extending derivatives and differential flags and using the correct residual signature. Direct off-initial-state residual checks provide an independent algebraic check in addition to the PR CI solve.

Blast radius: VariableRateJump augmentation of DAEProblem under VR_FRM, both in-place and out-of-place.

Evidence: InterfaceI CI runs ExtendedJumpArray Tests (35/35), including the DAE construction/residual tests and in-place DFBDF solve. OrdinaryDiffEqBDF is test-only and its MIT license is named in the description. QA has an unapproved-public-reexport failure, not a failing DAE assertion; the sampled current default runs do not prove the same QA failure is pre-existing. Reviewer residual probe passes 8/8 on head; the identical base input errors with mismatched u0/du0 sizes (exit 1).

Blocking findings

None.

Non-blocking findings

  1. test/extended_jump_array.jl:191 — Strengthen the committed regression with an off-initial-state residual assertion or an analytic integrated-hazard/event-time case. The reviewer probe uses physical residual du+u and hazard residual du_jump-(u+1), expecting [12,5] at u=5, du=7, du_jump=11; this catches errors that a self-consistent initial residual alone can miss.

What I ran

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

HEAD was verified equal to 2cf84bc54675629eec763169a899a158d08248fd. 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:

DAE extension independent residual |    8      8  0.7s

Local base, Julia 1.13.0, exit 1:

DAE extension independent residual |     1      1  0.7s

Focused input: a reviewer residual probe with dae(du,u)=du+u, rate u[1]+1, u=5, du=7, and hazard derivative 11, expecting physical/hazard residuals [12,5] for both calling conventions.

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

No local DFBDF time integration, actual jump-event timing, or full downstream suite was run. The focused reviewer test checks the DAE residual equations, not a stochastic distribution.

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

`VR_FRM` extended a DAE's `u0` with the integrated intensities but not `du0`
or `differential_vars`, so the extended `DAEProblem` failed with a size
mismatch, and its residual used DDE-style signatures. The extended residual
is now `du_jump - rate(u, p, t)` with the `(out, du, u, p, t)` /
`(du, u, p, t)` DAE signatures, `du0` is extended with the initial
intensities, and `differential_vars` marks the jump states as differential.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Agent-Harness: Claude Code
Agent-Model: claude-opus-5-5
Agent-Session: local session 216d420e-42ab-48ea-92e5-624683af7850 (no session URL)
@ChrisRackauckas
ChrisRackauckas force-pushed the agent/fix-dae-variable-rate-jump branch from 2cf84bc to a19f7bd Compare November 1, 2026 02:48
@ChrisRackauckas

Copy link
Copy Markdown
Member

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

Rebuilt this branch as a single commit on current master (d856087): a19f7bd. The fix has the same intent as before (DAE residual du_jump - rate(u, p, t) with the (out, du, u, p, t) / (du, u, p, t) signatures, extend_du0, extended differential_vars) and is adapted to master: jumps are passed as a tuple to the unrolled update_jumps!, the specialization comes from master's extended_specialization, and the test passes rng to solve. The test now also checks the residual off the initial state (du + u physical residual and du_jump - (u + 1) hazard residual give [12, 5] at u = 5, du = [7, 11]), as the earlier review suggested. OrdinaryDiffEqBDF (MIT) is a test-only dependency for DFBDF, which OrdinaryDiffEq 7 does not export.

Local results, Julia 1.13.2:

  • test/extended_jump_array.jl with src/variable_rate.jl from master: DAE with VariableRateJump | Error 1, ArgumentError: Sizes of u0 and du0 must be the same.
  • Same file with the fix: DAE with VariableRateJump | Pass 11.
  • GROUP=QA: 20/20 pass (the earlier public-reexport QA failure was fixed on master by Allow intentional public reexports in QA #623).
  • GROUP=InterfaceI: passed (ExtendedJumpArray Tests 66/66).
  • Runic is clean on the added lines; the remaining Runic findings in src/variable_rate.jl and the test file are on master's existing lines and were left alone. typos over the diff: clean.

Not run: InterfaceII, GPU, the full Everything matrix, or an out-of-place DFBDF solve.


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

@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review November 1, 2026 09:15
@ChrisRackauckas
ChrisRackauckas merged commit ce8a8f7 into SciML:master Nov 1, 2026
18 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