Repository navigation
subgroup_size: reject zero workgroup dimensions in subgroup_workgroup_fits - #8762
Open
CourtyardGames wants to merge 1 commit into
Open
CourtyardGames wants to merge 1 commit into
CourtyardGames wants to merge 1 commit into
Conversation
Grimkeh
reviewed
Nov 23, 2026
Grimkeh
left a comment
There was a problem hiding this comment.
Independent Linux CPU review (ac52f42b)
What changed: subgroup_workgroup_fits rejects zero workgroup dimensions; C++ test updated.
Checked: Diff review of header + test (runtime not built here). Small, focused guard.
Looks correct; no game files.
|
Tested
|
This was referenced Nov 23, 2026
Open
Contributor
|
Verified head
AI-assisted. |
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.
Claimed in the coordination issue as: #8504 (comment)
What and why
subgroup_workgroup_fits()(runtime/src/subgroup_size.h) returnedtruewhenever any workgroup dimension inlocal_sizewas0:local_size[2] == 0short-circuited toreturn true, even whenmax_invocations == 0.local_size[0] == 0orlocal_size[1] == 0computedxy == 0, so0 <= max_invocations / local_size[2]also returnedtrue.Because SPIR-V
LocalSizerequires every workgroup dimension to be at least1, a0in any component ofentry.local_sizerepresents a malformed/unknown index entry that cannot be proved to satisfyVUID-VkPipelineShaderStageCreateInfo-pNext-02756(LocalSize.x * LocalSize.y * LocalSize.z <= requiredSubgroupSize * maxComputeWorkgroupSubgroups). For{64, 0, 1}and{64, 1, 0},decide_subgroup_size()previously returnedSubgroupOutcome::requiredand even enabledVK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT.This makes
subgroup_workgroup_fits()reject any zero workgroup dimension (!local_size[0] || !local_size[1] || !local_size[2]), and expandsruntime/test/subgroup_size_test.cppto check{0, 1, 1},{64, 0, 1},{64, 1, 0}, and{0, 0, 0}for both compute (cs) and mesh (ms) stages as well asmax_invocations == 0.Tested
RelWithDebInfo, Ninja); CPU-only (no GPU or game files needed).subgroup_size_testfails on unpatchedmain(line 181: !subgroup_workgroup_fits(bad_local, 1024)).subgroup_size_testandvk_pipeline_check, ranctest --test-dir runtime/build -R "^subgroup_size$" --output-on-failure(passed) andpython -I scripts/check_no_game_data.py runtime/src/subgroup_size.h runtime/test/subgroup_size_test.cpp(exit 0).AI-assisted: yes
Checklist
docs/design.md, with how it was confirmed. (N/A — runtime subgroup-size guard fix, not a shader-translator rule.)