Add regression test for #613#727
Merged
Merged
Conversation
Launching a kernel with a scalar workgroupsize over a 2D ndrange pads the first dimension of the iteration space to a multiple of the workgroupsize. On the POCL backend the padded work items were not masked, so a linear @index(Global) reached past prod(ndrange) and out-of-bounds writes segfaulted. Detect this deterministically by writing linear indices into a flat array with room for the overshoot and checking the tail stays untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Benchmark ResultsShow table
Benchmark PlotsA plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR. |
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.
Adds a regression test for #613: launching a kernel with a scalar workgroupsize over a 2D ndrange pads the first dimension of the iteration space to a multiple of the workgroupsize. On the POCL backend the padded work items were not masked, so a linear
@index(Global)reached pastprod(ndrange)and@inboundswrites stochastically segfaulted.The original MWE only fails intermittently, so the test detects the failure mode deterministically instead: it writes linear indices into a flat array with room for the overshoot and checks that the tail stays untouched. Running the same kernel with
unsafe_indices=true(masking skipped) trips the check, confirming it catches unmasked padded work items.The reproducer no longer fails on current
mainwith the vendored POCL (both at the test shape and the original 300×5000 / workgroupsize 256 shape from the issue), so this guards against regressions; #613 can likely be closed.🤖 Generated with Claude Code