Add a minimal WaveReadLaneAt shuffle check at native and forced widths #150
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/151"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-21T17:33:06Z.
Change
Adds
wave_shuffle_warpandwave_shuffle_hardware, the minimal source-built shuffle requested in #145. It isolates theWaveReadLaneAt(v, (lane*7+3) % width)read from the wave64 BVH fixture.tests/wave_shuffle.hlslhas one 64-thread group. Each thread stores its native lane,WaveGetLaneCount(),WaveReadLaneFirst(t)as a wave id, and the group thread returned by the shuffle, a self-inverse mirror (width-1-lane) and a broadcast (3 % width).tests/wave_shuffle.cppmaps (wave, lane) to threads and classifies each shuffle result as correct, the exact inverse permutation, or other. It checks both controls and printsinverse_distinct: at width 8,7n+3 ≡ 3-nis self-inverse, so a reversal cannot be seen there.cs_6_5) and forced 16, 32 and 64 ([WaveSize],cs_6_6). Forced widths run only inside the adapter's lane range with SM 6.6. Any wrong lane fails the test. It skips when no forced width can run.cs_6_5, not 6.0, because the Windows 10 in-box WARP removes the device for a non-literal lane index (details in #145).bvh_reads_wavesmakes the same choice.Verification
Windows 10 22H2 (19045.6466), VS Build Tools 17.14, SDK 10.0.26100, on
245b207.inverse_distinct=no), forced 16, 32 and 64 each 64/64 inverse. Controls had 0 errors.Default full suite: 84 of 86 passed or skipped. The 2 failures are
reference_triangle_*because my local sample checkout has CRLF shaders, which is a separate fix. All other results matchmain.Evidence and follow-up
No external inputs, and the shader is original to this repository. If the CI runner's WARP supports a forced width, this test runs there and shows whether that WARP version has the same inversion. I have not seen the runner's lane range. Whether to report this to Microsoft, and whether
bvh_wave64_warpshould treat it as a known WARP result, stays open in #145.AI-assisted (Claude Code); built and run locally on the configurations above.