emit: wave64 programs with LDS in lane branches run in waves of 32 on 32-lane hosts (VICTORY_LDS_REGION_RACE) #209

Closed
github-bot wants to merge 1 commit from github-bot/gh-209 into main AGit
Owner

@⁠YOGESH9139 on GitHub · 2026-11-26 11:44 UTC · original
YOGESH9139:pr/lds-region-race → main · +23 −0 · 1 files · 1 commits · closed without merging

Split out of #134, as asked: only the shader part, 23 lines in crates/victory-shader/src/emit/lower.rs.

What it does. On hosts whose waves are at most 32 lanes (NVIDIA), a console wave64 compute program with LDS in a group over 32, whose LDS accesses sit in lane branches (where no barrier can stand, and lds_meetings finds no meeting), kept 64-lane waves and the driver refused its pipeline ("Shader wants wave lane count of 64 but maximum wave lane count for device is 32"), so the pass was dropped. With this change such a program runs in waves of 32 anyway: barriers before each LDS access in blocks every lane runs, none inside the lane branches.

The shortcut. The two host waves of one console wave may race on LDS inside those branches. Dropping the pass altogether was the larger fault. It is only asked on 32-lane hosts; VICTORY_LDS_REGION_RACE=0 turns it off, and in tests it is off unless set to 1, so tests of programs that must keep WaveSize(64) still see them kept.

Measured on an RTX PRO 2000 Blackwell laptop GPU (8 GB), translate --pipelines over the 404 compute programs the driver refused before VICTORY_LDS_FLAGS:

pipelines made refused
this main 373 29
with this change 396 0

(8 still don't translate in waves of 32.) On the tree before VICTORY_LDS_FLAGS, Series S profile, world fps went from 1.9 to 2.2 and dropped draws a frame from 150-276 to about 46. Cross-tested on an RTX 4080 by Proudnoob4 in #134; their proper fixes for 2da4beb386509b77 and 369cbe906ea72764 would make this fallback unnecessary for those two.

Rebased on 0dec5dc; cargo check and the shader tests pass. After the idea in Linox-IDK's LNX-victory, written anew.

🤖 Generated with Claude Code

**@⁠YOGESH9139** on GitHub · 2026-11-26 11:44 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/209) `YOGESH9139:pr/lds-region-race` → `main` · +23 −0 · 1 files · 1 commits · closed without merging Split out of #134, as asked: only the shader part, 23 lines in `crates/victory-shader/src/emit/lower.rs`. **What it does.** On hosts whose waves are at most 32 lanes (NVIDIA), a console wave64 compute program with LDS in a group over 32, whose LDS accesses sit in lane branches (where no barrier can stand, and `lds_meetings` finds no meeting), kept 64-lane waves and the driver refused its pipeline ("Shader wants wave lane count of 64 but maximum wave lane count for device is 32"), so the pass was dropped. With this change such a program runs in waves of 32 anyway: barriers before each LDS access in blocks every lane runs, none inside the lane branches. **The shortcut.** The two host waves of one console wave may race on LDS inside those branches. Dropping the pass altogether was the larger fault. It is only asked on 32-lane hosts; `VICTORY_LDS_REGION_RACE=0` turns it off, and in tests it is off unless set to `1`, so tests of programs that must keep `WaveSize(64)` still see them kept. **Measured** on an RTX PRO 2000 Blackwell laptop GPU (8 GB), `translate --pipelines` over the 404 compute programs the driver refused before `VICTORY_LDS_FLAGS`: | | pipelines made | refused | |---|---|---| | this main | 373 | 29 | | with this change | 396 | 0 | (8 still don't translate in waves of 32.) On the tree before `VICTORY_LDS_FLAGS`, Series S profile, world fps went from 1.9 to 2.2 and dropped draws a frame from 150-276 to about 46. Cross-tested on an RTX 4080 by Proudnoob4 in #134; their proper fixes for `2da4beb386509b77` and `369cbe906ea72764` would make this fallback unnecessary for those two. Rebased on 0dec5dc; `cargo check` and the shader tests pass. After the idea in Linox-IDK's LNX-victory, written anew. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
On a host whose waves are at most 32 lanes (NVIDIA), a console wave64 compute
program with LDS in a group over 32 whose LDS accesses sit in lane branches
(no barrier can stand there, and lds_meetings finds no meeting) kept 64-lane
waves, and the driver refused its pipeline ("Shader wants wave lane count of 64
but maximum wave lane count for device is 32"): the pass was dropped. Now such
a program runs in waves of 32 anyway, with the barrier before each LDS access
in blocks every lane runs and none in the lane branches.

shortcut: the two host waves of a console wave may race on LDS in those
branches; dropping the pass altogether was the larger fault. Only asked on
32-lane hosts; VICTORY_LDS_REGION_RACE=0 turns it off, and in tests it is off
unless set to 1 (tests of programs that must keep WaveSize(64) see them kept).

Measured on an RTX PRO 2000 Blackwell laptop GPU (8 GB), `translate --pipelines`
over the 404 compute programs the driver refused before VICTORY_LDS_FLAGS: on
this main, 373 get a pipeline and 29 are still refused; with this change 396
get a pipeline and none is refused (8 do not translate in waves of 32). On the
tree before VICTORY_LDS_FLAGS, in the Series S profile, the world's frame rate
went from 1.9 to 2.2 fps and dropped draws a frame from 150-276 to about 46.
Cross-tested on an RTX 4080 by Proudnoob4 (avatarmanz/VIctory-7900XTX#134).
After the idea of Linox-IDK's LNX-victory, written anew.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:48:10 +00:00
github-bot closed this pull request 2026-11-26 12:53:18 +00:00
Author
Owner

@⁠YOGESH9139 on GitHub · 2026-11-26 12:51 UTC · original

Closing: I'm stopping this work for now and taking the fork down. Thanks for the reviews.

**@⁠YOGESH9139** on GitHub · 2026-11-26 12:51 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/209#issuecomment-7192555547) Closing: I'm stopping this work for now and taking the fork down. Thanks for the reviews.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.