shader: lower guarded compute v_mul_lo_u32 #902

Merged
Jess-Doit merged 1 commit from upstream-pr/909 into main 2026-11-23 17:02:50 +00:00
Jess-Doit commented 2026-11-23 16:48:16 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-23T16:48:16Z.


Change

Refs #721. Lower unmodified gfx1013 v_mul_lo_u32 on known data words in the compute-store profile using the pixel translator's unsigned multiply expression.

The source-built fixture reads t0, multiplies by a constant-buffer word, and stores the low 32 bits to u0 under the lane guard. It covers wraparound and high bits in both operands. Each of the three dispatches checks all 320 words. Stale references truncate each operand individually or change the first inactive lane. Translation checks reject an unknown source and an instruction modifier.

Verification

Tested cc09358 on Windows 10 22H2 (19045), MSVC 19.44, and Windows SDK DXC. The new fixture failed on the base revision at the unsupported v_mul_lo_u32 instruction. It passed on GTX 1060 6 GB (32.0.15.6094) and in-box WARP (10.0.19041.5794) in Debug and Release, and on app-local WARP (1.0.22 with Agility 1.620.2) in Debug. Passing draws logged zero D3D12 warnings or errors. No capability skips.

Both truncation controls differed at word 0 (actual 0x9207f7d3). The inactive-lane control differed at word 150 (actual 0xc5c5c5c5). The existing Release hardware store test timed out in the first run and passed in 28.32 seconds on a serial rerun.

ctest --preset dev --no-tests=error -R '^(compute_store_aot_(guard_read_)?(hardware|warp)|docs_links)$' -V
ctest --preset release --no-tests=error -R '^(compute_store_aot_(guard_read_)?(hardware|warp)|docs_links)$' -V
ctest --preset release --no-tests=error -R '^compute_store_aot_hardware$' -V
ctest --test-dir out/build/app-local --no-tests=error -R '^compute_store_aot_guard_read_warp$' -V
python -B tests/bidi_controls_check.py
git diff --check

Evidence and follow-up

The fixture is original MIT-licensed assembly adapted from #835's guarded read-compute-write test. The README links to the test and its reference values.

The local AMDGPU-enabled LLVM 23.1.6 CLI assembled and decoded 108 bytes. Lowering the decoded instructions reproduced the same HLSL as the assembly source path. Upstream CI will run the full LLVM 15 binary check.

A merge simulation with upstream main at 02db28b was clean. That revision includes the separate LDS operations from #898.

Checklist

  • One reviewable behavior.
  • Test commands and results included.
  • Negative controls included.
  • README and experiment notes updated.
  • Source-built inputs only.

AI-assisted (Codex).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6564227555 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/909). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-11-23T16:48:16Z. --- ## Change Refs #721. Lower unmodified gfx1013 `v_mul_lo_u32` on known data words in the compute-store profile using the pixel translator's unsigned multiply expression. The source-built fixture reads t0, multiplies by a constant-buffer word, and stores the low 32 bits to u0 under the lane guard. It covers wraparound and high bits in both operands. Each of the three dispatches checks all 320 words. Stale references truncate each operand individually or change the first inactive lane. Translation checks reject an unknown source and an instruction modifier. ## Verification Tested `cc09358` on Windows 10 22H2 (19045), MSVC 19.44, and Windows SDK DXC. The new fixture failed on the base revision at the unsupported `v_mul_lo_u32` instruction. It passed on GTX 1060 6 GB (32.0.15.6094) and in-box WARP (10.0.19041.5794) in Debug and Release, and on app-local WARP (1.0.22 with Agility 1.620.2) in Debug. Passing draws logged zero D3D12 warnings or errors. No capability skips. Both truncation controls differed at word 0 (actual `0x9207f7d3`). The inactive-lane control differed at word 150 (actual `0xc5c5c5c5`). The existing Release hardware store test timed out in the first run and passed in 28.32 seconds on a serial rerun. ```powershell ctest --preset dev --no-tests=error -R '^(compute_store_aot_(guard_read_)?(hardware|warp)|docs_links)$' -V ctest --preset release --no-tests=error -R '^(compute_store_aot_(guard_read_)?(hardware|warp)|docs_links)$' -V ctest --preset release --no-tests=error -R '^compute_store_aot_hardware$' -V ctest --test-dir out/build/app-local --no-tests=error -R '^compute_store_aot_guard_read_warp$' -V python -B tests/bidi_controls_check.py git diff --check ``` ## Evidence and follow-up The fixture is original MIT-licensed assembly adapted from #835's guarded read-compute-write test. The README links to the test and its reference values. The local AMDGPU-enabled LLVM 23.1.6 CLI assembled and decoded 108 bytes. Lowering the decoded instructions reproduced the same HLSL as the assembly source path. Upstream CI will run the full LLVM 15 binary check. A merge simulation with upstream main at `02db28b` was clean. That revision includes the separate LDS operations from #898. ## Checklist - [x] One reviewable behavior. - [x] Test commands and results included. - [x] Negative controls included. - [x] README and experiment notes updated. - [x] Source-built inputs only. AI-assisted (Codex).
upstream-sync closed this pull request 2026-11-24 06:45:21 +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!902
No description provided.