fix(shader): isolate wave32 operations on 64-lane host subgroups #1293
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1293
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1293/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@carbonimax on GitHub · 2026-10-09 10:23 UTC · original
carbonimax:fix/wave32-host64-subgroups→main· +189 −12 · 7 files · 2 commits · closed without mergingWhen a wave32 workgroup runs in a 64-lane host subgroup, two guest waves share that subgroup. The emitted subgroup lane IDs, ballots and shuffle targets currently address the whole host subgroup, so
readfirstlanein the upper guest wave can read a value from the lower guest wave.Keep lane IDs relative to the 32-lane guest wave, select its 32-bit ballot word, and translate shuffle targets to the corresponding physical host lanes. Apply the same translation to DS lane reads, append/consume broadcasts and
DS_PERMUTE_B32.The mode is derived from the existing guest wave size and host subgroup size. The current NGG workgroup routing, allocation protocol and input assembly remain unchanged.
Two CPU regressions compile a mesh workgroup with wave32, 64 logical invocations and a 64-lane host subgroup. They validate the emitted SPIR-V and check guest-wave ballot selection and physical shuffle targets for
readfirstlaneandDS_PERMUTE_B32. Each regression fails without the fix and passes with it.Validation against
7b9997baea0d385e9e8fc2bd3abeb02110bc4148: Release x86_64 build passes; both targeted regressions and the completeshader_cfg_testssuite pass. Runtime behavior on a 64-lane subgroup GPU has not been tested.@chatgpt-codex-connector[bot] on GitHub · 2026-10-09 10:23 UTC · original · edited 2026-10-09 10:31 UTC
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
664b34eℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@coderabbitai[bot] on GitHub · 2026-10-09 10:29 UTC · original
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
e5386a9b-2af7-45f5-8504-89a175c0b7a5📥 Commits
Reviewing files that changed from the base of the PR and between
7b9997baeaand664b34e72e.📒 Files selected for processing (7)
src/graphics/shader/recompiler/backend/spirv/SpirvEmitter.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterInternal.hsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cppsrc/graphics/shader/recompiler/backend/spirv/spirvEmitterProgram.cpptests/shaderCfgTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review.
📝 Walkthrough
Walkthrough
The SPIR-V emitter now enables packed wave32 handling for workgroups with wave size 32 on a host subgroup of 64. It maps guest lanes to physical subgroup lanes and selects the ballot word for the active guest-wave half. Subgroup shuffle and ballot operations use these mappings. New mesh-shader regression tests inspect generated SPIR-V for read-first-lane and DS_PERMUTE cases.
Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
664b3The packed-wave mappings and targeted regression coverage present no identified blocker to merging after normal checks.
🚥 Pre-merge checks | ✅ 4 | ❓ 1
❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
Full details: Docstring Coverage
Explanation
Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 6 files. (1 skipped: 1 too large.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@carbonimax on GitHub · 2026-10-10 21:04 UTC · original
Hi, was this closed under the AI policy, or because you consider it a duplicate? I checked #985, #935, #1143 and
a8beac19: they handle branch decisions and one buffer-lane mask, not the lane IDs, ballots, shuffles and DS permutes this PR keeps inside each 32-lane guest wave.AI disclosure: the patch and its two regressions were written by AI agents (Claude and Codex) and run on my M4 Pro; I reviewed the change and the test results. Happy to rebase or reopen as a fresh PR with this note in the description if that works better for you.
Pull request closed