Repository navigation
Conversation
…irst When the hardware wave holds no more than the program wave, readfirstlane now reads x under if (active) with WaveReadLaneFirst and spreads it with WaveActiveMax, instead of WaveReadLaneAt at the ballot's lowest bit. The old form crashed AMD's compiler (RX 7800 XT, driver 32.0.32029.2010) inside CreatePipelineState on the decoration-baking mesh pipeline's pixel program, which reads the first lane seven times in a loop; the crash took the process at the eighth present of the story load. The group forms and a wider hardware wave keep the ballot form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SKtJsfjasPuTLtS3mEXFru
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The prelude's
readfirstlane(no wave emulation, no group wave) reads the first active lane withWaveReadLaneFirstinstead ofvw_read(x, firstbitlow(ballot)), i.e.WaveReadLaneAtwith a lane computed from a ballot. With EXEC empty it still reads lane 0, as before. Emulated and group-wave programs keep the old path.Why
On an RX 7800 XT (Adrenalin 32.0.32029.2010), the old pattern made the driver's shader compiler (amdxc64) crash in a story-load pixel program. I bisected the translated HLSL down to that one pattern:
readfirstlanethe program compiles and runs;vw_anyremoved it still crashes;WaveReadLaneFirstform runs.The result is the same: the first lane whose EXEC bit is set.
How I checked
dotnet test tests/FiveStar.Shaders.Tests: 320 passed, 12 skipped (the GPU cases coverv_readfirstlane_b32with partial EXEC).docs/shader-translation.mdnotes the AMD form next toreadfirstlane.🤖 Generated with Claude Code
https://claude.ai/code/session_01SKtJsfjasPuTLtS3mEXFru