Skip to content

Document GPU ensembles and native mass-action tau leaping - #650

Draft
ChrisRackauckas-Claude wants to merge 6 commits into
SciML:masterfrom
ChrisRackauckas-Claude:docs/gpu-tau-leaping
Draft

ChrisRackauckas-Claude wants to merge 6 commits into
SciML:masterfrom
ChrisRackauckas-Claude:docs/gpu-tau-leaping

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Sep 5, 2026 •

Copy link
Copy Markdown
Member

Document GPU ensembles and tau-leaping methods around a shared MassActionJump model. The same problem is solved by JumpProcesses and StochasticDiffEq methods; RegularJump is an additional interface for custom kinetics in the solvers that support it. The guide includes executable examples, solver/input tables, GPU constraints, and the current limitation of the Cao adaptive selector.

The solver changes live in #652 and SciML/OrdinaryDiffEq.jl#4523 . This branch includes the JumpProcesses prerequisite. Documentation requires JumpProcesses 9.33 and StochasticDiffEqLeaping 2.2; registry-only documentation CI must wait for those releases. StochasticDiffEqLeaping is MIT licensed, matching JumpProcesses.

GPU support covers SSA, fixed tau leaping, and adaptive explicit mass-action tau leaping. Adaptive implicit, trapezoidal, and switching methods are CPU-only. No GPU capability is inferred from the CPU interface.

Verification

julia +1.12.6 --project=native-validation check-native-doc-blocks.jl
julia +1.12.6 --project=JumpProcesses.jl/docs JumpProcesses.jl/docs/make.jl
Test Summary:   | Pass Total
tau_leaping tau |   30    30
Test Summary:           | Pass Total
tau_leaping regular_tau |   10    10
[ Info: HTMLWriter: rendering HTML pages.
[ Info: Automatic `version="9.33.0"` for inventory from ../Project.toml

Both commands exited 0. The final adaptive = false option in the general Cao example was checked by rerunning both example groups after the full build had read that page; those 40 checks passed.

The standalone local check executes the guide's two Documenter example groups. The full build uses the locally developed prerequisite versions. Runic on changed Julia lines, typos over changed files, and git diff --check passed. CUDA examples were not executed on GPU hardware. The native implementation's CPU/kernel-backend validation is recorded in the prerequisite PR.

Source discussions: #649 , #643 , and #524 .

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

CI triage (2026-09-24)

check classification evidence
Documentation / Build and Deploy Documentation PR-caused (blocked on unreleased dep) run 34686711233: StochasticDiffEqLeaping restricted to 2.2 but General registry only has 1.0.0–2.1.0. Master Documentation is green (run 35274730731 on 97e4d259). Prerequisite OrdinaryDiffEq#4523 still open; package version on master remains 2.1.0. No safe fix without lowering compat, adding git sources, or waiting for registration.
All other reported checks (tests, GPU, Downgrade, Spell Check, benchmarks) not failing PR checks on head 0694d223 before merge

Merged master (97e4d259) into docs/gpu-tau-leaping as a5e49763 to clear conflicts. Conflict resolution: Project.toml version 9.33.1; exports keep both RateBounds (master) and massaction_* helpers (PR).

Risk assessment

  • Risk: Low for the merge commit (export + version reconcile only). Documentation CI remains red until StochasticDiffEqLeaping 2.2 is registered after OrdinaryDiffEq#4523 merges.
  • Blast radius: Project.toml version string; src/JumpProcesses.jl export list. No solver logic changed in the merge resolution.
  • Evidence: Local massaction_leaping 29/29 and bracketing 36/36 passed after merge; Runic/typos clean on resolved files.
  • Independent review: none yet
  • Merge: needs review (and docs CI unblock via registry release)

🤖 Posted by an AI agent — harness: Cursor CLI 2026.09.23-86fc751 · model: Composer
Conversation: /log.txt

Risk assessment


🤖 Risk assessment posted by an AI agent (fleet master) — harness: Devin CLI / fusion-claude-opus-5-5-high-sidekick-swe-2-medium; dispatched by Devin CLI 3000.11.3 fleet-master caretaker, model Fusion (claude-opus-5-5 medium + swe-2 medium)
Conversation: local transcript (no session URL)

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

Risk assessment (independent review, Codex CLI (gpt-6.1-sol), local job oss-reviews-2026-10-22-SciML-JumpProcesses-jl-650-a5e4976 (no session URL), head a5e4976)

  • Verdict: CHANGES
  • Risk: medium (M1)
  • Summary: CHANGES (medium M1) at head a5e4976
  • Merge: needs changes — fix the review findings below

Executed review notes (head a5e4976):

Review of #650 (head a5e4976)

  • Reviewed risk note: Risk: medium**
    Public API: adds three exported mass-action operations and narrows fixed-step input validation to DiscreteProblem; additive API and compatibility changes need review.
    Numerics/algorithms: new integer-state propensity evaluation silently overflows before conversion to the floating-point rate type.
    Dependencies/compat: adds a docs-only StochasticDiffEqLeaping 2.2 requirement that cannot resolve against the available registry; no runtime dependency added. The dependency's installed release uses an MIT license; the unavailable 2.2 release was not inspected.
    Tests changed or missing: existing assertions are retained; new interface and CPU kernel tests pass, but large integer populations are untested.
    Performance/GPU/AD paths: modifies CPU and KernelAbstractions fixed-step execution; CPU backend and ForwardDiff tests pass, hardware GPU execution and performance are unverified.
    Downstream reach: fixed-step leaping users, consumers of the new exported operations, and documentation builds.
    Findings
  1. src/massaction_rates.jl:185-194 — blocking: the propensity product accumulates in the state integer type and can overflow before multiplication by the floating-point constant. Reproducer: using JumpProcesses; maj = MassActionJump([1.0], [[1 => 3]], [[1 => -3]]); massaction_rates!(zeros(1), maj, [3_000_000]). Observed 1.4255381543827412e18, whereas exact-integer evaluation of n*(n-1)*(n-2)/6 gives 4.499995500001e18. The same call with [3_000_000.0] gives the correct value. This corrupts both the new public rate/drift operations and the newly supported integer-state SimpleTauLeaping route; the kernel route accumulates in a floating-point rate type instead. Accumulate in an appropriate promoted rate type without losing AD support, and add high-population integer/float equivalence tests. The base implementation lacks these helpers and rejects mass-action inputs to this solver; this finding concerns the newly added functionality, not a claimed regression of existing SSA behavior.
  2. docs/Project.toml:35 — blocking: the new StochasticDiffEqLeaping = "2.2" constraint makes the documentation environment unsatisfiable. Resolving a scratch copy of this environment with the reviewed package developed locally fails with possible versions are: 1.0.0 - 2.1.0 or uninstalled and restricted to versions 2.2.0 - 2 ... no versions left. The local General registry also lists only through 2.1.0. The supplied checks report Documentation failing, consistent with this local failure. The PR's base master commit 97e4d25 has neither this direct dependency nor this constraint; its docs environment was inspected but not built locally. Keep the PR unmerged until the required implementation is registered and the examples and full docs build pass using released dependencies; lowering the bound alone would not establish that the documented mass-action support exists.
    What I ran
  • Read brief.md, repo/AGENTS.md, pr.diff, changed files and surrounding implementations, test/runtests.jl, test/test_groups.toml, Project.toml, checks.txt, and pr.json. Independently assigned medium risk before reading the PR body's risk assessments. Verified detached HEAD a5e4976 and a clean tracked working tree.
  • git -C repo diff 97e4d259 HEAD --check: exit 0. Compared changed validation and docs dependencies with base master 97e4d25; local master points to later work, so it was not used as the PR's historical base.
  • JULIA_NUM_THREADS=4 JULIA_NUM_PRECOMPILE_TASKS=4 timeout 3600 julia +release --project=@runic -m Runic --check repo/docs/pages.jl repo/ext/JumpProcessesKernelAbstractionsExt.jl repo/src/JumpProcesses.jl repo/src/massaction_rates.jl repo/src/problem.jl repo/src/simple_regular_solve.jl repo/test/massaction_fixed_tau_kernel.jl repo/test/massaction_leaping.jl repo/test/runtests.jl: exit 0, no diagnostics.
  • typos pr.diff: exit 0, no diagnostics.
  • Built tmp/review-env/Project.toml from the package dependencies/extras and compat bounds. Initial setup failed because my generated environment included compat entries without corresponding dependencies; corrected the scratch project. JULIA_NUM_THREADS=4 JULIA_NUM_PRECOMPILE_TASKS=4 timeout 3600 julia +release --startup-file=no --project=tmp/review-env -e 'using Pkg; Pkg.develop(path="repo"); Pkg.instantiate()': exit 0. Resolved runtime is Julia 1.13.2. No tracked project or test files were edited.
  • JULIA_NUM_THREADS=4 JULIA_NUM_PRECOMPILE_TASKS=4 timeout 3600 julia +release --startup-file=no --project=tmp/review-env tmp/run-tests.jl: exit 0; massaction_leaping.jl 29/29, massaction_fixed_tau_kernel.jl on CPU() 12/12, regular_jumps.jl 88/88. Used separate SafeTestsets for these files.
  • JULIA_NUM_THREADS=4 JULIA_NUM_PRECOMPILE_TASKS=4 timeout 3600 julia +release --startup-file=no --project=tmp/review-env tmp/check-overflow.jl: exit 0; Int64 propensity 1.4255381543827412e18 versus exact reference 4.499995500001e18 (ratio 0.31678657331600096); Float64 propensity matches reference.
  • JULIA_NUM_THREADS=4 JULIA_NUM_PRECOMPILE_TASKS=4 timeout 3600 julia +release --startup-file=no --project=tmp/review-env tmp/check-compat.jl: exit 0 with caught exception; ODE-backed RegularJump rejected with SimpleTauLeaping requires a PureLeaping JumpProblem with a MassActionJump or a RegularJump. Did not establish a previously working supported solve, so this is not a separate confirmed regression finding.
  • Copied docs/Project.toml to tmp/docs-env/Project.toml. JULIA_NUM_THREADS=4 JULIA_NUM_PRECOMPILE_TASKS=4 timeout 3600 julia +release --startup-file=no --project=tmp/docs-env -e 'using Pkg; Pkg.develop(path="repo"); Pkg.instantiate()': exit 1, unsatisfiable StochasticDiffEqLeaping 2.2 requirement, as quoted above.
  • GROUP=QA JULIA_NUM_THREADS=4 JULIA_NUM_PRECOMPILE_TASKS=4 timeout 3600 julia +release --startup-file=no --project=tmp/review-env repo/test/runtests.jl: exit 0; QA Tests 20/20, 14.4 seconds after obtaining a shared Julia slot.
    Not verified
  • Full documentation build and its executable examples: blocked during dependency resolution. No unpublished prerequisite branches were substituted.
  • Hardware CUDA execution, GPU random-number behavior, other GPU backends, performance benchmarks, downstream integration, full InterfaceI/InterfaceII groups, and other Julia versions.
  • No network refresh of registry state, live CI logs, current upstream prerequisite status, or GitHub posting; review uses the supplied snapshots and locally available registry/packages.

Independent review by an AI agent — harness: codex-cli 0.162.1 · model: gpt-6.1-sol · Codex exec session 01a149f5-a65e-72f1-b87c-0bf86822cc66 · 2026-10-17 13:14 UTC. Not posted to GitHub.


🤖 Posted by an AI agent — harness: Codex CLI · model: gpt-6.1-sol (independent reviewer; appended by Antigravity CLI · model: gemini-4-argon-high)
Conversation: local job oss-reviews-2026-10-22-SciML-JumpProcesses-jl-650-a5e4976 (no session URL)

🤖 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 a5e4976)

  • Risk: high (H6: Adds governing agent instructions in AGENTS.md, in addition to numerical solver and public API changes.)
  • Verdict: CHANGES
  • Session: 01a18db8-25fc-7b72-9d35-a1341e0ae484
  • Blocking priorities: P1

Review round 2, 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: Adds tau-leaping/GPU guides with native mass-action solver/API changes and a governing AGENTS.md. Integer propensities overflow on valid large populations, and the docs dependency requirement cannot resolve.

Blast radius: Documentation environment, native mass-action CPU/GPU leaping paths, solver-author APIs, and repository agent guidance.

Evidence: InterfaceI reports 29/29 mass-action leaping checks; InterfaceII reports 12/12 fixed-step CPU-kernel checks. GPU CI is marked successful, but that status alone is not treated as proof of every documented GPU capability. The docs failure is specifically the added StochasticDiffEqLeaping 2.2 requirement, verified against the live General registry file. The inspected GPU job explicitly reports GPU fixed-step mass-action kernel 12/12, satisfying G2 for that path. Post-freeze comparison identified the previously reported integer overflow; the reviewer independently reproduced its exact arithmetic and inspected the identical helper.

Blocking findings

  1. [P1] src/massaction_rates.jl:185 — confirmed by running. The falling-factorial product starts with one(eltype(u)), so integer states overflow before the final multiplication by the floating rate constant. For MassActionJump([1.0], [[1=>3]], [[1=>-3]]) and u=[3_000_000], the propensity is 1.4255381543827412e18; the independent BigInt binomial reference and Float64-state call both give 4.499995500001e18. A post-freeze package probe confirms this at sibling Preserve native mass-action data for tau-leaping solvers #652; the exact helper body in this head is byte-identical, and an exact-helper probe is also recorded below. Accumulate in a suitable promoted rate type that preserves AD, and commit integer/high-population regression tests. This affects new functionality; the base has no such helper.
  2. [P1] docs/Project.toml:35 — confirmed by running. Documentation CI fails with Unsatisfiable requirements for StochasticDiffEqLeaping: the environment requires 2.2 but the live General Versions.toml lists releases only through 2.1.1. A sampled default docs run is green. Release/register the companion dependency before merging this environment, or separate/gate the unreleased examples using an explicit supported source arrangement; do not lower compat unless those examples actually work on the older release.

Non-blocking findings

  1. AGENTS.md:1 — Separate the governing instructions and the solver prerequisite from the prose change to make the authority change and numerical implementation independently reviewable. The current diff is substantially broader than its docs title.

What I ran

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

HEAD was verified equal to a5e497632d0f6fe27e18769f9ec91ef04048765d. 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.

Before the post-freeze probes below, test evidence came from inspected CI logs; source/diff checks were run locally.

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.

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

Post-freeze reviewer probes, Julia 1.13.0, sequential execution, exit 0. Filesystem locations below are normalized because the issue prohibits machine paths. Executed the exact massaction_propensity definition from this head using julia --startup-file=no --compiled-modules=no <exact-helper-probe>; constants are the unit-rate third-order reaction coefficient 1/6.

INT=1.4255381543827412e18 FLOAT=4.499995500001e18 BIGINT_REFERENCE=4.499995500001e18

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

What I did not verify

The full docs build was not rerun locally; the resolver failure occurs before it. No local GPU hardware run, cross-package StochasticDiffEq 2.2 example execution, or complete numerical convergence study was performed.

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-Claude ChrisRackauckas-Claude changed the title Document GPU ensembles and tau-leaping solver interfaces Document common mass-action leaping and GPU ensembles Sep 5, 2026
Comment thread docs/src/tutorials/tau_leaping.md Resolved
ChrisRackauckas and others added 5 commits September 12, 2026 04:28
Generate the regular rate/update interface for pure discrete mass-action problems and support the fixed-step ensemble kernel. Preserve explicit RegularJump inputs for general kinetics.

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
Remove constructor conversion to RegularJump. Use native mass-action data in
fixed-step CPU and GPU solves and expose propensity, stoichiometry, and fused
drift operations for downstream solvers, including single-reaction inputs.

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: 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
Combine the solver examples around shared kinetics, describe native reaction
data handling, and document fixed stepping for the incomplete Cao selector.

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: 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
@ChrisRackauckas-Claude ChrisRackauckas-Claude changed the title Document common mass-action leaping and GPU ensembles Document GPU ensembles and native mass-action tau leaping Sep 12, 2026
Resolve Project.toml version to 9.33.1 and keep both RateBounds and
massaction helper exports.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Agent-Harness: Cursor CLI 2026.09.23-86fc751
Agent-Model: Composer
Agent-Session: /home/crackauc/sandbox/fleet-master-jobs/nw-jumpprocesses-650/log.txt
Co-authored-by: Cursor <cursoragent@cursor.com>

This branch has not been deployed

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