Shaders: readfirstlane on a wider hardware wave takes the max per program wave #27
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ThatRecompDev--five-star-recomp!27
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/27/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?
@Sr-0w on GitHub · 2026-11-25 11:32 UTC · original
Sr-0w:shaders/readfirstlane-wider→main· +13 −1 · 2 files · 1 commits · merged 2026-11-25 11:38 UTCWhat
On a hardware wave wider than the program wave (a 32-lane program in an AMD pixel wave of 64),
readfirstlanestill read the first active lane withWaveReadLaneAtat the ballot's lowest bit. #21 removed that read from the narrower path because AMD's compiler crashes on it. The same compiler (RX 7800 XT) also access-violates on it inCreatePipelineStateon this path, here on a tiled lighting pixel program. It ended every boot of a retail game after about two minutes.How the culprit was found:
fivestar shader pso.WaveReadLaneAtcalls one at a time leaves a single read (the fourth of eachreadfirstlane) that crashes the compiler by itself.The lane at the ballot's lowest bit now gives its value to a
WaveActiveMaxof auint4, with one component per program wave. A hardware wave holds at most four program waves: 128 lanes for a 32-lane program, or WARP's 4 lanes for the test waves. The pipeline then builds in 6.5 s. Only the group forms still usevw_read.Tests
Wave_operations_see_the_console_waveruns this path on WARP. Returning the first component for every program wave fails it.CompileBudgetTeststhat also fail on main on this machine fail here too.Docs: the
readfirstlaneparagraph ofshader-translation.md.🤖 Generated with Claude Code
@ThatRecompDev on GitHub · 2026-11-25 11:38 UTC · original
really nice detective work narrowing it down to the fourth WaveReadLaneAt, and the per-program-wave max is a clean way around it. merging.
those CompileBudgetTests failing on your machine are on us: they read the real machine's memory and GPU vendor, so they depend on the host. we're making them independent of the machine now, so they should stop bugging you.