Repository navigation
fix(gpu): overflow-safe simulator launch, layout and transfer checks (#812) - #1404
Merged
Merged
Conversation
godofecht
force-pushed
the
fix/812-dispatch-dimension-validation
branch
from
October 7, 2026 12:51
2bed62b to
6c262bd
Compare
godofecht
marked this pull request as ready for review
October 7, 2026 12:52
godofecht
force-pushed
the
fix/812-dispatch-dimension-validation
branch
from
October 7, 2026 17:51
6c262bd to
923bb7e
Compare
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 7, 2026
godofecht
enabled auto-merge
October 7, 2026 19:22
godofecht
force-pushed
the
fix/812-dispatch-dimension-validation
branch
from
October 7, 2026 19:23
923bb7e to
da6c3be
Compare
godofecht
added a commit
that referenced
this pull request
Oct 7, 2026
The goldens job ran only on compiler or workflow changes, but the MLIR corpus names programs under examples, tests, lib and benchmarks, and the crossing pages read wasm/ and tools/gpu. A pull request touching those skipped the job and only the merge queue found the failure (#1404). A new goldens path filter covers all of it, and tools/ci_gating (run in the Doc links job) fails when a corpus program or a surface the job reads is outside the filter, or the job is not gated on it. Any .flow change also runs the parity gates, since parse coverage and fmt_check read every tracked .flow file.
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Oct 7, 2026
…812) grid_1d/2d/3d computed (n + b - 1) / b and multiplied block counts without bounds, so a large extent or block size overflowed i32 and trapped. They now return an empty LaunchConfig for nonpositive sizes, blocks over 1024 threads or a count past i32, and use (n - 1) / b + 1. The f32 buffer allocators, host/device copies and layout helpers reject lengths that would overflow or copy past the destination. tests/runtime/test_gpu_launch_validation.flow aborts (exit 134) with main's gpu_sim.flow and passes here.
The flowc MLIR goldens job failed in the merge queue on 12 corpus programs that import gpu_sim.flow. parity_mlir --record, keeping only those 12 rows and the new tests/runtime/test_gpu_launch_validation.flow.
godofecht
force-pushed
the
fix/812-dispatch-dimension-validation
branch
from
October 7, 2026 22:47
da6c3be to
4bdf87f
Compare
godofecht
enabled auto-merge
October 7, 2026 22:47
godofecht
added a commit
that referenced
this pull request
Oct 7, 2026
flowc MLIR goldens fail on the three corpus programs that compile gpu_memory.flow. parity_mlir --record on main plus #1404, keeping only those rows and the new tests/runtime/test_gpu_memory_bounds.flow.
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.
Part of #812 (host-side launch and layout validation). Rebuilt as one commit on main
e2205a79.Change
grid_1d,grid_2d,grid_3dinlib/stdlib/gpu_sim.flow: return an emptyLaunchConfigfor zero or negative sizes, blocks over 1024 threads, or a launch count past i32. Ceil division is(n - 1) / b + 1.host_alloc_f32,device_alloc_f32, the host/device copies andlayout_1d/2d/3dreject lengths that would overflow or copy past the destination.The draft's test sat in tests/core, which no runner executes as a suite (and corpus_parity would need a golden row). It is now
tests/runtime/test_gpu_launch_validation.flow.Proof
tests/runtime/test_gpu_launch_validation.flow: passes; with main'sgpu_sim.flowit aborts (exit 134, i32 overflow trap).tests/core/test_gpu_sim*.flowprograms keep their corpus results (none appear in the corpus mismatch list).Gates
test-lang 274/0, test-runtime 35/0.
corpus_parity --checkon Darwin reports 1015 < floor 1033; the mismatches are effects fixtures exiting 134 under strict effects and stdout drifts in examples, none in files this PR touches.Remaining for #812
The typed render/compute pass graph, hazard checks and Metal/WebGPU fluid and ocean kernels are #1407.