Repository navigation
Conversation
Fixes KhronosGroup#6319. The "must not have a product of zero" checks multiplied the three workgroup dimensions and compared the result with 0, but the product can wrap to 0 when no dimension is 0. For `LocalSize` the 32-bit operands were multiplied in 32 bits before being stored in a `uint64_t`, so `LocalSize 1048576 1048576 1048576` (2^60) was rejected. `LocalSizeId` and the `WorkgroupSize` built-in multiply in 64 bits, which wraps for three dimensions of 4194304 (2^66). The checks now test each dimension. The `LocalSize` product, still used by the `DerivativeGroupLinearKHR` multiple-of-4 check, is computed in 64 bits; that check stays correct if the product wraps, since 4 divides 2^64. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #6319.
The "must not have a product of zero" checks multiplied the three workgroup dimensions and compared the result with 0. The product can wrap to 0 when no dimension is 0:
LocalSize: the operands are 32-bit, andoperand_x * operand_y * operand_zwas computed in 32 bits before it was stored in auint64_t.LocalSize 1048576 1048576 1048576(2^60) gave the error from the issue.LocalSizeIdand theWorkgroupSizebuilt-in multiply in 64 bits, which wraps for larger values, e.g. three constants of 4194304 (2^66).The checks now test whether any dimension is 0. For
LocalSizethe product is computed in 64 bits; it is still used by theDerivativeGroupLinearKHRmultiple-of-4 check, which stays correct if the 64-bit product wraps (4 divides 2^64).Tests:
GLComputeLargeLocalSize,GLComputeLargeLocalSizeIdandGLComputeLargeWorkgroupSizeinval_modes_test.cpp. All three fail on main with the "product of zero" error and pass with the change. With the change,test_val_fghijklmnop(22108 tests) andtest_val_abcde(7896, including the built-in tests) pass on Linux (GCC 13, Debug).This PR was written with Claude Code (Claude Opus 5.5).
🤖 Generated with Claude Code