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

Closed
YOGESH9139 wants to merge 1 commit from upstream-pr/209 into main
YOGESH9139 commented 2026-11-26 11:44:58 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by YOGESH9139 on 2026-11-26T11:44:58Z.


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

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6625941349 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/209). Originally posted by [YOGESH9139](https://github.com/YOGESH9139) on 2026-11-26T11:44:58Z. --- 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)
YOGESH9139 commented 2026-11-26 12:51:38 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by YOGESH9139 on 2026-11-26T12:51:38Z.


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

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7192555547 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/209#issuecomment-7192555547). Originally posted by [YOGESH9139](https://github.com/YOGESH9139) on 2026-11-26T12:51:38Z. --- Closing: I'm stopping this work for now and taking the fork down. Thanks for the reviews.

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
avatarmanz/VIctory-7900XTX!209
No description provided.