shader: cover wave64 and wave32 #1132

Manually merged
github merged 2 commits from gh-pr/1132/head into gh-pr/1132/base 2026-11-26 22:44:09 +00:00
Owner

@⁠lambirou on GitHub · 2026-11-24 01:37 UTC · original
lambirou:shader/wave64-coverage → main · +284 −0 · 6 files · 2 commits · merged 2026-11-24 02:25 UTC

Change

Add a source-built wave-width fixture with native, wave32 and wave64 variants.

  • tests/shader_wave.hlsl records WaveGetLaneIndex, WaveGetLaneCount,
    WaveReadLaneFirst, WaveActiveSum, WaveActiveBallot, WaveActiveAllTrue,
    WaveActiveMin/Max and WaveActiveCountBits.
  • The oracle does not assume a width: it checks the lane count and index reported by the shader,
    ballot bits, min/max, sums and guard words.
  • Forced variants compile as cs_6_6 with [WaveSize(32)] and [WaveSize(64)]; DXC
    -dumpbin confirms the recorded WaveSize. Tests are registered for WARP and hardware.

Verification

  • cmake --build --preset dev --target offscreen_check passed.
  • ctest --preset dev --no-tests=error -R '^(wave|bvh_wave64|shader_wave)' -V
    • The XCL-17 cases: shader_wave_warp passes; shader_wave32_warp,
      shader_wave64_warp, the three hardware variants and the existing
      wave_shuffle/bvh_wave64 cases skip 77 with named reasons.
    • The pre-existing wave64_emulate_hardware test fails only because the sandbox exposes no
      adapter and that main test has no SKIP_RETURN_CODE; this PR does not change it. Its WARP
      case passes.
  • Hardware (interactive run): AMD Radeon RX 9060 XT, 1002/7590, driver 32.0.32029.2010,
    Windows 11 26H2 build 26300, debug layer unavailable, native lane range 32..64, native width 64.
    shader_wave_hardware passed native 64 (sum_ones=64, ballot
    ffffffff/ffffffff/00000000/00000000, sum_lanes=2016).
    shader_wave32_hardware passed native 64 then forced 32 (sum_ones=32, ballot
    ffffffff/00000000/00000000/00000000, sum_lanes=496).
    shader_wave64_hardware passed native 64 then forced 64.
  • WARP: Microsoft Basic Render Driver, 1414/008c, driver 10.0.26100.10068, lane range 4..4.
    Native shader_wave_warp passed width 4 (sum_ones=4, ballot
    0000000f/00000000/00000000/00000000, sum_lanes=6). Wave32 and wave64 WARP variants
    skip 77 with named reasons because the adapter cannot force 32/64 lanes. No width is fabricated.
  • A sandboxed post-rebase run exposed no hardware adapter, so its hardware cases skipped 77; the
    hardware results above are from the interactive run at the same commit content.
  • docs_links_check.py: Self-test passed., Checked 15 Markdown files and 253 links..
  • git diff --check origin/main...HEAD: clean.
  • Not run: full CTest, Python/CPU fixtures (no pe-env in this worktree), console hardware.

Evidence and follow-up

  • Branch shader/wave64-coverage, head 1f172a06 (maintainer merge of main), based on
    edee8d07. The merge keeps both the existing wave64_emulate block and the new
    shader_wave block.
  • Existing wave_shuffle and BVH wave64 tests remain green on hardware; WARP keeps its
    documented skips.
  • Boundary: this measures desktop WARP/RDNA4 wave behavior, not console wave widths. The debug
    layer is unavailable on both adapters, so no debug error count is claimed.
  • docs/experiments.md records the fixture, widths, CTests and skip reasons.
  • Provenance: source-built HLSL and public DXIL wave semantics. No XCL code, table or output is
    used.
  • No game files, dumps, shader bytes, title paths or secrets are included.

Checklist

  • One reviewable behavior: native/forced wave32/wave64 coverage.
  • Positive widths and named capability skips.
  • WARP and hardware results with adapter, driver, Windows build and debug-layer state.
  • No game files, dumps, logs or secrets.
  • Provenance checked; no XCL code used.
  • AI-assisted (Codex).
**@⁠lambirou** on GitHub · 2026-11-24 01:37 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1132) `lambirou:shader/wave64-coverage` → `main` · +284 −0 · 6 files · 2 commits · merged 2026-11-24 02:25 UTC ## Change Add a source-built wave-width fixture with native, wave32 and wave64 variants. - `tests/shader_wave.hlsl` records `WaveGetLaneIndex`, `WaveGetLaneCount`, `WaveReadLaneFirst`, `WaveActiveSum`, `WaveActiveBallot`, `WaveActiveAllTrue`, `WaveActiveMin/Max` and `WaveActiveCountBits`. - The oracle does not assume a width: it checks the lane count and index reported by the shader, ballot bits, min/max, sums and guard words. - Forced variants compile as `cs_6_6` with `[WaveSize(32)]` and `[WaveSize(64)]`; DXC `-dumpbin` confirms the recorded WaveSize. Tests are registered for WARP and hardware. ## Verification - `cmake --build --preset dev --target offscreen_check` passed. - `ctest --preset dev --no-tests=error -R '^(wave|bvh_wave64|shader_wave)' -V` - The XCL-17 cases: `shader_wave_warp` passes; `shader_wave32_warp`, `shader_wave64_warp`, the three hardware variants and the existing `wave_shuffle`/`bvh_wave64` cases skip 77 with named reasons. - The pre-existing `wave64_emulate_hardware` test fails only because the sandbox exposes no adapter and that main test has no `SKIP_RETURN_CODE`; this PR does not change it. Its WARP case passes. - Hardware (interactive run): AMD Radeon RX 9060 XT, 1002/7590, driver 32.0.32029.2010, Windows 11 26H2 build 26300, debug layer unavailable, native lane range 32..64, native width 64. `shader_wave_hardware` passed native 64 (`sum_ones=64`, ballot `ffffffff/ffffffff/00000000/00000000`, `sum_lanes=2016`). `shader_wave32_hardware` passed native 64 then forced 32 (`sum_ones=32`, ballot `ffffffff/00000000/00000000/00000000`, `sum_lanes=496`). `shader_wave64_hardware` passed native 64 then forced 64. - WARP: Microsoft Basic Render Driver, 1414/008c, driver 10.0.26100.10068, lane range 4..4. Native `shader_wave_warp` passed width 4 (`sum_ones=4`, ballot `0000000f/00000000/00000000/00000000`, `sum_lanes=6`). Wave32 and wave64 WARP variants skip 77 with named reasons because the adapter cannot force 32/64 lanes. No width is fabricated. - A sandboxed post-rebase run exposed no hardware adapter, so its hardware cases skipped 77; the hardware results above are from the interactive run at the same commit content. - `docs_links_check.py`: `Self-test passed.`, `Checked 15 Markdown files and 253 links.`. - `git diff --check origin/main...HEAD`: clean. - Not run: full CTest, Python/CPU fixtures (no pe-env in this worktree), console hardware. ## Evidence and follow-up - Branch `shader/wave64-coverage`, head `1f172a06` (maintainer merge of main), based on `edee8d07`. The merge keeps both the existing `wave64_emulate` block and the new `shader_wave` block. - Existing `wave_shuffle` and BVH wave64 tests remain green on hardware; WARP keeps its documented skips. - Boundary: this measures desktop WARP/RDNA4 wave behavior, not console wave widths. The debug layer is unavailable on both adapters, so no debug error count is claimed. - `docs/experiments.md` records the fixture, widths, CTests and skip reasons. - Provenance: source-built HLSL and public DXIL wave semantics. No XCL code, table or output is used. - No game files, dumps, shader bytes, title paths or secrets are included. ## Checklist - [x] One reviewable behavior: native/forced wave32/wave64 coverage. - [x] Positive widths and named capability skips. - [x] WARP and hardware results with adapter, driver, Windows build and debug-layer state. - [x] No game files, dumps, logs or secrets. - [x] Provenance checked; no XCL code used. - [x] AI-assisted (Codex).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:44:08 +00:00
github manually merged commit 1f172a0681 into gh-pr/1132/base 2026-11-26 22:44:09 +00:00
Author
Owner

@⁠lambirou on GitHub · 2026-11-24 01:53 UTC · original

Rebased onto edee8d07 and kept both the existing wave64_emulate block and the new shader_wave block. The six XCL-17 cases behave as documented; the pre-existing wave64_emulate_hardware fails only in the no-adapter sandbox because that main test has no SKIP_RETURN_CODE, unchanged by this PR. WARP shader_wave passes at width 4; hardware 64/32/64 results are from the interactive run.

**@⁠lambirou** on GitHub · 2026-11-24 01:53 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1132#issuecomment-7119548392) Rebased onto edee8d07 and kept both the existing wave64_emulate block and the new shader_wave block. The six XCL-17 cases behave as documented; the pre-existing wave64_emulate_hardware fails only in the no-adapter sandbox because that main test has no SKIP_RETURN_CODE, unchanged by this PR. WARP shader_wave passes at width 4; hardware 64/32/64 results are from the interactive run.
Author
Owner

@⁠lambirou on GitHub · 2026-11-24 01:54 UTC · original

Adopted 1f172a06. The maintainer merge keeps main plus both wave64_emulate and shader_wave blocks; the local branch is reset to that head. No force push.

**@⁠lambirou** on GitHub · 2026-11-24 01:54 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1132#issuecomment-7119561722) Adopted 1f172a06. The maintainer merge keeps main plus both wave64_emulate and shader_wave blocks; the local branch is reset to that head. No force push.
Author
Owner

@⁠Toons29 on GitHub · 2026-11-24 02:04 UTC · original

Tested 1f172a06 on an AMD Radeon RX 9070 (RDNA 4, 1002:7550), driver 32.0.32029.2010, Windows 11 build 26300, dev preset, debug layer unavailable: pass

ctest --preset dev --no-tests=error -R '^(wave|bvh_wave64|shader_wave)' -V

12 tests, now including wave64_emulate_ from main: 8 pass and 4 skip, with no failures. The adapter reports native_lane_range=32..64 and runs at native width 64.

Test Result
shader_wave_hardware native 64: sum_ones=64, ballot ffffffff/ffffffff/00000000/00000000, sum_lanes=2016, mismatches=0
shader_wave32_hardware native 64 as above, then forced 32: waves=2 sum_ones=32, ballot ffffffff/00000000/00000000/00000000, sum_lanes=496, mismatches=0
shader_wave64_hardware native 64, then forced 64, mismatches=0
wave_shuffle_hardware pass: native 64, forced 32 and 64 correct; forced 16 skipped
bvh_wave64_hardware pass: native_wave_width=64, mismatches=0
wave64_emulate_hardware native, skew control (64 of 448 reported) and forced 64 all as expected, wrong=0
shader_wave_warp, wave64_emulate_warp pass
shader_wave32_warp, shader_wave64_warp, wave_shuffle_warp, bvh_wave64_warp skipped (in-box WARP 10.0.26100.9818, width 4)

I first ran it at 2f580b01, before the main merge, and the wave readbacks are the same at both commits.

**@⁠Toons29** on GitHub · 2026-11-24 02:04 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1132#issuecomment-7119728076) Tested 1f172a06 on an AMD Radeon RX 9070 (RDNA 4, `1002:7550`), driver `32.0.32029.2010`, Windows 11 build 26300, `dev` preset, debug layer unavailable: pass ```powershell ctest --preset dev --no-tests=error -R '^(wave|bvh_wave64|shader_wave)' -V ``` 12 tests, now including `wave64_emulate_` from main: 8 pass and 4 skip, with no failures. The adapter reports `native_lane_range=32..64` and runs at native width 64. | Test | Result | |---|---| | `shader_wave_hardware` | native 64: `sum_ones=64`, ballot `ffffffff/ffffffff/00000000/00000000`, `sum_lanes=2016`, `mismatches=0` | | `shader_wave32_hardware` | native 64 as above, then forced 32: `waves=2 sum_ones=32`, ballot `ffffffff/00000000/00000000/00000000`, `sum_lanes=496`, `mismatches=0` | | `shader_wave64_hardware` | native 64, then forced 64, `mismatches=0` | | `wave_shuffle_hardware` | pass: native 64, forced 32 and 64 correct; forced 16 skipped | | `bvh_wave64_hardware` | pass: `native_wave_width=64`, `mismatches=0` | | `wave64_emulate_hardware` | native, skew control (64 of 448 reported) and forced 64 all as expected, `wrong=0` | | `shader_wave_warp`, `wave64_emulate_warp` | pass | | `shader_wave32_warp`, `shader_wave64_warp`, `wave_shuffle_warp`, `bvh_wave64_warp` | skipped (in-box WARP `10.0.26100.9818`, width 4) | I first ran it at 2f580b01, before the main merge, and the wave readbacks are the same at both commits.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 01:58 UTC · original · reviewed

Reviewed commit 1f172a06816809582f2e68eebcaf7fc446ac6b52 on Linux x86_64 (Python 3.14.8; Windows MSVC/DXC/WARP/hardware execution relies on CI).

Checks run:

  • python3 -B tests/gpu_report_format_check.py -> 10/10 OK

Diff notes:

  • tests/shader_wave.hlsl + tests/shader_wave.cpp: clean wave-width-agnostic validation (lane uniqueness, WaveActiveSum, WaveActiveBallot, WaveActiveAllTrue, WaveActiveMin/Max, WaveReadLaneFirst, WaveActiveCountBits, and guard words) with no hardcoded wave32/wave64 assumptions.
  • CMakeLists.txt + tests/offscreen_check.cpp: kGateShaderWave, kGateShaderWave32, and kGateShaderWave64 properly gate SM 6.0 / SM 6.6 + WaveOps + forced lane range with SKIP_RETURN_CODE 77, and docs/experiments.md documents the measured hardware/WARP runs.
**@⁠tedin7** on GitHub · 2026-11-24 01:58 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1132#pullrequestreview-6032495556) · **reviewed** Reviewed commit `1f172a06816809582f2e68eebcaf7fc446ac6b52` on Linux x86_64 (Python 3.14.8; Windows MSVC/DXC/WARP/hardware execution relies on CI). Checks run: - `python3 -B tests/gpu_report_format_check.py` -> 10/10 OK Diff notes: - `tests/shader_wave.hlsl` + `tests/shader_wave.cpp`: clean wave-width-agnostic validation (lane uniqueness, `WaveActiveSum`, `WaveActiveBallot`, `WaveActiveAllTrue`, `WaveActiveMin`/`Max`, `WaveReadLaneFirst`, `WaveActiveCountBits`, and guard words) with no hardcoded wave32/wave64 assumptions. - `CMakeLists.txt` + `tests/offscreen_check.cpp`: `kGateShaderWave`, `kGateShaderWave32`, and `kGateShaderWave64` properly gate SM 6.0 / SM 6.6 + `WaveOps` + forced lane range with `SKIP_RETURN_CODE 77`, and `docs/experiments.md` documents the measured hardware/WARP runs.
This discussion has been locked. Commenting is limited to contributors.
No description provided.