shader: find a ballot's first lane without OpGroupNonUniformBallotFindLSB #983
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!983
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/983/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?
@wuboo on GitHub · 2026-10-02 19:57 UTC · original
wuboo:pr/ballot-first-lane→main· +10 −6 · 2 files · 2 commits · closed without mergingProblem
ValueEmitContext::FirstLaneemitsOpGroupNonUniformBallotFindLSBwhen the wave is a single subgroup. SPIRV-Cross lowers that op to a helper that takes the subgroup size (threads_per_simdgroup), and Metal does not allow that attribute in vertex functions. On macOS/MoltenVK, a vertex shader in Astro Bot's (PPSA21564) main menu failed pipeline creation with:Change
Always find the first lane with
FindILsbon the ballot's first two words, which is what the two-half wave64 path in the same function already does. Bits past the subgroup size are always zero in a ballot, so the result is the same on every host. The only SPIR-V difference is anOpExtInst/OpSelectpair instead of the group op.The DS append loop test in
shaderCfgTests(which reachesFirstLane) now checks thatOpGroupNonUniformBallotFindLSBis not emitted and that a GLSL.std.450FindILsbis. Without the emitter change that test fails. The older FindLSB expectation sits inTestNewShaderRecompilerMoreAluFamilies, whichmain()does not call, so it is left as it was.Testing
shader_cfg_tests(Release, macOS x86_64) passes.@coderabbitai[bot] on GitHub · 2026-10-02 20:07 UTC · original · edited 2026-10-02 21:12 UTC
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
6cbd09f7-7d60-4843-a509-de37895cb017📥 Commits
Reviewing files that changed from the base of the PR and between
6f1af3f465and44dd44bcd7.📒 Files selected for processing (1)
tests/shaderCfgTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
📝 Walkthrough
Walkthrough
FirstLanenow finds the least-significant set bit directly from ballot words in both single-half and two-half execution. The test checks that generated SPIR-V omits opcode 343 and contains theFindILsbextended instruction, opcode 73.Suggested reviewers:
nmzikPriority: ⬆️ High
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
44dd4The changed lowering is exercised by the DS append/consume test, which rejects the previous instruction. The remaining stale expectation is not reached by the configured test entrypoint; no actionable merge risk remains.
🚥 Pre-merge checks | ✅ 4 | ❓ 1
❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 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.@coderabbitai[bot] on GitHub · 2026-10-02 20:07 UTC · original · reviewed
🧹 Nitpick comments (1)
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
b63943b4-8d4b-4f46-938e-95c5da7aa575📥 Commits
Reviewing files that changed from the base of the PR and between
e317465d8aand6f1af3f465.📒 Files selected for processing (2)
src/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; 6 remain after this review.
@wuboo on GitHub · 2026-10-02 20:58 UTC · original
Good catch. Looking closer, the problem was bigger:
TestNewShaderRecompilerMoreAluFamiliesis not called frommain()(it fails earlier on unrelated decoder expectations), so that check never ran, either before or after this change. In44dd44bcI restored that test as it was and moved the check into the DS append loop test, which does run and reachesFirstLane. It now asserts there is noOpGroupNonUniformBallotFindLSBand at least oneFindILsb. I verified that it fails with the old emitter and passes with this change.Pull request closed