test(gpu): name the lane a wrong WaveReadLaneAt read came from #272

Manually merged
github merged 1 commit from gh-pr/272/head into gh-pr/272/base 2026-11-26 21:39:13 +00:00
Owner

@⁠rasptum on GitHub · 2026-11-21 19:54 UTC · original
rasptum:test/wave-shuffle-block-misroute → main · +49 −28 · 3 files · 1 commits · merged 2026-11-21 19:58 UTC

Change

wave_shuffle reported a wrong WaveReadLaneAt read on WARP 1.0.22 as the exact inverse of the requested shuffle (#145). That description is a coincidence of the one shuffle the fixture used. This PR makes the fixture name the lane each wrong read came from.

  • New read: a rotation, WaveReadLaneAt(t, (lane + 1) % width). It is not self-inverse at any width above 2, so WARP's native width of 8 is now an informative control.
  • New classification: inverse is replaced by block_misrouted. A wrong read counts as block_misrouted when it equals the lane a block-wise runtime returns if it picks the source block using the request of the wrong lane: the lane of the reader's block that sits at the requested position. The block size is the adapter's native width.
  • Unchanged: the pass condition. The test still fails on WARP 1.0.22, and the mismatch stays visible.

The shared interface is the wave_shuffle output line, which changes from one line per variant to three. Nothing in the tree parses it.

Refs #145.

Verification

Commit 8c9ee08 on main 7233cec. Windows 10 22H2 build 19045.6466, D3D12 debug layer on.

ctest --preset dev
  • Default build (in-box WARP 10.0.19041, RTX 3060 in-box runtime): 123/123. wave_shuffle_warp skips at SM 6.2 and wave_shuffle_hardware skips after the native variant passes, as on main.
  • Agility SDK 1.620.2 + WARP 1.0.22: 121/123. wave_shuffle_hardware passes. wave_shuffle_warp and bvh_wave64_warp fail, as on main.

offscreen_check warp --wave-shuffle on WARP 1.0.22 (driver=1.0.22.0, lanes 4..128), threads out of 64:

Variant Affine 7n+3 Rotation n+1 Controls
native 8 64 correct 64 correct 0 errors
forced 16 0 correct, 64 block_misrouted, 0 other 48 correct, 16 block_misrouted, 0 other 0 errors
forced 32 0 correct, 64 block_misrouted, 0 other 48 correct, 16 block_misrouted, 0 other 0 errors
forced 64 0 correct, 64 block_misrouted, 0 other 48 correct, 16 block_misrouted, 0 other 0 errors

RTX 3060 (driver 32.0.15.9636, lanes 32..32): native 32 and forced 32 are 64 correct for both shuffles, 0 control errors. Forced 16 and 64 skip on the lane range.

Evidence and follow-up

  • How the rule was found. A local probe (not committed) replaced the shuffle index with eight expressions and dumped the source lane of every read at widths 8, 16, 32 and 64. I derived the rule from four of them and then ran the other four as predictions. It matched all 952 defined lane reads. The inverse matched none of the rotation or 5n+2 reads and 40 of 64 for 3n at width 64.
  • What the rule says. With lane l in block b requesting index i, WARP 1.0.22 returns the lane at position i % 8 of block req(8b + i % 8) / 8, where req is the request of another lane of the reader's block. Reads are correct whenever all lanes of a block request the same source block, which is why the mirror, the broadcast, lane / 2, lane & ~1 and lane ^ 9 pass.
  • Assumption. The rule is inferred from readbacks. I did not inspect WARP. It was measured on one CPU, where WARP's native width is 8.
  • Negative control. The RTX 3060 runs the same forced-32 shader and reports 0 block_misrouted.
  • Follow-up for anyone. bvh_wave64_warp fails for the same reason. Whether it should skip by a measured property on adapters that misroute is a maintainer decision and is not part of this PR.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed. (docs/experiments.md now describes the rule.)
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted (Claude Code). The Windows results were measured locally.

🤖 Generated with Claude Code

**@⁠rasptum** on GitHub · 2026-11-21 19:54 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/272) `rasptum:test/wave-shuffle-block-misroute` → `main` · +49 −28 · 3 files · 1 commits · merged 2026-11-21 19:58 UTC ## Change `wave_shuffle` reported a wrong `WaveReadLaneAt` read on WARP 1.0.22 as the exact inverse of the requested shuffle (#145). That description is a coincidence of the one shuffle the fixture used. This PR makes the fixture name the lane each wrong read came from. - **New read:** a rotation, `WaveReadLaneAt(t, (lane + 1) % width)`. It is not self-inverse at any width above 2, so WARP's native width of 8 is now an informative control. - **New classification:** `inverse` is replaced by `block_misrouted`. A wrong read counts as `block_misrouted` when it equals the lane a block-wise runtime returns if it picks the source block using the request of the wrong lane: the lane of the reader's block that sits at the requested position. The block size is the adapter's native width. - **Unchanged:** the pass condition. The test still fails on WARP 1.0.22, and the mismatch stays visible. The shared interface is the `wave_shuffle` output line, which changes from one line per variant to three. Nothing in the tree parses it. Refs #145. ## Verification Commit `8c9ee08` on `main` `7233cec`. Windows 10 22H2 build 19045.6466, D3D12 debug layer on. ```powershell ctest --preset dev ``` - **Default build (in-box WARP 10.0.19041, RTX 3060 in-box runtime):** 123/123. `wave_shuffle_warp` skips at SM 6.2 and `wave_shuffle_hardware` skips after the native variant passes, as on `main`. - **Agility SDK 1.620.2 + WARP 1.0.22:** 121/123. `wave_shuffle_hardware` passes. `wave_shuffle_warp` and `bvh_wave64_warp` fail, as on `main`. `offscreen_check warp --wave-shuffle` on WARP 1.0.22 (`driver=1.0.22.0`, lanes 4..128), threads out of 64: | Variant | Affine `7n+3` | Rotation `n+1` | Controls | |---|---|---|---| | native 8 | 64 correct | 64 correct | 0 errors | | forced 16 | 0 correct, 64 `block_misrouted`, 0 other | 48 correct, 16 `block_misrouted`, 0 other | 0 errors | | forced 32 | 0 correct, 64 `block_misrouted`, 0 other | 48 correct, 16 `block_misrouted`, 0 other | 0 errors | | forced 64 | 0 correct, 64 `block_misrouted`, 0 other | 48 correct, 16 `block_misrouted`, 0 other | 0 errors | RTX 3060 (driver 32.0.15.9636, lanes 32..32): native 32 and forced 32 are 64 correct for both shuffles, 0 control errors. Forced 16 and 64 skip on the lane range. ## Evidence and follow-up - **How the rule was found.** A local probe (not committed) replaced the shuffle index with eight expressions and dumped the source lane of every read at widths 8, 16, 32 and 64. I derived the rule from four of them and then ran the other four as predictions. It matched all 952 defined lane reads. The inverse matched none of the rotation or `5n+2` reads and 40 of 64 for `3n` at width 64. - **What the rule says.** With lane `l` in block `b` requesting index `i`, WARP 1.0.22 returns the lane at position `i % 8` of block `req(8b + i % 8) / 8`, where `req` is the request of another lane of the reader's block. Reads are correct whenever all lanes of a block request the same source block, which is why the mirror, the broadcast, `lane / 2`, `lane & ~1` and `lane ^ 9` pass. - **Assumption.** The rule is inferred from readbacks. I did not inspect WARP. It was measured on one CPU, where WARP's native width is 8. - **Negative control.** The RTX 3060 runs the same forced-32 shader and reports 0 `block_misrouted`. - **Follow-up for anyone.** `bvh_wave64_warp` fails for the same reason. Whether it should skip by a measured property on adapters that misroute is a maintainer decision and is not part of this PR. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. (`docs/experiments.md` now describes the rule.) - [x] I did not include game files, dumps, distribution links or secrets. _AI-assisted (Claude Code). The Windows results were measured locally._ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
wave_shuffle classified a wrong read as the exact inverse of the affine
shuffle. A rotation by one lane shows that is a coincidence: WARP 1.0.22
gets 16 of 64 rotation reads wrong at forced widths 16, 32 and 64, and none
match the inverse.

The fixture now also reads a rotation and compares every wrong read with
the lane a block-wise runtime returns when it picks the source block with
the request of the lane at the requested position. That matches every
wrong read on WARP 1.0.22 with blocks of its native 8 lanes. The test
still fails on that adapter.

Refs #145.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:39:11 +00:00
github manually merged commit 8c9ee0865c into gh-pr/272/base 2026-11-26 21:39:13 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.