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

Merged
rasptum merged 1 commit from upstream-pr/272 into main 2026-11-21 19:58:31 +00:00
rasptum commented 2026-11-21 19:54:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-21T19:54:46Z.


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

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6533661788 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/272). Originally posted by [rasptum](https://github.com/rasptum) on 2026-11-21T19:54:46Z. --- ## 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)
upstream-sync closed this pull request 2026-11-24 06:42:10 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!268
No description provided.