shader: lower v_dot8_i32_i4 and v_dot8_u32_u4 in the direct compute path #3079

Manually merged
github merged 2 commits from github-bot/gh-3079 into gh-pr/3079/base 2026-11-27 18:07:42 +00:00 AGit
Owner

@⁠R0D4X on GitHub · 2026-11-27 14:32 UTC · original
R0D4X:feat/native-packed-dot8 → main · +198 −0 · 4 files · 2 commits · merged 2026-11-27 17:43 UTC

Fixes #3077. Refs #2935.

What this changes

  • Lowers gfx1013 VOP3P v_dot8_i32_i4 (0x18) and v_dot8_u32_u4 (0x19) in src/gfx1013_direct_compute.inl:
    • Extracts all eight 4-bit nibbles (signed via shl/ashr 28, unsigned via lshr/and 15), sums the eight products (always fits in i32), and either wraps modulo 2^32 or saturates the final accumulator addition via saturated_add when clamp is set.
    • Enforces canonical VOP3P OP_SEL/OP_SEL_HI and zero NEG_LO/NEG_HI, refusing other modifier encodings with unsupported packed nibble dot operand modifiers.

Tests & docs added

  • tests/native_packed_dot8_check.py & tests/cmake/native_packed_dot8.cmake: DXIL compile & disassembly controls, five modifier refusal encodings, and native_store_replay hardware dispatches (dense, sparse EXEC, and no-clamp negative control across 8 patterns x 4 forms = 2,048 words + 16 guards).
  • docs/experiments/native-packed-dot8.md: semantics and reproduction commands.

Verification

Commit: 6310d7e9 on Windows 11 x64 (10.0.26300.9974), MSVC 19.44.35230, Windows SDK & DXC 10.0.26100.0, NVIDIA GeForce RTX 5080 (10de:2c02, driver 32.0.16.2124), SM 6.6 wave32:

  • ctest --preset dev --no-tests=error -R '^native_packed_dot(2|4|8)_' -V: 6/6 passed, 0 skipped
    • native_packed_dot8_hardware: sparse=False and sparse=True matched 2048 result words and 16 guards; no-clamp control differed on 224 words.
  • ctest --preset release --no-tests=error -R '^native_packed_dot(2|4|8)_': 6/6 passed, 0 skipped
  • Repo checks (docs_links_check.py, bidi_controls_check.py, git diff --check): all passed.

Scope: Covers synthetic v_dot8_i32_i4 / v_dot8_u32_u4 wave32 compute fixtures through compile_dxil and native_store_replay; does not establish full-title startup or runtime execution.

**@⁠R0D4X** on GitHub · 2026-11-27 14:32 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3079) `R0D4X:feat/native-packed-dot8` → `main` · +198 −0 · 4 files · 2 commits · merged 2026-11-27 17:43 UTC Fixes #3077. Refs #2935. ## What this changes - Lowers gfx1013 VOP3P `v_dot8_i32_i4` (`0x18`) and `v_dot8_u32_u4` (`0x19`) in `src/gfx1013_direct_compute.inl`: - Extracts all eight 4-bit nibbles (signed via `shl`/`ashr 28`, unsigned via `lshr`/`and 15`), sums the eight products (always fits in `i32`), and either wraps modulo 2^32 or saturates the final accumulator addition via `saturated_add` when `clamp` is set. - Enforces canonical VOP3P `OP_SEL`/`OP_SEL_HI` and zero `NEG_LO`/`NEG_HI`, refusing other modifier encodings with `unsupported packed nibble dot operand modifiers`. ## Tests & docs added - `tests/native_packed_dot8_check.py` & `tests/cmake/native_packed_dot8.cmake`: DXIL compile & disassembly controls, five modifier refusal encodings, and `native_store_replay` hardware dispatches (dense, sparse `EXEC`, and no-clamp negative control across 8 patterns x 4 forms = 2,048 words + 16 guards). - `docs/experiments/native-packed-dot8.md`: semantics and reproduction commands. ## Verification Commit: `6310d7e9` on Windows 11 x64 (`10.0.26300.9974`), MSVC `19.44.35230`, Windows SDK & DXC `10.0.26100.0`, `NVIDIA GeForce RTX 5080` (`10de:2c02`, driver `32.0.16.2124`), SM 6.6 wave32: - `ctest --preset dev --no-tests=error -R '^native_packed_dot(2|4|8)_' -V`: 6/6 passed, 0 skipped - `native_packed_dot8_hardware`: `sparse=False` and `sparse=True` matched 2048 result words and 16 guards; no-clamp control differed on 224 words. - `ctest --preset release --no-tests=error -R '^native_packed_dot(2|4|8)_'`: 6/6 passed, 0 skipped - Repo checks (`docs_links_check.py`, `bidi_controls_check.py`, `git diff --check`): all passed. *Scope:* Covers synthetic `v_dot8_i32_i4` / `v_dot8_u32_u4` wave32 compute fixtures through `compile_dxil` and `native_store_replay`; does not establish full-title startup or runtime execution.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 14:36:24 +00:00
github-bot force-pushed github-bot/gh-3079 from 6310d7e999 to 35d01f598f 2026-11-27 16:21:49 +00:00 Compare
github-bot changed target branch from main to gh-pr/3079/base 2026-11-27 18:07:41 +00:00
github manually merged commit 69e8ae20ba into gh-pr/3079/base 2026-11-27 18:07:42 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-27 17:43 UTC · original · reviewed

Review of 69e8ae20ba (the change from 35d01f59, updated with main; the PR's own diff is unchanged).

Code: the lowering reads the eight nibbles of each word (signed with shl + ashr 28, unsigned with lshr + and 15), sums the eight products in i32 (range fits), and saturates only the final accumulator add when clamp is set. The modifier guard accepts only canonical OP_SEL/OP_SEL_HI with zero NEG_LO/NEG_HI; the five refused encodings in the controls cover op_sel, op_sel_hi and neg bits on both words. The CPU reference in the test is computed independently of the lowering, and the no-clamp and sparse-EXEC controls change the expected words. No other open PR covers these two opcodes in the direct compute path.

Windows Server 2025 (Build 26100, MSVC 14.44.35207, D3D12 WARP) at commit 69e8ae20:

  • dev: cmake --build --preset dev --target compile_dxil native_store_replay, then ctest --preset dev -R <native sweep>: 100% tests passed out of 126 (73 passed, 53 hardware legs skipped with 77)
  • release: cmake --build --preset release --target compile_dxil native_store_replay, then ctest --preset release -R <native sweep>: 100% tests passed out of 126 (73 passed, 53 skipped)
  • <native sweep> is every native_* test except native_startup_request_cache_hardware. That test fails the same way with and without this PR on a WARP-only host ("Shader wants wave lane count of 32 but maximum wave lane count for device is 4"); it comes from #2955 and is not related to this change.
  • native_packed_dot8_controls passed in both presets. native_packed_dot8_hardware skips on WARP (it needs a physical wave32 adapter), so the GPU readback rests on the RTX 5080 run in the PR description.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-27 17:43 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3079#pullrequestreview-6091684910) · **reviewed** Review of 69e8ae20ba85ff8b95d2d0ecb8939539a02919ea (the change from 35d01f59, updated with main; the PR's own diff is unchanged). Code: the lowering reads the eight nibbles of each word (signed with `shl` + `ashr 28`, unsigned with `lshr` + `and 15`), sums the eight products in i32 (range fits), and saturates only the final accumulator add when clamp is set. The modifier guard accepts only canonical OP_SEL/OP_SEL_HI with zero NEG_LO/NEG_HI; the five refused encodings in the controls cover op_sel, op_sel_hi and neg bits on both words. The CPU reference in the test is computed independently of the lowering, and the no-clamp and sparse-EXEC controls change the expected words. No other open PR covers these two opcodes in the direct compute path. Windows Server 2025 (Build 26100, MSVC 14.44.35207, D3D12 WARP) at commit `69e8ae20`: - dev: `cmake --build --preset dev --target compile_dxil native_store_replay`, then `ctest --preset dev -R <native sweep>`: 100% tests passed out of 126 (73 passed, 53 hardware legs skipped with 77) - release: `cmake --build --preset release --target compile_dxil native_store_replay`, then `ctest --preset release -R <native sweep>`: 100% tests passed out of 126 (73 passed, 53 skipped) - `<native sweep>` is every `native_*` test except `native_startup_request_cache_hardware`. That test fails the same way with and without this PR on a WARP-only host ("Shader wants wave lane count of 32 but maximum wave lane count for device is 4"); it comes from #2955 and is not related to this change. - `native_packed_dot8_controls` passed in both presets. `native_packed_dot8_hardware` skips on WARP (it needs a physical wave32 adapter), so the GPU readback rests on the RTX 5080 run in the PR description. AI-assisted; commands listed were executed locally.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-27 17:43 UTC · original

Windows Server 2025 verification of 69e8ae20ba85ff8b95d2d0ecb8939539a02919ea (D3D12 WARP, MSVC 14.44.35207):

  • dev: cmake --build --preset dev --target compile_dxil native_store_replay; ctest --preset dev -R <native sweep>: 100% tests passed out of 126 (73 passed, 53 hardware legs skipped)
  • release: cmake --build --preset release --target compile_dxil native_store_replay; ctest --preset release -R <native sweep>: 100% tests passed out of 126 (73 passed, 53 skipped)

<native sweep> = every native_* test except native_startup_request_cache_hardware, which fails on WARP-only hosts with or without this PR (details in the review above).

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-27 17:43 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3079#issuecomment-7224719712) Windows Server 2025 verification of `69e8ae20ba85ff8b95d2d0ecb8939539a02919ea` (D3D12 WARP, MSVC 14.44.35207): - dev: `cmake --build --preset dev --target compile_dxil native_store_replay`; `ctest --preset dev -R <native sweep>`: 100% tests passed out of 126 (73 passed, 53 hardware legs skipped) - release: `cmake --build --preset release --target compile_dxil native_store_replay`; `ctest --preset release -R <native sweep>`: 100% tests passed out of 126 (73 passed, 53 skipped) `<native sweep>` = every `native_*` test except `native_startup_request_cache_hardware`, which fails on WARP-only hosts with or without this PR (details in the review above). AI-assisted; commands listed were executed locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.