Repository navigation
Fix EnsembleGPUArray continuous callback event detection on GPU arrays - #503
Merged
ChrisRackauckas merged 1 commit intoAug 28, 2026
Conversation
1 of 2 tasks
ChrisRackauckas-Claude
marked this pull request as draft
August 27, 2026 16:51
ChrisRackauckas-Claude
force-pushed
the
fix-ensemblegpuarray-callback-events
branch
from
August 27, 2026 18:31
af61627 to
ff781cb
Compare
Use DiffEqBase's public generic event-detection fallback for device-backed sign caches and require the release that provides it. Preserve positive and negative continuous-callback directions separately when generating and dispatching EnsembleGPUArray callbacks. Add a JLArrays regression that exercises both event directions through the generated vector callback. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.150.1 Agent-Model: unknown Agent-Session: local session ID 01a0441e-3d2f-7170-ab6e-58ef72975a9f
ChrisRackauckas-Claude
force-pushed
the
fix-ensemblegpuarray-callback-events
branch
from
August 27, 2026 21:37
ff781cb to
8ae7724
Compare
ChrisRackauckas
marked this pull request as ready for review
August 28, 2026 01:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
Preserve the positive/negative direction mask when
EnsembleGPUArrayturns a scalarContinuousCallbackinto aVectorContinuousCallback, and dispatchaffect!for+1andaffect_neg!for-1. The branch now depends on the public genericDiffEqBase.findall_events!fallback added by SciML/OrdinaryDiffEq.jl#4398 instead of extending a non-public dependency API inside DiffEqGPU.The callback mask is copied to the device before the kernel launches, so the generated callback works with device-backed ensemble state without scalar indexing.
This PR should be ignored until reviewed by @ChrisRackauckas.
Failing before
On the unfixed callback kernel, the direction regression expected
[11, -8, 3]after applying positive, negative, and inactive events but observed[-9, 12, 3]: the positive and negative hooks were reversed (0 passed, 1 failed).The prerequisite's focused generic-array regression also failed before SciML/OrdinaryDiffEq.jl#4398 with a
MethodErrorfromfindall_events!(0 passed, 1 failed, 1 errored).Passing after
After rebasing over current DiffEqGPU
master(a07991d, release 3.19.0), the project manifest resolved the locally developed DiffEqBase prerequisite and these exact commands passed:The following also exited with code 0 and no output:
Not verified locally
CUDA execution was not run because this machine has no usable CUDA device. The CPU-backed JLArrays group exercises the callback generation and kernel direction dispatch; the CUDA workflow must verify real device execution.
Dependency
🤖 Generated with Codex CLI 0.150.1 (model: unknown; session: local session ID 01a0441e-3d2f-7170-ab6e-58ef72975a9f).