Skip to content

Preserve native mass-action data for tau-leaping solvers - #652

Draft
ChrisRackauckas-Claude wants to merge 8 commits into
SciML:masterfrom
ChrisRackauckas-Claude:feature/common-massaction-leaping
Draft

ChrisRackauckas-Claude wants to merge 8 commits into
SciML:masterfrom
ChrisRackauckas-Claude:feature/common-massaction-leaping

Conversation

@ChrisRackauckas-Claude

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

Copy link
Copy Markdown
Member

🚧 UNREVIEWED — awaiting review by @ChrisRackauckas. Filed by an AI agent running as @ChrisRackauckas; Chris has not seen this.
Harness: Codex CLI 0.164.0 · Model: gpt-6.1-sol
Conversation: local fixer job SciML__JumpProcesses.jl__652 (no session URL)

Preserve MassActionJump in JumpProblem and let tau-leaping solvers consume its stored rates and stoichiometry. SimpleTauLeaping now uses native mass-action data on CPU and the flattened mass-action representation in GPU kernels; general RegularJump input remains supported. This replaces the constructor-level conversion raised in review.

Add documented public propensity, stoichiometry-product, and fused drift operations for downstream solvers, with a minor version bump to 9.33. The companion StochasticDiffEq implementation uses these operations directly: SciML/OrdinaryDiffEq.jl#4523 . This prerequisite can be released independently; its executable examples use JumpProcesses solvers. The full cross-package guide is #650 .

Verification

Julia 1.12.6 with dependencies developed in a local environment. Existing test entry points were used because Pkg.test encountered a relative-[sources] sandbox resolution error in the local monorepo dependency setup.

GROUP=InterfaceI julia --project=native-validation massaction-leaping/test/runtests.jl
GROUP=InterfaceII julia --project=native-validation massaction-leaping/test/runtests.jl
GROUP=QA julia --project=native-validation massaction-leaping/test/runtests.jl
julia --project=massaction-leaping/docs massaction-leaping/docs/make.jl
InterfaceI: 940 passing checks across 21 testsets
InterfaceII: 1597 passing checks across 21 testsets
QA Tests | 20 20
[ Info: HTMLWriter: rendering HTML pages.
[ Info: Automatic `version="9.33.0"` for inventory from ../Project.toml

The new mass-action checks pass 29 assertions. KernelAbstractions CPU-backend checks include 12 fixed-step mass-action, 67 SSA, and 80 adaptive explicit assertions.

Runic on changed Julia lines, typos over changed files, and git diff --check passed. GPU kernels ran through KernelAbstractions' CPU backend; no physical GPU execution was performed. Adaptive implicit, trapezoidal, and switching methods have no GPU implementation.

The constructor regression test discriminates against the previous adapter implementation (663b281):

Before: Test Failed: prob.regular_jump === nothing
After:  same assertion passes (exit 0)

The public operation tests cover scalar and vector reaction storage, zero populations, higher-order reactions, and derivative propagation. A scalar reaction test produced six errors before the scalar-data fix and passes all six checks afterward. Native/regular fixed-seed trajectory comparisons and unsupported mixed-jump rejection are included.

Ignore this PR until reviewed by @ChrisRackauckas.

🤖 Generated with Codex CLI 0.153.4 (model: gpt-6-astra; local session 01a070e6-21f2-7dd3-bf52-2ddaf108ac53 (no session URL)).

CI triage (2026-09-25)

check classification evidence
Documentation / Build and Deploy Documentation stale-base (master-fixed; not PR-caused) PR head failed on ExtendedJumpArray subset getindex DimensionMismatch in tutorial @example blocks (PR run); same check green on latest master after #660 (master docs). Fixed by merging upstream/master.
Downgrade / Downgrade Tests green pass
GPU Tests green pass
Spell Check with Typos green pass
benchmark (1) / benchmark (lts) green pass
tests / InterfaceI (all variants) green pass
tests / InterfaceII (all variants) green pass
tests / QA green pass
tests / detect green pass

Risk assessment

  • Risk: Low–medium. Merges master (RateBounds, ExtendedJumpArray, SSAStepper saveat) and bumps to 9.34.0 for new public mass-action leaping APIs; no intentional behavior change beyond conflict resolution and Runic formatting of touched files.
  • Blast radius: JumpProblem/PureLeaping/SimpleTauLeaping mass-action path, public massaction_*! ops, KernelAbstractions fixed-step kernel, docs, version/HISTORY.
  • Evidence: Local test/massaction_leaping.jl (29 passes) and test/massaction_fixed_tau_kernel.jl CPU (12 passes) on Julia 1.12; typos clean; Runic applied. Post-push CI will re-validate docs after master merge.
  • Independent review: none yet
  • Merge: needs review

🤖 Posted by an AI agent — harness: Cursor CLI · model: Composer
Conversation:

Adoption update

Rebased the three original commits onto current origin/master (97e4d25938c5dda96d146d657f5db5b7224b2eca) without squashing, preserving their authors and messages. Because release metadata had been carried by the old merge commit, an additional attributed commit restores the PR’s 9.34.0 version and HISTORY entry; the resulting tree matches the pre-rebase PR tree. The branch is pushed to the fork at d48a79ede48ae639ee7f0771d835e8733e281ed0. The PR remains a draft.

The changes-requested review objected to converting MassActionJump in the JumpProblem constructor. This branch preserves MassActionJump; the leaping solver owns its CPU/GPU representation and consumes the stored reaction data. General RegularJump support remains a separate path. This addresses the design point in the review thread; the reviewer still needs to re-evaluate the code.

Failing before / passing after

Ran the same test/massaction_leaping.jl regression on clean master (97e4d259) and on this branch. On master the first testset errors with SimpleTauLeaping can only be used with PureLeaping JumpProblems with only RegularJumps. On this branch all four testsets pass, 29/29 assertions: regular solver input 4/4, native operations 16/16, general regular rates 3/3, and single-reaction operations 6/6.

Local verification

GROUP=InterfaceI julia --project=. --startup-file=no -e 'using Pkg; Pkg.test()' passed on Julia 1.12.7. The mass-action leaping testset passed 29/29, the tau-leaping testset passed 88/88, and the test runner ended with Testing JumpProcesses tests passed (3159.3 seconds). Runic --check on changed Julia files, typos on added diff lines, and git diff --check passed. The local docs build completed through HTML rendering; Documenter emitted world-age and large-example warnings and skipped deployment because no deployment environment was detected.

CI classification

All checks on head d48a79ed completed successfully. No red checks required comparison with master.

check result run
Documentation / Build and Deploy Documentation pass https://github.com/SciML/JumpProcesses.jl/actions/runs/36267941642
Downgrade Tests pass https://github.com/SciML/JumpProcesses.jl/actions/runs/36267941697
GPU Tests pass https://github.com/SciML/JumpProcesses.jl/actions/runs/36267941324
Spell Check with Typos pass https://github.com/SciML/JumpProcesses.jl/actions/runs/36267941639
benchmark (1), benchmark (lts) pass https://github.com/SciML/JumpProcesses.jl/actions/runs/36267941210
tests / InterfaceI, InterfaceII, QA, detect (all matrix jobs) pass https://github.com/SciML/JumpProcesses.jl/actions/runs/36267941860

Not verified / review state

No physical GPU execution was performed locally; the GPU CI workflow passed. The local affected test group ran on Julia 1.12.7. The original changes-requested review remains formally open pending reviewer re-evaluation; no independent review has been obtained. Ignore this draft until reviewed by @ChrisRackauckas.


🤖 Adoption update by Codex CLI 0.157.1 (model: gpt-6-luna). Session transcript: /log.txt

Adoption round 2

Independent review (Claude Code, Opus 5.5) returned VERDICT CHANGES / RISK medium; core logic was confirmed correct. This round:

  • Dropped adoption-worker commit b97c53b (Runic whole-file reformat of src/problem.jl and related files). The repo uses JuliaFormatter (style = "sciml"), not Runic. Branch rebuilt with git rebase --onto so original authorship is preserved and the PR diff is functional-only. Odd constructs from that commit (return sol = …, return unscaled_rate /= coef) are gone with it.
  • EnsembleGPUKernel + SimpleTauLeaping + parameter-mapped MassActionJump now errors clearly when a custom prob_func would vary p (rates are uploaded once from the template; unlike RegularJump, they do not read per-trajectory p). prob_func is wired for RegularJump / u0/tspan variation. CPU test added in test/massaction_fixed_tau_kernel.jl.
  • Documented in massaction_propensity that insufficient reactants yield zero propensity, so a tau-leaping undershoot below the reaction order stays put for that channel.

isaacsas’s requested change (do not convert MassActionJump in JumpProblem) remains addressed in code and awaits his re-review: #652 (comment)

Local re-verification: GROUP=InterfaceI — mass-action leaping 29/29, tau-leaping 88/88, Testing JumpProcesses tests passed. GROUP=InterfaceII — fixed-step mass-action kernel on CPU 15/15 (includes the new param/prob_func rejection), SSA kernel 67/67, explicit tau kernel 80/80, Testing JumpProcesses tests passed. Head: 67a81786.


🤖 Adoption round 2 by Cursor Agent CLI (model: auto). Session transcript: /log.txt

Adoption round 3

Independent review (Claude Code, Opus 5.5) returned CHANGES (minor) / RISK medium. Follow-ups:

  • Reverted the non-functional rj rename / parenthesis reflow in src/problem.jl so that file has no net PR diff.
  • Formatted new code only with JuliaFormatter (style = "sciml"): appended massaction_rates.jl APIs, the xor block in validate_pure_leaping_inputs, and new KernelAbstractions extension helpers.
  • Added a CPU EnsembleGPUKernel test that varies RegularJump p via prob_func (first-order decay): p=0 → mean u0; p=1 → u0 * (1 - dt)^(t/dt) ≈ 1000 * 0.99^100 ≈ 366.03.
  • Removed AGENTS.md from this PR (out of scope; needs separate maintainer agreement).

Behaviour changes to be aware of

  • validate_pure_leaping_inputs now requires a DiscreteProblem (previously not checked).
  • A RegularJump with mark_dist now errors in SimpleTauLeaping. The previous check !isnothing(rj.mark_dist) == nothing never fired.

Local checks: test/massaction_fixed_tau_kernel.jl (CPU backend) and test/massaction_leaping.jl both passed, including the new RegularJump prob_func assertions. Head: 087b42c9.


🤖 Adoption round 3 by Cursor Agent CLI (model: auto). Session transcript: /log.txt

Risk assessment

  • Risk: medium

  • Blast radius: Users of SimpleTauLeaping on CPU and EnsembleGPUKernel (KernelAbstractions extension), plus downstream solvers that pick up the three new exported functions massaction_rates!, massaction_stoichiometry_mul! and massaction_drift! (a minor bump to 9.34.0). Some existing inputs that ran before now error or behave differently:

    • validate_pure_leaping_inputs now requires a DiscreteProblem. A RegularJump on an ODEProblem built with PureLeaping used to be accepted and now errors.
    • A RegularJump with mark_dist now errors. The old check was dead code, so marks were silently ignored.
    • EnsembleGPUKernel with SimpleTauLeaping now applies a custom prob_func. Before, it ignored prob_func and ran remake(jump_prob) for every trajectory.

    The generic validator is only called by SimpleTauLeaping, in src and in the extension. A GitHub code search found no callers in other SciML repos.

  • Evidence:

    • Head 087b42c9, passed: tests / detect; QA (Julia 1); InterfaceI (Julia 1, 1 x86, lts, pre); InterfaceII (Julia 1, lts, pre); Documentation; Downgrade; Spell Check; benchmark (1) and (lts).
    • Head, still queued: GPU Tests (https://github.com/SciML/JumpProcesses.jl/actions/runs/36288869014), waiting about 100 minutes for a runner.
    • Head, startup_failure: "Dependabot Auto-merge". This is pre-existing: the same startup_failure appears on other PRs' branches (fix-57-extendedjumparray-getproperty, vr-direct-large-tuple).
    • Master 97e4d259: "Run Tests" is red because QA (Julia 1) fails (https://github.com/SciML/JumpProcesses.jl/actions/runs/35274731216). QA passes on the PR, so that failure is pre-existing and not caused by this PR.
    • Regressions: none observed in completed checks.
    • GPU risk: the mass-action CUDA path passed GPU CI on the earlier head d48a79ed (https://github.com/SciML/JumpProcesses.jl/actions/runs/36267941324). The two testsets added since then have never run on CUDA. One of them, "RegularJump per-trajectory p via prob_func", remakes with a Vector p = [0.0]. That puts a non-isbits TrajectoryData into adapt(CUDABackend(), probs_data), and no adapt_structure is defined for TrajectoryData. The existing GPU tests use tuple p. I expect this testset to fail on CUDA, but I have not seen it fail.
  • Independent review: Devin CLI / fusion-claude-opus-5-5-high-sidekick-swe-2-medium rated it medium, medium confidence: the core logic looks right, and the native mass-action path matches the RegularJump path exactly under a fixed seed, with no tests weakened. However, the maintainer's CHANGES_REQUESTED review is still open, the GPU job hasn't run, and there are the input-tightening behavior changes above.

  • Merge: needs human review. Findings:

    1. isaacsas's CHANGES_REQUESTED review (Preserve native mass-action data for tau-leaping solvers #652 (comment)) is still formally open. Only the agent says it has been addressed.
    2. GPU Tests have not run on this head, and the new Vector-p prob_func testset probably fails on CUDABackend.
    3. Behavior tightenings (DiscreteProblem required, mark_dist errors) and GPU prob_func now being honored all ship in a minor release. The first two are disclosed in round 3. The prob_func change is only described as "wiring", not as a change in behavior.
    4. New exported public API plus a docs section on StochasticDiffEq solvers (CaoTauLeaping and others). The companion PR Use MassActionJump directly in stochastic tau-leaping solvers OrdinaryDiffEq.jl#4523 is still an unmerged draft.
    5. Parts of the PR description are out of date: it still says "bump to 9.33" (the actual bump is 9.34.0), mentions Runic, and includes CI tables for older heads.

    On non-public internals: none found. SciMLBase.EnsembleContext is exported and has had the same six fields since v3.0. SciMLBase.DEFAULT_PROB_FUNC is marked @public.


🤖 Risk assessment posted by an AI agent (fleet master) — harness: Devin CLI / fusion-claude-opus-5-5-high-sidekick-swe-2-medium; dispatched by Claude Code head, model claude-opus-5-5[1m]
Conversation: local Claude Code session 3cd6500a-1f81-46b5-ac0b-c466e15b6a53 (session ID, no 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-652-087b42c (no session URL), head 087b42c)

  • Verdict: CHANGES
  • Risk: medium-high (MH1)
  • Summary: CHANGES (medium-high MH1) at head 087b42c
  • Merge: needs changes — fix the review findings below

Executed review notes (head 087b42c):

Review of #652 (head 087b42c)

  • Reviewed risk note: Risk: medium-high**
    Public API: three additive, documented mass-action operations; the minor release also tightens SimpleTauLeaping input validation to DiscreteProblem, which merits compatibility review.
    Numerics/algorithms: native and RegularJump paths agree under fixed seeds in the supplied tests, but custom ensemble problems can silently use incorrect mass-action constants.
    Dependencies/compat: no new dependencies or compatibility changes; no new license concern.
    Tests changed or missing: new CPU tests and QA pass; variable time spans and changed per-trajectory mass-action constants lack regression coverage; a new CUDA test supplies incompatible parameter storage. No skipped assertions or loosened tolerances were added.
    Performance/GPU/AD paths: newly honored prob_func can expose unchecked out-of-bounds kernel writes; the CUDA parameter record fails its element-type guard. ForwardDiff coverage passes; performance and physical GPU execution were not measured.
    Downstream reach: affects SimpleTauLeaping CPU/kernel users and downstream solvers adopting the new public operations.
    Findings
  1. ext/JumpProcessesKernelAbstractionsExt.jl:47 — blocking — Validate or correctly allocate for each returned trajectory's time span. The new prob_func call allows tspan changes, but vectorized_solve sizes ts/us from the template at lines 213–225, while the kernel computes its iteration count from each returned problem at line 154. With template tspan=(0.0,0.2), dt=0.1, and prob_func returning tspan=(0.0,0.4), a run with --check-bounds=yes raises “BoundsError: attempt to access 3×1 view(::Array{Float64, 3}, :, :, 1) with eltype Float64 at index [4, 1]”. Normal execution suppresses these checks with @inbounds, exposing writes beyond the allocated trajectory. Returning tspan=(0.0,0.1) reaches 0.1 but reports Terminated; unwritten rows are inspected by findlast and can also contaminate the result. Reject incompatible spans before launching, or allocate for trajectory lengths and reconstruct only initialized rows. On merge-base 97e4d25 the same probe ignores prob_func and stays within the template allocation; its existing failure to honor prob_func does not explain away the newly reachable bounds error.
  2. test/massaction_fixed_tau_kernel.jl:60 — blocking — Make the new per-trajectory parameter test device-compatible. Both the template at line 56 and prob_func use Vector{Float64} parameters. TrajectoryData has no adaptation rule for its p field, so uploading the outer vector leaves a record containing a host Vector. The installed CUDA source's actual check_eltype guard, evaluated on this record type without GPU allocation, throws “CuArray only supports element types that are allocated inline” and identifies “Vector{Float64} is not a bitstype”. This test is invoked with CUDABackend by test/runtests.jl. Use tuple/static parameter storage for this test, or implement the required device conversion. The supplied checks.txt lists GPU Tests as failing, but its log is unavailable, so I do not claim this is the observed CI failure's cause.
  3. ext/JumpProcessesKernelAbstractionsExt.jl:55 — should-fix — Honor or explicitly reject changed mass-action data returned by prob_func. Passing jump_prob as the common-data source makes vectorized_solve upload the template's rate constants and stoichiometry, even when probs contains different MassActionJump objects. The guard at lines 35–37 covers parameter-mapped template jumps only. A deterministic CPU-kernel probe uses a zero-rate template and returns birth-only problems with rates 0 and 1000: both trajectories end at [0.0], because both use the template rate. The rate-1000 trajectory should have nonzero births with overwhelming probability. Check that returned jump data agree with the template, reject unsupported variation clearly, or represent it per trajectory. Add a regression for explicit rate-constant variation, beyond the existing parameter-mapper rejection test.
    What I ran
    All Julia commands used JULIA_NUM_THREADS=4 JULIA_NUM_PRECOMPILE_TASKS=4 and timeout 3600, through the supplied Julia slot wrapper. The runtime selected by +release was Julia 1.13.2. Scratch environments and scripts are under tmp/; repo tracked files remain unchanged.
  • julia +release --startup-file=no --project=tmp/env -e 'using Pkg; Pkg.develop(path="repo"); Pkg.instantiate()' — passed. Scratch Project.toml combines the repository's dependencies and test extras with its compatibility bounds.
  • julia +release --startup-file=no --project=tmp/env tmp/targeted.jl — exit 0: test/massaction_leaping.jl 29/29, test/regular_jumps.jl 88/88, and test/massaction_fixed_tau_kernel.jl with CPU() 17/17.
  • GROUP=QA julia +release --startup-file=no --project=tmp/env tmp/qa.jl — exit 0; invokes repo/test/runtests.jl; QA Tests 20/20.
  • julia +release --startup-file=no --project=tmp/env tmp/probes.jl — exit 0; shortened trajectories returned Terminated, vector-parameter TrajectoryData was not isbits, and per-trajectory birth rates 0/1000 both produced final state [0.0].
  • julia +release --startup-file=no --check-bounds=yes --project=tmp/env tmp/span-probe.jl — exit 0 with caught errors printed: requested stop 0.1 returned Terminated; requested stop 0.4 raised the BoundsError quoted above.
  • git -C repo archive 97e4d25 | tar -x -C tmp/base — created an unmodified merge-base snapshot. A separate scratch environment uses the same dependency manifest with JumpProcesses pointing to tmp/base.
  • julia +release --startup-file=no --check-bounds=yes --project=tmp/base-env tmp/span-probe.jl — exit 0; requested stops 0.1 and 0.4 both returned template stop 0.2 and Success; no bounds error.
  • julia +release --startup-file=no --project=tmp/base-env tmp/base-probes.jl — exit 0; base kernel ignored the custom time span; base native mass-action SimpleTauLeaping was rejected with “SimpleTauLeaping can only be used with PureLeaping JumpProblems with only RegularJumps.”
  • julia +release --startup-file=no --project=tmp/env tmp/cuda-type-probe.jl — exit 0 with caught CUDA type error printed. This extracts and executes the installed CUDA CUDACore/src/array.jl element-type guard on the extension's actual TrajectoryData type; it does not initialize CUDA or run a device kernel.
  • julia +release --project=@runic -m Runic --check repo/src/JumpProcesses.jl repo/src/massaction_rates.jl repo/src/simple_regular_solve.jl repo/ext/JumpProcessesKernelAbstractionsExt.jl repo/test/massaction_fixed_tau_kernel.jl repo/test/massaction_leaping.jl repo/test/runtests.jl — exit 1. Repeated with --verbose: first five files fail; massaction_leaping.jl and runtests.jl pass.
  • julia +release --project=@runic -m Runic --check --verbose tmp/base/src/JumpProcesses.jl tmp/base/src/massaction_rates.jl tmp/base/src/simple_regular_solve.jl tmp/base/ext/JumpProcessesKernelAbstractionsExt.jl tmp/base/test/runtests.jl — exit 1; all four existing implementation files also fail on base; runtests.jl passes. The new kernel test also fails Runic. The repository declares JuliaFormatter style="sciml", so Runic differences alone are not a repository formatting verdict.
  • typos pr.diff — exit 0, no diagnostics.
  • git -C repo diff --check 97e4d25 HEAD — exit 0, no diagnostics.
  • git -C repo status --short — empty after checks.
  • nvidia-smi --query-gpu=index,memory.used,utilization.gpu --format=csv — failed: could not communicate with the NVIDIA driver.
    Not verified
    Physical GPU execution, the actual failing GPU CI log, CI reruns, full InterfaceI/InterfaceII groups, other Julia versions, local documentation build, JuliaFormatter, performance benchmarks, and downstream StochasticDiffEq integration. No GitHub access or posting was attempted. The supplied CI snapshot was inspected as recorded metadata, not independently rerun evidence. Unchecked out-of-bounds execution was deliberately avoided; the longer-span probe forced bounds checks.

Independent review by an AI agent — harness: codex-cli 0.162.1 · model: gpt-6.1-sol · Codex exec session 01a149ee-73ac-76c0-abd9-455d03c2db9b · 2026-10-17 13:05 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-652-087b42c (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 087b42c)

  • Risk: medium (M2: Changes ensemble numerical behavior by applying prob_func and adds native mass-action numerics; analytic tests exist, but adversarial probes expose wrong rates and unsafe span handling.)
  • 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 native mass-action CPU/GPU leaping and applies per-trajectory customization. The change exposes out-of-bounds kernel writes, ignores returned literal rate constants, overflows integer propensities, and includes a failing CUDA fixture.

Blast radius: Mass-action rate/drift APIs, fixed tau-leaping CPU and KernelAbstractions paths, and ensemble per-trajectory parameters.

Evidence: InterfaceI passes 29/29 mass-action tests, including explicit propensity/Jacobian values and equality with a separately written RegularJump. GPU CI has 15 passes and 1 error, specifically the added per-trajectory parameter test; the sampled default GPU run is green. This is positive evidence of a PR-specific broken fixture, not a generic unavailable-runner inference. Post-freeze CPU probes corroborate the reported bounds and template-rate defects; BigInt arithmetic independently confirms integer overflow. Bounds checks were forced for the longer-span probe.

Blocking findings

  1. [P1] ext/JumpProcessesKernelAbstractionsExt.jl:47 — confirmed by running. The newly honored prob_func can return a longer tspan, but vectorized_solve allocates from the template tspan while the kernel loops over each returned span. Template (0.0,0.2), dt=0.1, returned (0.0,0.4) raises BoundsError accessing row 4 of a 3-row trajectory when --check-bounds=yes. Normal kernel writes use @inbounds, so this is unsafe beyond a test failure. Validate compatible spans before launch or allocate and track initialized lengths per trajectory. Add longer/shorter-span regressions without suppressing bounds checks.
  2. [P1] test/massaction_fixed_tau_kernel.jl:60 — confirmed by running. The new RegularJump prob_func fixture returns p=[...] (also initialized as [0.0] at line 56). GPU CI reports: CuArray only supports element types that are allocated inline; TrajectoryData contains Vector{Float64}, which is not a bitstype. Consequently the added CUDA path fails before its assertions and cannot provide the promised passing device regression. Use a device-compatible scalar/static parameter representation consistently, or implement a supported packed parameter layout, then rerun the CUDA test. Preserve the actual per-trajectory numerical assertions.
  3. [P1] ext/JumpProcessesKernelAbstractionsExt.jl:55 — confirmed by running. Returned problems can contain different literal MassActionJump rate constants, but vectorized_solve receives jump_prob as its common-data source and uploads only the template rates. The guard handles parameter-mapped templates only. A zero-rate template with prob_func returning zero-rate and rate-1000 birth problems yields final states [0.0] for both on the CPU kernel, despite an expected second trajectory mean of 200 over t=0.2. Reject unsupported changed reaction data or represent it per trajectory; add a discriminating regression.
  4. [P1] src/massaction_rates.jl:198 — confirmed by running. Integer-state propensities overflow before conversion to the floating rate type: the n=3_000_000, order-3, unit-rate example yields 1.4255381543827412e18 instead of the exact BigInt binomial value 4.499995500001e18. Float64 states give the correct reference. Promote the accumulator before multiplying, preserve dual-number propagation, and cover large integer populations.

Non-blocking findings

None.

What I ran

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

HEAD was verified equal to 087b42c9bec5129ac2b9741658821c7d6027cbf4. 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. Command: julia --startup-file=no --compiled-modules=no --check-bounds=yes --project=<isolated-environment> <reviewer-probes>. The package probe uses exact JumpProcesses #652; the SteadyState #175 probe evaluates the exact restoration helpers with real SciMLBase problems and solutions, not a full steady-state solve.

INTEGER_PROPENSITY=1.4255381543827412e18 FLOAT_PROPENSITY=4.499995500001e18 EXACT_REFERENCE=4.499995500001e18
REQUESTED_STOP=0.1 ACTUAL_STOP=0.1 RETCODE=Terminated
REQUESTED_STOP=0.4 SPAN_ERROR=BoundsError BoundsError: attempt to access 3×1 view(::Array{Float64, 3}, :, :, 1) with eltype Float64 at index [4, 1]
PER_TRAJECTORY_BIRTHS=SubArray{Float64, 1, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Int64}, true}[[0.0], [0.0]] EXPECTED_MEANS=[0,200]

The first exploratory runner exited 1 because the reviewer inspected EnsembleSolution using s[1] instead of s.u[1]; the final corrected run above exits 0. Caught BoundsError output is the intended discriminator, not an uncaught process failure. No unchecked longer-span kernel was run.

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

What I did not verify

No local CUDA/other-device run or local full solver suite. The failing log confirms a storage error, not incorrect GPU trajectory values; no claim is made that every supported static-parameter kernel is broken.

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

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

Fix by Codex CLI 0.164.0 gpt-6.1-sol (head 123c306)

  • Use tuple parameters in the CUDA fixture, preserving both per-trajectory numerical assertions and adding inline-storage checks.
  • Reject custom trajectory time spans, state dimensions, and mass-action reaction data that disagree with the shared kernel buffers/data before launching a kernel. Initial population values and RegularJump parameters can vary.
  • Promote mass-action propensity products to the rate/state scalar type before multiplying integer populations; retain derivative coverage.
  • Merge upstream master normally at 131b05e2cfb1f69d5c415d58a50f6b874ef0347d. The original PR head reproduced 190 ensemble save/interpolation failures with current dependencies; upstream contains the RNG compatibility changes, and the merged branch passes all 583 saveat checks. Preserve solver-owned RNG and working-rate buffers. Parameter-mapped public rate/drift operations accept p; the CPU solver materializes working rates once. The additive API version is 10.2.0.

The original GPU failure was PR-specific: CUDA rejected TrajectoryData containing Vector{Float64}; the sampled current default-branch GPU run passed.

Discriminating regressions

The regression runner exited 1 before the four fixes (48 passing, 12 failing assertions) and exited 0 after them (60/60). Representative failures:

Evaluated: 1.4255381543827412e18 ≈ 4.499995500001e18
Expected: ArgumentError
  Thrown: BoundsError
BoundsError: attempt to access 3×1 view(::Array{Float64, 3}, :, :, 1) with eltype Float64 at index [4, 1]

The additional state-dimension regression failed before its guard (63 passing, 1 failing), then passed with the guard:

BoundsError: attempt to access 1×2 Matrix{Float64} at index [2, 2]
Test Summary:      | Pass  Total   Time
Review regressions |   64     64  22.0s

These cases are in the official mass-action interface/kernel fixtures. No assertions were loosened or skipped.

Local validation

Julia 1.12.4, four threads, one precompile task, at most three concurrent Julia processes. Commands:

GROUP=All timeout 10800 julia --project -e 'using Pkg; Pkg.test()'
GROUP=QA timeout 3600 julia --project -e 'using Pkg; Pkg.test()'
timeout 10800 julia --compiled-modules=existing --project=docs docs/make.jl
git diff upstream/master HEAD | typos -
git diff --check upstream/master HEAD

The full All run passed 6,764 assertions across 58 top-level summaries; two pre-existing broken allocation checks are unchanged from master. It includes both InterfaceI and InterfaceII plus their threaded checks. Final output:

Fixed-step mass-action kernel on CPU |   28     28  17.4s
SSA kernel on the CPU backend |  169    169  47.2s
Explicit tau-leaping kernel on the CPU backend |  148    148  22.7s
     Testing JumpProcesses tests passed
QA Tests      |   20     20  40.7s
     Testing JumpProcesses tests passed
[ Info: HTMLWriter: rendering HTML pages.
[ Info: Automatic `version="10.2.0"` for inventory from ../Project.toml
Documentation command exit code: 0

Documentation link checking remained enabled. Two unauthenticated retries hit GitHub HTTP 429 on the unchanged ColPrac link; the final run used the existing gh authentication through Documenter's supported GITHUB_TOKEN mechanism and passed. Deployment was skipped locally. Spelling and whitespace checks exited 0 with no diagnostics.

Runic exited 0 on changed Julia lines, without a repository-wide formatting sweep. Exact formatter invocations:

julia --project=@runic -m Runic --inplace --lines=161:269 src/massaction_rates.jl
julia --project=@runic -m Runic --inplace --lines=4:5 --lines=7:10 --lines=270:278 --lines=342:342 --lines=348:349 --lines=351:351 --lines=383:383 --lines=386:386 src/simple_regular_solve.jl
julia --project=@runic -m Runic --inplace --lines=78:78 --lines=80:121 --lines=172:194 --lines=216:216 --lines=241:241 --lines=250:250 --lines=266:270 --lines=286:286 --lines=298:298 ext/JumpProcessesKernelAbstractionsExt.jl
julia --project=@runic -m Runic --inplace --lines=1:131 test/massaction_fixed_tau_kernel.jl

Not verified locally: physical CUDA/device execution, other Julia versions, performance benchmarks, or downstream integrations. Parameter-mapped public operations materialize fresh working rates per call; this behavior and the new p keyword need review with downstream users. The maintainer's formal changes-requested review remains open. This fix session supplied no independent review, approval, or merge.

Next counted review must come from a smart model in a fresh session, not this fix session (risk.md § Independent reviews).

Links


🤖 Posted by an AI agent — harness: Codex CLI 0.164.0 · model: gpt-6.1-sol
Conversation: local fixer job SciML__JumpProcesses.jl__652 (no session URL)

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

Fix by Codex CLI 0.164.0 gpt-6.1-sol (head 590f977)

  • Promote propensity products and integer reaction-count products with the destination scalar type before multiplication. Integer stored rate constants and populations now agree with floating-point constants in the large-population regression and the fixed-seed solver regression.
  • Normalize raw single-reaction parameter-mapped definitions before counting reactions or filling working rates; present their stoichiometry as one reaction. Regressions exercise all three public operations, higher-order and zero-reactant reactions, scaling policies, and refreshed parameters.
  • Add the regressions to the existing InterfaceI fixture. No dependencies or test skips were added, and no assertions were loosened.

Failing before / passing after

The official mass-action fixture, included in an outer testset, failed before the source fix and passed afterward. The integer propensity failure included:

Evaluated: 8.553228926296448e18 ≈ 2.6999973000006e19
BoundsError: attempt to access 1-element Vector{Int64} at index [2]

Before, exit 1:
Test Summary:      | Pass  Fail  Error  Total   Time
Review regressions |   44    11     24     79  46.4s

After, exit 0:
Test Summary:      | Pass  Total   Time
Review regressions |   79     79  43.2s

The same runner was used for both runs:

timeout 7200 julia --compiled-modules=existing --check-bounds=yes --project="$VALIDATION_ENV" "$REGRESSION_RUNNER"

VALIDATION_ENV is an isolated environment resolved from the package's declared dependencies, weak dependencies and test extras, with this checkout developed into it. REGRESSION_RUNNER includes test/massaction_leaping.jl in the outer Review regressions testset.

Local validation

Julia 1.12.4, four threads. Validation environment versions: SciMLBase 3.58.0, ForwardDiff 1.4.7, KernelAbstractions 0.9.46.

GROUP=InterfaceI timeout 10800 julia --compiled-modules=existing --check-bounds=yes --project="$VALIDATION_ENV" test/runtests.jl
GROUP=QA timeout 7200 julia --compiled-modules=existing --project -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=existing", "--check-bounds=yes"])'
timeout 10800 julia --compiled-modules=existing --project=docs docs/make.jl

All three commands exited 0. InterfaceI passed 2,819 assertions across 30 summaries; the two existing broken allocation checks match the default-branch fixture and were not changed. Selected real output:

Tau Leaping Tests |  225    225  1m54.0s
Mass-action leaping interface |   79     79  5.2s
Jump dependencies |  178    178  19.4s
2521.448376 seconds (3.99 G allocations: 179.979 GiB, 1.72% gc time, 68.14% compilation time: <1% of which was recompilation)
QA Tests      |   20     20  3m52.7s
     Testing JumpProcesses tests passed
[ Info: HTMLWriter: rendering HTML pages.
[ Info: Automatic `version="10.2.0"` for inventory from ../Project.toml

The docs build retained link checking, used the existing GitHub authentication, emitted dependency world-age and generated-HTML warnings, and skipped deployment locally.

Pre-commit formatting, spelling and whitespace commands all exited 0 without diagnostics:

timeout 3600 julia --compiled-modules=existing --project=@runic -m Runic --inplace --lines=161:275 src/massaction_rates.jl
timeout 3600 julia --compiled-modules=existing --project=@runic -m Runic --inplace test/massaction_leaping.jl
git diff | typos -
git diff --check

All current PR checks were green before this fix; gh run view 42758738064 -R SciML/JumpProcesses.jl --log-failed returned no failed logs. There was no current failing CI check requiring a default-branch reproduction.

Remaining review and verification

The maintainer's interface-design concern about supporting individual jumps alongside a RegularJump representation remains unresolved. These numerical and input-shape fixes address the two independent code-review blockers; maintainer design review remains required.

Not rerun locally: physical CUDA/GPU execution, InterfaceII, ThreadSafety, other Julia versions or architectures, benchmarks, and downstream integrations. No independent review was performed by this fix session.

Next counted review must come from a smart model in a fresh session, not this fix session (risk.md § Independent reviews).

Links


🤖 Posted by an AI agent — harness: Codex CLI 0.164.0 · model: gpt-6.1-sol
Conversation: local fixer job SciML__JumpProcesses.jl__652 (no session URL)

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

Fix by Claude Code 2.1.325 claude-sonnet-5-5 (head 7cee427)

  • Merged upstream/master normally (d9c94ec8). Master released its own 10.2.0 (isolated_copy), so the version declared by this branch was already taken. The branch now declares 10.3.0 with its HISTORY entry moved to a 10.3.0 heading above the upstream 10.2.0 entry; the only conflict was HISTORY.md.
  • No source change. All four blocking code-review findings (kernel time-span safety, CUDA Vector parameter fixture, changed literal mass-action rates, integer propensity overflow) and the single-reaction parameter-mapped bug were fixed in the two preceding heads (123c3069, 590f977a) and are covered by the existing regression testsets; the merge keeps them passing.
  • The maintainer's interface-design concern (tau-leaping methods that need both individual MassActionJump and RegularJump representations, versus only one of them) is a design question, not a code defect. I made no speculative design change; it remains open for the maintainer.

Validation

GROUP=InterfaceI  julia --project -e 'using Pkg; Pkg.test()'
GROUP=InterfaceII julia --project -e 'using Pkg; Pkg.test()'
GROUP=QA          julia --project -e 'using Pkg; Pkg.test()'
git diff upstream/master HEAD | typos -
git diff --check upstream/master HEAD
Mass-action leaping interface                  |   79     79
Mass-action working state                      |  317    317
     Testing JumpProcesses tests passed            (InterfaceI)
Fixed-step mass-action kernel on CPU           |   28     28
SSA kernel on the CPU backend                  |  169    169
Explicit tau-leaping kernel on the CPU backend |  148    148
     Testing JumpProcesses tests passed            (InterfaceII)
QA Tests                                       |   20     20
     Testing JumpProcesses tests passed            (QA)

All five commands exited 0 (Julia 1.12, 4 threads). Not rerun: documentation build, ThreadSafety, physical CUDA, other Julia versions. No independent review was performed by this session.

Next counted review must come from a smart model in a fresh session, not this fix session (risk.md § Independent reviews).


🤖 Posted by an AI agent — harness: Claude Code 2.1.325 · model: claude-sonnet-5-5
Conversation: local fixer job SciML__JumpProcesses.jl__652 (no session URL)

Comment thread src/problem.jl

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think this is the right level to make such conversions. For some leaping algorithms it would be better to keep the mass action jumps separate, but by doing the conversion here we take away the decision on how to setup the reaction representation from the leaping method.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I was trying to see what would happen by normalizing the form, but this would probably take a hit. We probably instead need to update all of the StochasticDiffEq methods to be MassActionJumps-aware.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced the constructor conversion: JumpProblem retains MassActionJump, and CPU/GPU fixed tau leaping consumes its reaction data directly. The StochasticDiffEq companion updates all four leaping methods to use stored constants and stoichiometry, including fused implicit drift: SciML/OrdinaryDiffEq.jl#4523 . General RegularJump remains an additional supported input. Benchmarks in that PR show lower compilation cost in the measured cases; warm runtime is mixed.

🤖 Codex CLI 0.153.4; model: gpt-6-astra; local session ID: 01a070e6-21f2-7dd3-bf52-2ddaf108ac53.

@ChrisRackauckas-Claude
ChrisRackauckas-Claude force-pushed the feature/common-massaction-leaping branch from 663b281 to ae4a751 Compare September 12, 2026 09:46
@ChrisRackauckas-Claude ChrisRackauckas-Claude changed the title Support MassActionJump across tau-leaping solvers Preserve native mass-action data for tau-leaping solvers Sep 12, 2026
ChrisRackauckas and others added 2 commits September 26, 2026 15:58
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
@ChrisRackauckas-Claude
ChrisRackauckas-Claude force-pushed the feature/common-massaction-leaping branch from 5ae51eb to d48a79e Compare September 26, 2026 19:59
ChrisRackauckas and others added 2 commits September 26, 2026 19:51
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.157.1
Agent-Model: gpt-6-luna
Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/issue-backlog/adopt/SciML_JumpProcesses.jl-652/log.txt on amdci2.julia.csail.mit.edu
Reject EnsembleGPUKernel SimpleTauLeaping when MassActionJump rates depend
on parameters and a custom prob_func would vary p, wire prob_func for
per-trajectory RegularJump p, and document that insufficient reactants
zero the propensity so tau-leaping undershoots stay put.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/issue-backlog/adopt/SciML_JumpProcesses.jl-652/log.txt on amdci2.julia.csail.mit.edu
@ChrisRackauckas-Claude
ChrisRackauckas-Claude force-pushed the feature/common-massaction-leaping branch from d48a79e to 67a8178 Compare September 27, 2026 01:19
ChrisRackauckas and others added 2 commits September 26, 2026 22:33
Revert the non-functional PureLeaping rename/reflow in problem.jl, format
new leaping code with JuliaFormatter SciML style, add a RegularJump
EnsembleGPUKernel test that varies p via prob_func, and remove AGENTS.md
from this PR.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/issue-backlog/adopt/SciML_JumpProcesses.jl-652/log.txt on amdci2.julia.csail.mit.edu
Validate shared kernel trajectory spans, dimensions, and reaction data before
launch. Use inline parameters in the CUDA fixture and promote propensity
products before integer population arithmetic can overflow.

Preserve upstream solver-owned RNG and working-rate buffers. Parameter-mapped
mass-action operations accept the current parameters explicitly; release the
additive public API as version 10.2.0.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.164.0
Agent-Model: gpt-6.1-sol
Agent-Session: local fixer job SciML__JumpProcesses.jl__652 (no session URL)
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark Results (Julia v1)

Time benchmarks
master 7cee427 master / 7cee427
aggregators/CCNRM 0.158 ± 0.0055 ms 0.164 ± 0.0051 ms 0.961 ± 0.045
aggregators/Coevolve 0.186 ± 0.0075 ms 0.188 ± 0.0075 ms 0.991 ± 0.056
aggregators/DirectCR 0.181 ± 0.01 ms 0.177 ± 0.011 ms 1.02 ± 0.084
aggregators/DirectFW 0.133 ± 0.0033 ms 0.139 ± 0.0038 ms 0.959 ± 0.036
aggregators/FRM 0.124 ± 0.004 ms 0.125 ± 0.0035 ms 0.988 ± 0.042
aggregators/FRMFW 0.128 ± 0.0036 ms 0.127 ± 0.0037 ms 1.01 ± 0.041
aggregators/NRM 0.156 ± 0.005 ms 0.155 ± 0.0049 ms 1.01 ± 0.046
aggregators/RDirect 0.159 ± 0.0046 ms 0.159 ± 0.0053 ms 0.998 ± 0.044
aggregators/RSSA 0.155 ± 0.006 ms 0.152 ± 0.0053 ms 1.02 ± 0.053
aggregators/RSSACR 0.177 ± 0.0096 ms 0.177 ± 0.0086 ms 0.997 ± 0.073
aggregators/SortingDirect 0.133 ± 0.0039 ms 0.131 ± 0.0044 ms 1.01 ± 0.045
construct/jumpproblem_constantrate 0.13 ± 0.02 μs 0.13 ± 0.021 μs 1 ± 0.22
construct/jumpproblem_massaction 0.441 ± 0.02 μs 0.431 ± 0.02 μs 1.02 ± 0.066
construct/vr_direct 5.91 ± 0.29 μs 5.8 ± 0.29 μs 1.02 ± 0.072
construct/vr_frm 8.72 ± 4.5 μs 8.75 ± 4.9 μs 0.997 ± 0.77
events/ode_division/Direct 0.488 ± 0.0093 ms 0.495 ± 0.0095 ms 0.986 ± 0.027
events/sde_dosing/Direct 0.284 ± 0.0094 ms 0.285 ± 0.0093 ms 0.996 ± 0.046
events/ssa_dosing/Direct 0.11 ± 0.0014 ms 0.11 ± 0.0014 ms 1 ± 0.018
events/vrj_reset/VR_Direct 1.47 ± 0.013 ms 1.48 ± 0.012 ms 0.997 ± 0.012
events/vrj_reset/VR_FRM 2.49 ± 0.019 ms 2.47 ± 0.017 ms 1.01 ± 0.01
ode/mixed/VR_Direct 1.6 ± 0.013 ms 1.56 ± 0.014 ms 1.02 ± 0.012
ode/mixed/VR_FRM 2.64 ± 0.02 ms 2.66 ± 0.017 ms 0.99 ± 0.0097
ode/sir_zero_drift/Direct 0.373 ± 0.0097 ms 0.369 ± 0.01 ms 1.01 ± 0.038
ode/sir_zero_drift/NRM 0.407 ± 0.0095 ms 0.395 ± 0.01 ms 1.03 ± 0.036
ode/telegraph/Coevolve 0.172 ± 0.003 ms 0.17 ± 0.0029 ms 1.02 ± 0.025
ode/telegraph/Direct 0.156 ± 0.0032 ms 0.157 ± 0.0024 ms 0.991 ± 0.025
ode/telegraph/NRM 0.162 ± 0.0024 ms 0.161 ± 0.0022 ms 1.01 ± 0.02
pure_jump/bounded_vrj/Coevolve 0.365 ± 0.0092 ms 0.362 ± 0.0093 ms 1.01 ± 0.036
pure_jump/chain/CCNRM 0.848 ± 0.0077 ms 0.853 ± 0.0085 ms 0.994 ± 0.013
pure_jump/chain/Direct 4.65 ± 0.036 ms 4.64 ± 0.032 ms 1 ± 0.01
pure_jump/chain/DirectCR 0.555 ± 0.011 ms 0.547 ± 0.012 ms 1.01 ± 0.03
pure_jump/chain/NRM 0.683 ± 0.012 ms 0.661 ± 0.012 ms 1.03 ± 0.027
pure_jump/chain/RSSA 2.16 ± 0.012 ms 2.16 ± 0.01 ms 0.999 ± 0.0072
pure_jump/chain/RSSACR 0.522 ± 0.012 ms 0.529 ± 0.011 ms 0.986 ± 0.03
pure_jump/chain/SortingDirect 1.31 ± 0.014 ms 1.33 ± 0.013 ms 0.987 ± 0.015
sde/mixed/VR_Direct 1.12 ± 0.0092 ms 1.1 ± 0.0089 ms 1.02 ± 0.012
sde/mixed/VR_FRM 5.69 ± 0.036 ms 5.7 ± 0.04 ms 0.997 ± 0.0094
sde/telegraph/Direct 0.287 ± 0.0094 ms 0.295 ± 0.0093 ms 0.973 ± 0.044
solve/constantrate 0.13 ± 0.0041 ms 0.13 ± 0.0051 ms 1 ± 0.051
solve/massaction 0.133 ± 0.0048 ms 0.131 ± 0.0038 ms 1.01 ± 0.047
vrj/m1_1/VR_Direct 0.344 ± 0.0093 ms 0.339 ± 0.0089 ms 1.01 ± 0.038
vrj/m1_1/VR_DirectFW 0.373 ± 0.0092 ms 0.38 ± 0.009 ms 0.982 ± 0.034
vrj/m1_1/VR_FRM 0.552 ± 0.01 ms 0.552 ± 0.01 ms 0.999 ± 0.026
vrj/m1_16/Coevolve 0.193 ± 0.0053 ms 0.183 ± 0.0075 ms 1.06 ± 0.052
vrj/m1_16/VR_Direct 0.692 ± 0.0073 ms 0.693 ± 0.0076 ms 1 ± 0.015
vrj/m1_16/VR_DirectFW 0.931 ± 0.011 ms 0.927 ± 0.0069 ms 1 ± 0.014
vrj/m1_16/VR_FRM 2.4 ± 0.023 ms 2.33 ± 0.023 ms 1.03 ± 0.014
time_to_load 1.07 ± 0.0076 s 1.06 ± 0.0074 s 1 ± 0.01
Memory benchmarks
master 7cee427 master / 7cee427
aggregators/CCNRM 3.65 k allocs: 0.231 MB 3.65 k allocs: 0.231 MB 1
aggregators/Coevolve 3.65 k allocs: 0.232 MB 3.65 k allocs: 0.232 MB 1
aggregators/DirectCR 3.66 k allocs: 0.232 MB 3.66 k allocs: 0.232 MB 1
aggregators/DirectFW 3.71 k allocs: 0.234 MB 3.71 k allocs: 0.234 MB 1
aggregators/FRM 3.68 k allocs: 0.233 MB 3.68 k allocs: 0.233 MB 1
aggregators/FRMFW 3.68 k allocs: 0.233 MB 3.68 k allocs: 0.233 MB 1
aggregators/NRM 3.65 k allocs: 0.232 MB 3.65 k allocs: 0.232 MB 1
aggregators/RDirect 3.69 k allocs: 0.233 MB 3.69 k allocs: 0.233 MB 1
aggregators/RSSA 3.63 k allocs: 0.231 MB 3.63 k allocs: 0.231 MB 1
aggregators/RSSACR 3.71 k allocs: 0.234 MB 3.71 k allocs: 0.234 MB 1
aggregators/SortingDirect 3.69 k allocs: 0.233 MB 3.69 k allocs: 0.233 MB 1
construct/jumpproblem_constantrate 15 allocs: 0.625 kB 15 allocs: 0.625 kB 1
construct/jumpproblem_massaction 14 allocs: 0.688 kB 14 allocs: 0.688 kB 1
construct/vr_direct 0.106 k allocs: 5.08 kB 0.106 k allocs: 5.08 kB 1
construct/vr_frm 0.086 k allocs: 13 kB 0.086 k allocs: 13 kB 1
events/ode_division/Direct 0.082 k allocs: 4.34 kB 0.082 k allocs: 4.34 kB 1
events/sde_dosing/Direct 0.184 k allocs: 9.94 kB 0.184 k allocs: 9.94 kB 1
events/ssa_dosing/Direct 15 allocs: 1 kB 15 allocs: 1 kB 1
events/vrj_reset/VR_Direct 0.099 k allocs: 5.64 kB 0.099 k allocs: 5.64 kB 1
events/vrj_reset/VR_FRM 0.142 k allocs: 7.58 kB 0.142 k allocs: 7.58 kB 1
ode/mixed/VR_Direct 0.082 k allocs: 4.36 kB 0.082 k allocs: 4.36 kB 1
ode/mixed/VR_FRM 0.123 k allocs: 6.09 kB 0.123 k allocs: 6.09 kB 1
ode/sir_zero_drift/Direct 0.068 k allocs: 3.62 kB 0.068 k allocs: 3.62 kB 1
ode/sir_zero_drift/NRM 0.075 k allocs: 3.91 kB 0.075 k allocs: 3.91 kB 1
ode/telegraph/Coevolve 0.079 k allocs: 4.05 kB 0.079 k allocs: 4.05 kB 1
ode/telegraph/Direct 0.07 k allocs: 3.69 kB 0.07 k allocs: 3.69 kB 1
ode/telegraph/NRM 0.077 k allocs: 3.97 kB 0.077 k allocs: 3.97 kB 1
pure_jump/bounded_vrj/Coevolve 25 allocs: 2.2 kB 25 allocs: 2.2 kB 1
pure_jump/chain/CCNRM 19 allocs: 8.8 kB 19 allocs: 8.8 kB 1
pure_jump/chain/Direct 16 allocs: 5.61 kB 16 allocs: 5.61 kB 1
pure_jump/chain/DirectCR 16 allocs: 5.61 kB 16 allocs: 5.61 kB 1
pure_jump/chain/NRM 26 allocs: 18.4 kB 26 allocs: 18.4 kB 1
pure_jump/chain/RSSA 16 allocs: 5.61 kB 16 allocs: 5.61 kB 1
pure_jump/chain/RSSACR 16 allocs: 5.61 kB 16 allocs: 5.61 kB 1
pure_jump/chain/SortingDirect 16 allocs: 5.61 kB 16 allocs: 5.61 kB 1
sde/mixed/VR_Direct 0.204 k allocs: 11.6 kB 0.204 k allocs: 11.6 kB 1
sde/mixed/VR_FRM 0.328 k allocs: 17.9 kB 0.328 k allocs: 17.9 kB 1
sde/telegraph/Direct 0.183 k allocs: 9.81 kB 0.183 k allocs: 9.81 kB 1
solve/constantrate 3.71 k allocs: 0.234 MB 3.71 k allocs: 0.234 MB 1
solve/massaction 3.71 k allocs: 0.234 MB 3.71 k allocs: 0.234 MB 1
vrj/m1_1/VR_Direct 0.082 k allocs: 4.33 kB 0.082 k allocs: 4.33 kB 1
vrj/m1_1/VR_DirectFW 0.082 k allocs: 4.33 kB 0.082 k allocs: 4.33 kB 1
vrj/m1_1/VR_FRM 0.123 k allocs: 6.19 kB 0.123 k allocs: 6.19 kB 1
vrj/m1_16/Coevolve 0.079 k allocs: 6.67 kB 0.079 k allocs: 6.67 kB 1
vrj/m1_16/VR_Direct 0.082 k allocs: 6.52 kB 0.082 k allocs: 6.52 kB 1
vrj/m1_16/VR_DirectFW 0.082 k allocs: 6.52 kB 0.082 k allocs: 6.52 kB 1
vrj/m1_16/VR_FRM 0.159 k allocs: 20.3 kB 0.159 k allocs: 20.3 kB 1
time_to_load 0.2 k allocs: 11.7 kB 0.2 k allocs: 11.7 kB 1

Benchmark Results (Julia lts)

Time benchmarks
master 7cee427 master / 7cee427
aggregators/CCNRM 0.109 ± 0.002 ms 0.105 ± 0.0025 ms 1.04 ± 0.031
aggregators/Coevolve 0.125 ± 0.0029 ms 0.125 ± 0.003 ms 1 ± 0.034
aggregators/DirectCR 0.129 ± 0.003 ms 0.123 ± 0.0029 ms 1.05 ± 0.035
aggregators/DirectFW 0.0867 ± 0.0024 ms 0.0891 ± 0.0027 ms 0.973 ± 0.04
aggregators/FRM 0.0879 ± 0.0035 ms 0.0846 ± 0.0035 ms 1.04 ± 0.06
aggregators/FRMFW 0.0895 ± 0.0028 ms 0.0886 ± 0.0026 ms 1.01 ± 0.043
aggregators/NRM 0.111 ± 0.0038 ms 0.109 ± 0.0043 ms 1.01 ± 0.053
aggregators/RDirect 0.108 ± 0.0029 ms 0.111 ± 0.0039 ms 0.976 ± 0.044
aggregators/RSSA 0.0992 ± 0.0038 ms 0.0983 ± 0.0044 ms 1.01 ± 0.06
aggregators/RSSACR 0.121 ± 0.0049 ms 0.117 ± 0.004 ms 1.04 ± 0.055
aggregators/SortingDirect 0.0907 ± 0.0043 ms 0.0878 ± 0.0024 ms 1.03 ± 0.056
construct/jumpproblem_constantrate 0.151 ± 0.02 μs 0.15 ± 0.011 μs 1.01 ± 0.15
construct/jumpproblem_massaction 0.341 ± 0.02 μs 0.35 ± 0.019 μs 0.974 ± 0.078
construct/vr_direct 4.2 ± 0.27 μs 4.31 ± 0.41 μs 0.974 ± 0.11
construct/vr_frm 7.17 ± 0.48 μs 7.2 ± 0.54 μs 0.996 ± 0.1
events/ode_division/Direct 0.338 ± 0.0073 ms 0.334 ± 0.0057 ms 1.01 ± 0.028
events/sde_dosing/Direct 0.189 ± 0.0043 ms 0.188 ± 0.0049 ms 1 ± 0.035
events/ssa_dosing/Direct 0.0636 ± 0.0011 ms 0.0635 ± 0.0013 ms 1 ± 0.026
events/vrj_reset/VR_Direct 0.977 ± 0.0052 ms 0.985 ± 0.011 ms 0.991 ± 0.012
events/vrj_reset/VR_FRM 1.33 ± 0.014 ms 1.3 ± 0.011 ms 1.02 ± 0.014
ode/mixed/VR_Direct 0.97 ± 0.011 ms 0.964 ± 0.013 ms 1.01 ± 0.017
ode/mixed/VR_FRM 1.52 ± 0.013 ms 1.5 ± 0.013 ms 1.01 ± 0.012
ode/sir_zero_drift/Direct 0.295 ± 0.0077 ms 0.302 ± 0.014 ms 0.975 ± 0.052
ode/sir_zero_drift/NRM 0.354 ± 0.045 ms 0.322 ± 0.0078 ms 1.1 ± 0.14
ode/telegraph/Coevolve 0.12 ± 0.0026 ms 0.12 ± 0.0016 ms 1 ± 0.026
ode/telegraph/Direct 0.105 ± 0.0011 ms 0.107 ± 0.0032 ms 0.985 ± 0.032
ode/telegraph/NRM 0.11 ± 0.0053 ms 0.109 ± 0.0013 ms 1.01 ± 0.05
pure_jump/bounded_vrj/Coevolve 0.199 ± 0.0054 ms 0.198 ± 0.0048 ms 1 ± 0.036
pure_jump/chain/CCNRM 0.412 ± 0.0072 ms 0.411 ± 0.0072 ms 1 ± 0.025
pure_jump/chain/Direct 2.28 ± 0.027 ms 1.98 ± 0.041 ms 1.15 ± 0.028
pure_jump/chain/DirectCR 0.335 ± 0.0066 ms 0.337 ± 0.0071 ms 0.993 ± 0.029
pure_jump/chain/NRM 0.418 ± 0.0074 ms 0.417 ± 0.0096 ms 1 ± 0.029
pure_jump/chain/RSSA 0.983 ± 0.012 ms 0.98 ± 0.0061 ms 1 ± 0.014
pure_jump/chain/RSSACR 0.25 ± 0.0065 ms 0.251 ± 0.0092 ms 0.995 ± 0.045
pure_jump/chain/SortingDirect 0.608 ± 0.0098 ms 0.611 ± 0.0082 ms 0.994 ± 0.021
sde/mixed/VR_Direct 0.601 ± 0.0083 ms 0.595 ± 0.007 ms 1.01 ± 0.018
sde/mixed/VR_FRM 3.38 ± 0.05 ms 3.38 ± 0.017 ms 0.997 ± 0.016
sde/telegraph/Direct 0.194 ± 0.0073 ms 0.186 ± 0.005 ms 1.04 ± 0.048
solve/constantrate 0.0793 ± 0.0035 ms 0.0821 ± 0.0037 ms 0.966 ± 0.061
solve/massaction 0.087 ± 0.0033 ms 0.0914 ± 0.0028 ms 0.952 ± 0.047
vrj/m1_1/VR_Direct 0.216 ± 0.0073 ms 0.223 ± 0.0066 ms 0.97 ± 0.044
vrj/m1_1/VR_DirectFW 0.235 ± 0.0057 ms 0.237 ± 0.0059 ms 0.994 ± 0.035
vrj/m1_1/VR_FRM 0.3 ± 0.0052 ms 0.288 ± 0.0053 ms 1.04 ± 0.027
vrj/m1_16/Coevolve 0.125 ± 0.0025 ms 0.126 ± 0.0029 ms 0.995 ± 0.03
vrj/m1_16/VR_Direct 0.433 ± 0.0064 ms 0.431 ± 0.0086 ms 1 ± 0.025
vrj/m1_16/VR_DirectFW 0.472 ± 0.0082 ms 0.475 ± 0.0068 ms 0.994 ± 0.022
vrj/m1_16/VR_FRM 1.53 ± 0.016 ms 1.5 ± 0.012 ms 1.02 ± 0.014
time_to_load 0.86 ± 0.0074 s 0.874 ± 0.0078 s 0.984 ± 0.012
Memory benchmarks
master 7cee427 master / 7cee427
aggregators/CCNRM 1.82 k allocs: 0.192 MB 1.82 k allocs: 0.192 MB 1
aggregators/Coevolve 1.83 k allocs: 0.192 MB 1.83 k allocs: 0.192 MB 1
aggregators/DirectCR 1.83 k allocs: 0.193 MB 1.83 k allocs: 0.193 MB 1
aggregators/DirectFW 1.85 k allocs: 0.194 MB 1.85 k allocs: 0.194 MB 1
aggregators/FRM 1.84 k allocs: 0.194 MB 1.84 k allocs: 0.194 MB 1
aggregators/FRMFW 1.84 k allocs: 0.194 MB 1.84 k allocs: 0.194 MB 1
aggregators/NRM 1.83 k allocs: 0.192 MB 1.83 k allocs: 0.192 MB 1
aggregators/RDirect 1.84 k allocs: 0.194 MB 1.84 k allocs: 0.194 MB 1
aggregators/RSSA 1.82 k allocs: 0.192 MB 1.82 k allocs: 0.192 MB 1
aggregators/RSSACR 1.85 k allocs: 0.194 MB 1.85 k allocs: 0.194 MB 1
aggregators/SortingDirect 1.84 k allocs: 0.194 MB 1.84 k allocs: 0.194 MB 1
construct/jumpproblem_constantrate 12 allocs: 0.781 kB 12 allocs: 0.781 kB 1
construct/jumpproblem_massaction 10 allocs: 0.703 kB 10 allocs: 0.703 kB 1
construct/vr_direct 0.1 k allocs: 5.36 kB 0.1 k allocs: 5.36 kB 1
construct/vr_frm 0.097 k allocs: 15 kB 0.097 k allocs: 15 kB 1
events/ode_division/Direct 0.059 k allocs: 4.8 kB 0.059 k allocs: 4.8 kB 1
events/sde_dosing/Direct 0.133 k allocs: 10.7 kB 0.133 k allocs: 10.7 kB 1
events/ssa_dosing/Direct 10 allocs: 1.03 kB 10 allocs: 1.03 kB 1
events/vrj_reset/VR_Direct 0.072 k allocs: 6.09 kB 0.072 k allocs: 6.09 kB 1
events/vrj_reset/VR_FRM 0.093 k allocs: 8.06 kB 0.093 k allocs: 8.06 kB 1
ode/mixed/VR_Direct 0.059 k allocs: 4.81 kB 0.059 k allocs: 4.81 kB 1
ode/mixed/VR_FRM 0.079 k allocs: 6.58 kB 0.079 k allocs: 6.58 kB 1
ode/sir_zero_drift/Direct 0.052 k allocs: 4.17 kB 0.052 k allocs: 4.17 kB 1
ode/sir_zero_drift/NRM 0.056 k allocs: 4.45 kB 0.056 k allocs: 4.45 kB 1
ode/telegraph/Coevolve 0.057 k allocs: 4.53 kB 0.057 k allocs: 4.53 kB 1
ode/telegraph/Direct 0.052 k allocs: 4.17 kB 0.052 k allocs: 4.17 kB 1
ode/telegraph/NRM 0.056 k allocs: 4.45 kB 0.056 k allocs: 4.45 kB 1
pure_jump/bounded_vrj/Coevolve 16 allocs: 2.28 kB 16 allocs: 2.28 kB 1
pure_jump/chain/CCNRM 12 allocs: 9.34 kB 12 allocs: 9.34 kB 1
pure_jump/chain/Direct 11 allocs: 6.09 kB 11 allocs: 6.09 kB 1
pure_jump/chain/DirectCR 11 allocs: 6.09 kB 11 allocs: 6.09 kB 1
pure_jump/chain/NRM 15 allocs: 19 kB 15 allocs: 19 kB 1
pure_jump/chain/RSSA 11 allocs: 6.09 kB 11 allocs: 6.09 kB 1
pure_jump/chain/RSSACR 11 allocs: 6.09 kB 11 allocs: 6.09 kB 1
pure_jump/chain/SortingDirect 11 allocs: 6.09 kB 11 allocs: 6.09 kB 1
sde/mixed/VR_Direct 0.144 k allocs: 12.1 kB 0.144 k allocs: 12.1 kB 1
sde/mixed/VR_FRM 0.21 k allocs: 19 kB 0.21 k allocs: 19 kB 1
sde/telegraph/Direct 0.133 k allocs: 10.6 kB 0.133 k allocs: 10.6 kB 1
solve/constantrate 1.85 k allocs: 0.194 MB 1.85 k allocs: 0.194 MB 1
solve/massaction 1.85 k allocs: 0.194 MB 1.85 k allocs: 0.194 MB 1
vrj/m1_1/VR_Direct 0.059 k allocs: 4.78 kB 0.059 k allocs: 4.78 kB 1
vrj/m1_1/VR_DirectFW 0.059 k allocs: 4.78 kB 0.059 k allocs: 4.78 kB 1
vrj/m1_1/VR_FRM 0.079 k allocs: 6.67 kB 0.079 k allocs: 6.67 kB 1
vrj/m1_16/Coevolve 0.057 k allocs: 7.17 kB 0.057 k allocs: 7.17 kB 1
vrj/m1_16/VR_Direct 0.059 k allocs: 6.97 kB 0.059 k allocs: 6.97 kB 1
vrj/m1_16/VR_DirectFW 0.059 k allocs: 6.97 kB 0.059 k allocs: 6.97 kB 1
vrj/m1_16/VR_FRM 0.107 k allocs: 20.8 kB 0.107 k allocs: 20.8 kB 1
time_to_load 0.153 k allocs: 14.5 kB 0.153 k allocs: 14.5 kB 1

@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review November 10, 2026 11:50
@ChrisRackauckas
ChrisRackauckas marked this pull request as draft November 10, 2026 11:52
@ChrisRackauckas

Copy link
Copy Markdown
Member

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

Independent review (Codex CLI v0.164.0 / gpt-6.1-sol), reviewer session 01a1c54e-1897-7cd1-bc22-d7c9d38298e1, reviewed head 123c306

  • Verdict: CHANGES
  • Risk assessment: medium-low (ML7: additive exported mass-action operations and native input support for the optional fixed-step leaping solver; correctness failures below block acceptance).
  • Round / slot: 1 / 1

This is a blind code-only review by a session other than the PR author's, copied below from the reviewer's report with only the grading metadata removed. The posting agent did not re-run the reviewer's commands. A MERGE verdict is advice; merging is left to the maintainers.

Risk

medium-low (ML7: additive exported mass-action operations and native input support for the optional fixed-step leaping solver; correctness failures below block acceptance).

Blocking findings

  • Verdict: CHANGES
  • Round: 1
  • Blocking priorities: P1, P2
  • Deferred P2 issues: none supplied.
  1. [P1] Integer rate constants still cause silent propensity and drift overflow. src/massaction_rates.jl:211 initializes the accumulator from the population and constant types, ignoring the floating-point destination. With integer populations and integer stored constants, the falling factorial and subsequent arithmetic overflow before assignment to Float64.

    Confirmed by running:

    n = 3_000_000
    maj = MassActionJump([1], [[1 => 3]], [[1 => -3]]; scale_rates = false)
    massaction_rates!(zeros(1), maj, [n])
    massaction_drift!(zeros(1), maj, [n])

    The propensity is 8.553228926296448e18; the independent reference Float64(big(n)*(n-1)*(n-2)) is 2.6999973000006e19. Drift is -7.212942705179793e18 instead of approximately -8.0999919000018e19. Scalar and vector constants both fail, including default scaling with integer constant 6. This reaches the solver: with tspan=(0.0, 1e-18), dt=1e-18, and seed=123, equivalent integer/floating constants produce 6/23 reaction firings respectively. The added large-population test uses floating-point constants, so it misses this case.

    Suggested fix: promote the accumulator and drift arithmetic to a suitable working/output scalar type before integer multiplication. Add regressions combining integer populations, integer stored constants, and floating-point destinations.

  2. [P2] The public operations fail on single-reaction parameter-mapped definitions. src/massaction_rates.jl:163 assumes collection-shaped stoichiometry when materializing rates, and src/massaction_rates.jl:172 only normalizes scalar fixed-rate definitions. The supported single-reaction parameter-mapped constructor therefore cannot be passed directly to the new operations.

    Confirmed by running:

    maj = MassActionJump([1 => 1], [1 => -1, 2 => 1]; param_idxs = 1)
    massaction_rates!(zeros(1), maj, [20, 0]; p = [0.3])
    massaction_stoichiometry_mul!(zeros(2), maj, [2.0])
    massaction_drift!(zeros(2), maj, [20, 0]; p = [0.3])

    All three calls raise BoundsError; their expected results are [6.0], [-2.0, 2.0], and [-6.0, 6.0]. Rate materialization treats the two species entries in net_stoch as two reactions and reads the nonexistent second parameter index. Stoichiometry multiplication attempts to unpack integers as species/coefficient pairs. The equivalent collection-shaped definition works. JumpProblem normalizes this representation, which hides the error in the added mapped-parameter tests.

    Suggested fix: normalize single-reaction parameter-mapped definitions consistently with fixed-rate definitions, before counting reactions, filling rates, or iterating stoichiometry. Test the raw definition with all three exported operations.

Non-blocking findings

  • ext/JumpProcessesKernelAbstractionsExt.jl:113 and :269: trajectory validation checks shared mass-action data, while replacement RegularJump functions returned by prob_func are ignored in favor of the template functions. A zero-birth template replaced with rate-1000 births produces serial endpoints [232.0, 194.0] and kernel endpoints [0.0, 0.0] with seed=123. Confirmed on both this head and origin/master (131b05e2cfb1f69d5c415d58a50f6b874ef0347d), so this is an existing limitation, not a new blocker. Suggested follow-up: reject incompatible regular-jump definitions or document the shared-function restriction alongside the new prob_func restrictions.

What I ran

All scratch files and environments are under this round's scratch/; TMPDIR was exported to this round's tmp/ before commands. The runtime's layered JULIA_DEPOT_PATH was preserved. Julia test/setup processes used four threads, four precompile tasks, memory-capped scopes, and 7200-second shell timeouts. No checkout files were edited.

  • git diff origin/master...HEAD, source/test/instruction inspection, and git diff --check origin/master...HEAD: whitespace check passed. Final head and clean checkout were checked.
  • julia --version: 1.13.2. The checkout supplies no interpreter pin or Manifest. Scratch environments were resolved from its Project.toml dependency/test/weak-dependency declarations and compatibility bounds, with this checkout developed by path. CPU environment: SciMLBase 3.58.0, ForwardDiff 1.4.7, KernelAbstractions 0.9.45.
  • uv run --locked python --version: Python 3.15.0, with warning: --locked has no effect outside a project. There is no uv.lock or pyproject.toml; no locked project Python interpreter was available or used for testing.
  • julia --startup-file=no --check-bounds=yes --project=<scratch/env> <scratch/affected.jl>: 36/36 new API assertions and 28/28 new CPU kernel assertions passed.
  • GROUP=InterfaceI julia --startup-file=no --check-bounds=yes --project=<scratch/env> test/runtests.jl: exit 0, including 225/225 existing tau-leaping assertions and 36/36 new API assertions.
  • The same runner with GROUP=InterfaceII: exit 0, including 28/28 fixed-step mass-action kernel, 169/169 SSA kernel, and 148/148 explicit tau kernel assertions.
  • The same runner with GROUP=QA: exit 0, 20/20 assertions.
  • nvidia-smi inventory, then CUDA_VISIBLE_DEVICES=1 julia --startup-file=no --check-bounds=yes --project=<scratch/gpuenv> <scratch/gpu.jl>: exit 0 on RTX PRO 6000 Blackwell Max-Q, CUDA 6.1.0, runtime 13.2. CUDA.functional() returned true, a device array arithmetic probe passed, 28/28 new CUDA kernel assertions passed, and 2/2 existing test/gpu/regular_jumps.jl assertions passed.
  • Scratch probes.jl and probes_more.jl: reproduced both blockers and the existing regular-jump limitation; parameter refresh/reuse assertions passed; all five algorithms in the new documentation example completed successfully and conserved total population. The default parameter-mapped CPU kernel produced mean 818.605 against the independent fixed-leap mean 818.5668046884276.
  • Scratch regressions.jl, under the same checked-bounds CPU environment: exit 1, with 2 failed numerical assertions and 3 errors, reproducing the two blockers above.
  • Scratch baseline.jl against a git archive origin/master checkout and matching scratch environment: exit 0, reproducing the non-blocking regular-jump limitation. No baseline source was modified.

What I did not verify

  • Full documentation build, the complete CUDA group beyond the changed fixture and existing regular-jump suite, ThreadSafety group, other GPU backends, supported older Julia versions, and 32-bit platforms.
  • GitHub CI results, PR description, comments, previous reviews, and author risk ratings were not consulted during this blind review.

🤖 Posted by an AI agent — harness: Claude Code 2.1.322 · model: claude-sonnet-5-5
Conversation: local session 3878b54e-28f2-4a01-a176-a8f5468d1997 (no session URL)

@isaacsas

Copy link
Copy Markdown
Member

There is a design problem that needs to be solved here before I'd want to make any additional changes. Some tau-leaping methods may want both an individual jump representation (like MassActionJump) and a RegularJump representation for efficiency (i.e. timestep estimation vs. the actual step). This means they need duplicate representations for the same jumps. Others may not, and would just want to promote MassActionJump to a representation they can use. Still others may only want individual jump representations and not have any use for a RegularJump representation.

We need to figure out a good design / interface for these cases before we create a mess of rules for different leaping solvers.

ChrisRackauckas and others added 2 commits November 12, 2026 06:33
Promote propensity and stoichiometry products with the output scalar type.
Normalize single-reaction parameter mappings before materializing working rates.
Cover integer constants, large reaction counts, raw parameter mappings, and
fixed-seed integer/floating solver equivalence.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.164.0
Agent-Model: gpt-6.1-sol
Agent-Session: local fixer job SciML__JumpProcesses.jl__652 (no session URL)
Upstream released 10.2.0 with isolated_copy; the mass-action leaping API
is the next additive release.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.325
Agent-Model: claude-sonnet-5-5
Agent-Session: local fixer job SciML__JumpProcesses.jl__652 (no session URL)

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.

3 participants