Repository navigation
Conversation
guialmm
force-pushed
the
fix/readfirstlane-wide-hardware-wave
branch
from
November 26, 2026 17:44
496df04 to
8c6dd3b
Compare
…es holding more than four On a hardware wave wider than the program wave, readfirstlane took one WaveActiveMax over a uint4, one component per program wave, which covers at most four program waves. A 32-lane NVIDIA wave holds 16 two-lane or 8 four-lane test waves, so every wave past the fourth read the same value (WaveEmulationTests, wave 2 and 4 without group lanes, from ThatRecompDev#9). The same max now repeats four program waves at a time up to WaveGetLaneCount() / VW_WAVE; console waves (32 or 64 lanes) still take a single max.
guialmm
force-pushed
the
fix/readfirstlane-wide-hardware-wave
branch
from
November 26, 2026 18:05
8c6dd3b to
598e8cb
Compare
Owner
|
nice catch on the uint4 only covering four program waves, the fix reads clean. ran it here on WARP together with our next translator changes and the whole shader suite passes (583, 0 failed). since it changes translation output we'll land it together with that batch so testers only re-translate once, should be soon |
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.
On a real GPU,
WaveEmulationTests.Wave_operations_see_the_console_wavefails forwave: 2andwave: 4withgroupLanes: False: only the last column (readfirstlane(x, c)) is wrong, and every thread from the fourth program wave on reads the same value. This is the "WaveEmulation wave 2 and 4 with groupLanes False, last column wrong" item from the RTX 3070 run in #9.Why. On a hardware wave wider than the program wave,
readfirstlaneinrdna_prelude.hlslitakes oneWaveActiveMaxover auint4, one component per program wave, and the comment there assumes at most four program waves (128 lanes, or WARP's 4 lanes for test waves). A 32-lane NVIDIA wave holds 16 two-lane or 8 four-lane test waves, so waves 3 and up all land in.wand read the max over all of them. With two-lane waves that is thread 6's value (6·7+3 = 45), with four-lane waves thread 12's (87), which is what the test prints.Change. The same max, four program waves per
WaveActiveMax, repeated until it coversWaveGetLaneCount() / VW_WAVEwaves. The loop is unrolled with a constant bound (128 / VW_WAVE) and each step is behind a wave-uniform test, so for console waves (32 or 64 lanes) only the first step runs, as one max like before. Only this function changes.Checked on an RTX 3060 (12 GB, driver 32.0.16.1714), Windows 11:
dotnet build FiveStar.slnx: no warnings.FIVESTAR_TEST_ADAPTER=hardware,WaveEmulationTests, same build with and without the change: 2 failed, 14 passed before; 16 passed after.FIVESTAR_TEST_ADAPTER=hardware, whole shader project (without the three cases that hang NVIDIA in Shader cases on an RTX 5070: 21 of 284 differ from WARP, two of them a mesh hang #9): 30 failures before, 28 after. The 28 left are the other open items from Shader cases on an RTX 5070: 21 of 284 differ from WARP, two of them a mesh hang #9 (buffer-bounds E_OUTOFMEMORY, root-descriptor fallback, integer gathers, StageProbe); none is new.dotnet test FiveStar.slnx, 0 failed (shaders: 550 passed, 14 skipped, as on main).AI-assisted (Claude Code, Claude Opus 5.5): found the cause, wrote the change and ran the tests above on my machine.
🤖 Generated with Claude Code