fix(shader): select wave32 ballot words explicitly #5250

Closed
MojoisDev wants to merge 1 commit from upstream-pr/5250 into main
MojoisDev commented 2026-10-13 15:34:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MojoisDev on 2026-10-13T15:34:59Z.


What

On Linux with an RTX 5060 and NVIDIA 590.48.01, the unchanged agc_driver_wave32_subgroup fixture fails its forced 64-wide layout: the VCC ballot count is 0 rather than 8. Reproduced on main eb5bee4bfe7f436070e7ba6723d1c7bf096e8116 with SPIRV-Tools ON and OFF.

EmitWaveBallot now selects the word with constant component extracts and selects, preserving all four ballot components. The valid-index result is identical to OpVectorExtractDynamic; non-split subgroups are unchanged. This is a workaround for the observed shader pattern, with no claim about the driver's internal cause, game behavior, or FPS. The limitation is recorded in shader technical debt.

Tested

Linux, GCC 13.3, Release, bundled dependencies. RTX 5060/NVIDIA 590.48.01 and Ryzen 7 9700X integrated GPU/RADV Mesa 25.0.7; explicit GPU selection and required Vulkan.

  • Existing unchanged agc_driver_wave32_subgroup: fails before, passes five repeats on each GPU with tools ON and OFF.
  • Existing wave32_wide_subgroup: software interpretation of 32/64/128-wide subgroup masks passes; five repeats with tools OFF.
  • Full build with tools ON succeeds. Full 1068-test CTest: NVIDIA 1056 pass/1 fail/11 skip; AMD 1052 pass/4 fail/12 skip. NVIDIA fails guest_math. AMD additionally fails agc_driver_alpha_to_coverage, agc_driver_wave32_exec_lane_bits, agc_compute_pipeline_replay. All four reproduce with the original helper and identical diagnostics. Both skip checkers pass. The full suite is not green.
  • Final restored tools-ON full build succeeds; nine focused ballot/lane/control-flow tests pass on each GPU.
  • python3 tools/check_conventions.py --base origin/main and git diff --check: pass.

Not tested: game impact, FPS, driver-cache coldness, Windows, Intel, other NVIDIA models or 128-wide GPU hardware. Full suite with tools OFF was not run. Logs can be provided; no investigation artifacts are committed.

Integration check before publication: the tested commit merges cleanly with live main 068ab2aba6fd4950e81bcdcf44effbacbe294fc0. Tests above remain scoped to the eb5bee4 base; the newer merged tree was not rebuilt locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4845646606 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5250). Originally posted by [MojoisDev](https://github.com/MojoisDev) on 2026-10-13T15:34:59Z. --- ### What On Linux with an RTX 5060 and NVIDIA 590.48.01, the unchanged `agc_driver_wave32_subgroup` fixture fails its forced 64-wide layout: the VCC ballot count is 0 rather than 8. Reproduced on main `eb5bee4bfe7f436070e7ba6723d1c7bf096e8116` with SPIRV-Tools ON and OFF. `EmitWaveBallot` now selects the word with constant component extracts and selects, preserving all four ballot components. The valid-index result is identical to `OpVectorExtractDynamic`; non-split subgroups are unchanged. This is a workaround for the observed shader pattern, with no claim about the driver's internal cause, game behavior, or FPS. The limitation is recorded in shader technical debt. ### Tested Linux, GCC 13.3, Release, bundled dependencies. RTX 5060/NVIDIA 590.48.01 and Ryzen 7 9700X integrated GPU/RADV Mesa 25.0.7; explicit GPU selection and required Vulkan. - Existing unchanged `agc_driver_wave32_subgroup`: fails before, passes five repeats on each GPU with tools ON and OFF. - Existing `wave32_wide_subgroup`: software interpretation of 32/64/128-wide subgroup masks passes; five repeats with tools OFF. - Full build with tools ON succeeds. Full 1068-test CTest: NVIDIA 1056 pass/1 fail/11 skip; AMD 1052 pass/4 fail/12 skip. NVIDIA fails `guest_math`. AMD additionally fails `agc_driver_alpha_to_coverage`, `agc_driver_wave32_exec_lane_bits`, `agc_compute_pipeline_replay`. All four reproduce with the original helper and identical diagnostics. Both skip checkers pass. The full suite is not green. - Final restored tools-ON full build succeeds; nine focused ballot/lane/control-flow tests pass on each GPU. - `python3 tools/check_conventions.py --base origin/main` and `git diff --check`: pass. Not tested: game impact, FPS, driver-cache coldness, Windows, Intel, other NVIDIA models or 128-wide GPU hardware. Full suite with tools OFF was not run. Logs can be provided; no investigation artifacts are committed. Integration check before publication: the tested commit merges cleanly with live main `068ab2aba6fd4950e81bcdcf44effbacbe294fc0`. Tests above remain scoped to the `eb5bee4` base; the newer merged tree was not rebuilt locally.
github-actions[bot] commented 2026-10-13 17:00:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T17:00:23Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#4706 docs/dev/debt/shader.md L19
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6150809517 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5250#issuecomment-6150809517). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T17:00:23Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #4706 | `docs/dev/debt/shader.md` [L19](https://github.com/boykopovar/AnyPS5/blob/18c438b1092b09cef54e4cfacab441c009a6b501/docs/dev/debt/shader.md#L19) | | |

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!5250
No description provided.