Repository navigation
Use MassActionJump directly in stochastic tau-leaping solvers - #4523
ChrisRackauckas-Claude wants to merge 3 commits into
Conversation
Initialize reaction noise through a solver-owned public hook, retain mass-action stoichiometry for updates, and fuse implicit drift evaluation. Cover in-place and out-of-place solves, general rates, and stored higher-order rate constants. Document supported stepping and add a reproducible representation benchmark. 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 session ID 01a070e6-21f2-7dd3-bf52-2ddaf108ac53
Restrict native mass-action initialization to PureLeaping so existing regular leaps can retain exact SSA callbacks. Promote propensity buffers when rate constants are integers. Keep the executable StochasticDiffEq example with its own package so the JumpProcesses prerequisite can be released independently. 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 session ID 01a070e6-21f2-7dd3-bf52-2ddaf108ac53
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Devin <noreply@cognition.ai> Agent-Harness: Devin CLI 3000.11.3 (conflict resolution), Claude Code 2.1.285 (orchestration) Agent-Model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium Agent-Session: local Claude session 3c311569-dda6-4687-bc9f-65febb212c33 (fleet master); Devin log /Users/chrisrackauckas/sandbox/master/fusion-fixes/SciML_OrdinaryDiffEq.jl-4523/log.txt # Conflicts: # lib/StochasticDiffEqCore/Project.toml
Merged the default branch into this PR to resolve conflicts (head 3442f3a). Re-review the resolution before merging. Conflict resolution reportSTATUS: RESOLVED Conflicting files
Every other file merged without conflict. I checked how master's StochasticDiffEqCore changes fit with the PR. The first is the split of Runic: the only file I touched is a TestsThe PR needs To test, I cloned that PR branch (ChrisRackauckas-Claude/JumpProcesses.jl at 087b42c9bec5129ac2b9741658821c7d6027cbf4) into No failures or errors. The first QA run errored in Aqua's persistent-tasks check because Notes for review (not changed: outside the scope of a merge)
Links
🤖 Posted by an AI agent — harness: Devin CLI 3000.11.3 (merge), Claude Code 2.1.285 (posting) · model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium |
Tau-leaping solvers currently require
RegularJumpcallbacks and estimate rate scales by evaluating atu ./ u. Add nativeMassActionJumpsupport toTauLeaping,CaoTauLeaping,ImplicitTauLeaping, andThetaTrapezoidalTauLeaping: retain stoichiometry, read stored constants directly, and fuse drift evaluation during implicit iteration.The new public
StochasticDiffEqCore.jump_noise_datahook lets each solver choose its reaction representation. General in-place/out-of-place regular jumps and exact SSA callbacks remain supported. Integer rate constants use floating propensity buffers. Documentation covers the native input and corrects the incomplete adaptive Cao selector; no GPU implementation is added.Depends on the public mass-action operations and JumpProcesses 9.33 from SciML/JumpProcesses.jl#652 . Registry-only CI cannot resolve that version until it is released. Core advances to 2.3 and Leaping to 2.2 for the new public API and input support. The new documentation dependency, JumpProcesses, is MIT licensed, like this repository.
Verification
Julia 1.12.6, with the JumpProcesses prerequisite and monorepo dependencies developed locally. Ran the existing test entry points;
Pkg.testhit a local relative-[sources]resolution error before launching tests.Both QA suites used their declared-compatible JET 0.11.6. Aqua's Leaping subprocess used a temporary local JumpProcesses source entry to resolve the unreleased prerequisite; it was restored before committing. Runic on changed lines,
typosover changed files, andgit diff --checkpassed. Actual GPU execution and other stochastic algorithm groups were not run.Discriminating tests caught two errors in the initial implementation (667d58e):
The same cases now pass in the 118-check mass-action set, including fixed-seed trajectory equality, higher-order rates with zero populations, mixed exact/regular jumps, and fractional propensities with integer constants.
Measurements
The committed
lib/StochasticDiffEqLeaping/benchmark/massaction.jlcompares native input with a data-backedRegularJumpadapter using the same mass-action operations. The model is a first-order reaction ring, fixeddt=0.01, time span(0,1), seed 123. Table entries are medians from three fresh processes per case; each process measures nine warmed-up solves on a shared machine.Compilation and large-model allocation costs decreased in these cases. Warm runtime differences changed sign between repeated runs, so these measurements do not establish a general throughput improvement. Small-model allocation costs increased slightly.
CI status
The documentation, downgrade, and inspected downstream jobs fail dependency resolution because the registry currently ends at JumpProcesses 9.32.3 while this change requires 9.33. The documentation log is https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/34685462635/job/103531578714 .
Runic and spelling also found unchanged master errors in BDF and DiffEqBase tests. Their separately validated mechanical correction is #4524 . These failures are not suppressed in this branch.
Ignore this PR until reviewed by @ChrisRackauckas.
🤖 Generated with Codex CLI 0.153.4 (model: gpt-6-astra; local session ID: 01a070e6-21f2-7dd3-bf52-2ddaf108ac53).
Risk assessment (independent review, Codex CLI 0.164.0-alpha.11.1 gpt-6-astra, slot 1, head 3442f3a)
Review round 1, written by the reviewer named above (Codex CLI 0.164.0-alpha.11.1 / gpt-6-astra) 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: The PR adds native MassActionJump support and a documented jump_noise_data hook for four tau-leaping solvers. The new documentation example actually fails with an admitted JumpProcesses release because the required massaction_rates! API is absent.
Blast radius: StochasticDiffEqCore jump initialization and explicit/implicit tau-leaping, plus new repository-local governing instructions; regular-jump initialization is also refactored.
Evidence: Exact diff/head reviewed; docs CI resolved JumpProcesses 9.33.1 then failed in the new example with UndefVarError: massaction_rates! not defined. All Leaping Core jobs were canceled. Analytic propensity and manual-adapter tests are present (G1), but successful execution of the new supported paths with released dependencies is missing (G2).
Blocking findings
lib/StochasticDiffEqLeaping/Project.toml:39andlib/StochasticDiffEqLeaping/src/massaction.jl:5— confirmed by running (PR CI; reviewer inspected the log): the declaredJumpProcesses = "9.33"admits v9.33.1, which the documentation job installed. Running the newly addedsolve(prob, TauLeaping())example then throwsUndefVarError: massaction_rates! not defined in JumpProcessesinstead of producing a trajectory. The same module provides the required drift and stoichiometry calls. Depend on a released version that actually contains all three public operations, update both package and docs compatibility, and exercise the minimum supported version; merely waiting for a version numbered 9.33 is insufficient.lib/StochasticDiffEqLeaping/test/runtests.jl:11— suspected from reading (needs-verification/G2): all three Leaping Core CI jobs at this head are canceled, so the committed 151-line mass-action suite has no successful reviewer/CI run with the admitted released dependency stack. After correcting the prerequisite, run the existing Core test entry point for all four methods, in-place/out-of-place, fixed/adaptive supported modes, and the mixed exact/regular regression. The author's development-checkout output is useful context but is not independent execution evidence for this head's package contract.Non-blocking findings
lib/StochasticDiffEqLeaping/benchmark/README.md:1: the author correctly reports mixed warmed-runtime results rather than claiming a general speedup. Preserve that qualification when updating the dependency and rerunning measurements.What I ran
git rev-parse HEADreturned3442f3a201f0aa6f7e0c7f53e412bc0fdaff0754; exact detached PR head verified (exit 0).git diff origin/master...HEADandgit diff --check origin/master...HEADcompleted (exit 0); changed files, tests, callers, and repository instructions inspected. RootAGENTS.mdandCLAUDE.mdare absent. Risk was frozen before opening the description.git rev-parse origin/masterreturned14b964b315e1310b5e3621a1bcfe6b92e9e506aa; GitHub's PR metadata base isab07f5de97257dce2a22c91a8f708158c75d6f90. The review diff uses the three-dot merge base; the header records the fetched base-branch tip.git log -1 --first-parent --no-merges --format=%Binspected (exit 0); author trailers recorded below, orunknownwhen absent.gh pr view 4523 --repo SciML/OrdinaryDiffEq.jl --json number,url,state,isDraft,headRefOid,baseRefName,baseRefOid,title,files,statusCheckRollupand the subsequent PR body read succeeded. Live state was OPEN.gh pr checks 4523 --repo SciML/OrdinaryDiffEq.jldata: 28 success, 1 failure, 130 canceled, 1 skipped. The failure is documentation; all Leaping Core/QA/downgrade jobs are canceled.gh run view 38459047603 --repo SciML/OrdinaryDiffEq.jl --log-failed(retrieval exit 0) showsInstalled JumpProcesses v9.33.1, then the example atdocs/src/stochastic/Algorithms.md:112fails:UndefVarError: massaction_rates! not defined in JumpProcesses, with the call atsrc/massaction.jl:5.makedocsterminates on[:example_block]. Documentation CI.gh run list --repo SciML/OrdinaryDiffEq.jl --branch master --event push --limit 5. Default docs run reports success; the PR failure is specifically in this PR's newly added example, not a claimed pre-existing default failure.What I did not verify
No reviewer Julia solve or benchmark was run for this PR. GPU support is explicitly outside this implementation. Successful execution after the prerequisite API lands, AD behavior of the implicit mass-action drift, parameter-update/reinit behavior, and the full stochastic downstream suite remain unverified. The review is an independent session; the author trailer and reviewer both name gpt-6-astra, which is disclosed rather than hidden.
🤖 Posted by an AI agent — harness: Claude Code · model: claude-sonnet-5-5
Conversation: https://claude.ai/code/session_01379heiiB35TtywhR7uSU74