shader: accept v_clrexcp and v_pipeflush as no-ops in pixel_aot #1800

Merged
legacy-code-archaeologist merged 1 commit from upstream-pr/1807 into main 2026-11-24 19:19:23 +00:00
legacy-code-archaeologist commented 2026-11-24 19:01:09 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-24T19:01:09Z.


Refs #1791

What

tools/pixel_aot.py accepts v_clrexcp and v_pipeflush, and their VOP3 encodings v_clrexcp_e64 and v_pipeflush_e64, as no-ops in the entry mask. This works exactly like v_nop/v_nop_e64. Any other mask and any operand are refused.

  • LLVM 15 decodes both identically for gfx1013 and gfx1030, and prints the VOP3 form without a suffix: 7e008200 and d5c10000 00000000 are v_clrexcp; 7e003600 and d59b0000 00000000 are v_pipeflush.
  • v_pipeflush flushes a VALU destination cache.
  • v_clrexcp clears the wave's exception state. Only s_getreg_b32 of the trap status could observe that, and pixel_aot lowers no such read. #1777 added s_getreg_b32 for the MODE rounding field only.

Evidence

The check puts all four spellings after the sample wait of the standard sampled program, where v12 to v15 are live (vop1_nop_program).

  • Static (check_vop1_nop_lowering, run from the no-argument controls):
    • the HLSL must equal the same program with v_nop in each place;
    • each spelling in the WQM mask must be refused with the non-entry-mask message;
    • forms with operands must be refused as unsupported instructions.
  • Draw (pixel_aot_vop1_nops_{warp,hardware}): the program is drawn against the sampled texture reference. A control that turns v_pipeflush into v_mov_b32_e32 v13, 0 must report a pixel mismatch.
  • The program joins the check_binary list.

Windows 11 Pro 26100.9168, DXC 10.0.26100, debug layer unavailable, commit 574f65fa on ecc6e6ce:

ctest --preset dev --no-tests=error -R "^pixel_aot_vop1_nops_" -V
Adapter Driver Result
WARP 10.0.26100.8972 4096 pixels, max error 0; control mismatched
NVIDIA Quadro M1000M 32.0.15.7371 same

Other runs:

  • pixel_aot_e64_spellings_{warp,hardware} still pass.
  • python -B tests/pixel_aot_check.py (controls) exits 0.
  • Full ctest --preset dev -E '_hardware$': 786/786.
  • After the rebase onto #1777, the no-op tests and the controls were rerun and pass.
  • tools/form_coverage.py --gaps gfx1030 no longer lists v_clrexcp, v_clrexcp_e64, v_pipeflush or v_pipeflush_e64.

Not run locally: tests/pixel_aot_check.py binary, because there is no llvm-mc here. Whether LLVM 15 assembles the _e64 spellings is left to the Ubuntu job; v_nop_e64 is the precedent.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6589224717 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1807). Originally posted by [legacy-code-archaeologist](https://github.com/legacy-code-archaeologist) on 2026-11-24T19:01:09Z. --- Refs #1791 ## What `tools/pixel_aot.py` accepts `v_clrexcp` and `v_pipeflush`, and their VOP3 encodings `v_clrexcp_e64` and `v_pipeflush_e64`, as no-ops in the entry mask. This works exactly like `v_nop`/`v_nop_e64`. Any other mask and any operand are refused. - LLVM 15 decodes both identically for gfx1013 and gfx1030, and prints the VOP3 form without a suffix: `7e008200` and `d5c10000 00000000` are `v_clrexcp`; `7e003600` and `d59b0000 00000000` are `v_pipeflush`. - `v_pipeflush` flushes a VALU destination cache. - `v_clrexcp` clears the wave's exception state. Only `s_getreg_b32` of the trap status could observe that, and `pixel_aot` lowers no such read. #1777 added `s_getreg_b32` for the MODE rounding field only. ## Evidence The check puts all four spellings after the sample wait of the standard sampled program, where v12 to v15 are live (`vop1_nop_program`). - **Static** (`check_vop1_nop_lowering`, run from the no-argument controls): - the HLSL must equal the same program with `v_nop` in each place; - each spelling in the WQM mask must be refused with the non-entry-mask message; - forms with operands must be refused as unsupported instructions. - **Draw** (`pixel_aot_vop1_nops_{warp,hardware}`): the program is drawn against the sampled texture reference. A control that turns `v_pipeflush` into `v_mov_b32_e32 v13, 0` must report a pixel mismatch. - The program joins the `check_binary` list. Windows 11 Pro 26100.9168, DXC 10.0.26100, debug layer unavailable, commit 574f65fa on ecc6e6ce: ``` ctest --preset dev --no-tests=error -R "^pixel_aot_vop1_nops_" -V ``` | Adapter | Driver | Result | |---|---|---| | WARP | 10.0.26100.8972 | 4096 pixels, max error 0; control mismatched | | NVIDIA Quadro M1000M | 32.0.15.7371 | same | **Other runs:** - `pixel_aot_e64_spellings_{warp,hardware}` still pass. - `python -B tests/pixel_aot_check.py` (controls) exits 0. - Full `ctest --preset dev -E '_hardware$'`: 786/786. - After the rebase onto #1777, the no-op tests and the controls were rerun and pass. - `tools/form_coverage.py --gaps gfx1030` no longer lists `v_clrexcp`, `v_clrexcp_e64`, `v_pipeflush` or `v_pipeflush_e64`. **Not run locally:** `tests/pixel_aot_check.py binary`, because there is no `llvm-mc` here. Whether LLVM 15 assembles the `_e64` spellings is left to the Ubuntu job; `v_nop_e64` is the precedent. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
upstream-sync closed this pull request 2026-11-24 20:00:42 +00:00
tedin7 commented 2026-11-24 20:00:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T19:17:22Z.

Review: COMMENTED


Verified commit 574f65faed6e92a4d168ed96380317e15974e1d2 (shader: accept v_clrexcp and v_pipeflush as no-ops in pixel_aot). No defects found.

Diff & ISA review

  • tools/pixel_aot.py: accepts v_clrexcp, v_clrexcp_e64, v_pipeflush, and v_pipeflush_e64 as exact no-op lines in the entry mask before export, matching v_nop/v_nop_e64. Non-entry masks raise ValueError, post-export placement is rejected, and any operands/modifiers/SDWA/DPP forms fall through to Unsupported instruction.
  • tools/disasm_rdna2.py: verified VOP1 and VOP3A encodings (7e008200, d5c10000 00000000, 7e003600, d59b0000 00000000) decode cleanly as operandless instructions for both gfx1013 and gfx1030 via llvm-mc-19 and disasm_rdna2.decode_instruction.
  • tests/pixel_aot_check.py & CMakeLists.txt: static HLSL equivalence with v_nop, non-entry mask and operand refusal checks, check_binary fixture, and pixel_aot_vop1_nops_{warp,hardware} draw test with v_pipeflush -> v_mov_b32_e32 v13, 0 negative control. Clean-room documentation in docs/experiments.md.

Commands executed locally

  • Linux:
    • git diff --check origin/main...HEAD -> pass
    • python -B tests/docs_links_check.py -> pass (17 Markdown files, 368 links)
    • python -B tests/bidi_controls_check.py -> pass (1313 tracked files)
    • python -B tests/pixel_aot_check.py -> pass
    • python -B tests/rdna2_tools_check.py -> pass (148 tests, 18 skipped)
    • python -B tests/form_coverage_check.py -> pass
    • llvm-mc-19 / llvm-objcopy-19 / libLLVM-19.so binary round-trip of vop1_nop_program() on gfx1013 and gfx1030 -> pass (120 bytes, 25 insns each, HLSL matches)
  • Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
    • Debug (--preset dev): cmake --build --preset dev --target offscreen_check -- -j 8 + ctest --preset dev -R '^(pixel_aot_vop1_nops_warp|pixel_aot_e64_spellings_warp|pixel_aot_warp|rdna2_tools_check)$' --parallel 6 --no-tests=error --output-on-failure -> 4/4 passed (pixel_aot_vop1_nops_warp 2.21s, pixel_aot_e64_spellings_warp 4.80s, rdna2_tools_check 11.26s, pixel_aot_warp 16.41s)
    • Release /O2 (--preset release): cmake --build --preset release --target offscreen_check -- -j 8 + ctest --preset release -R '^(pixel_aot_vop1_nops_warp|pixel_aot_e64_spellings_warp|pixel_aot_warp|rdna2_tools_check)$' --parallel 6 --no-tests=error --output-on-failure -> 4/4 passed (pixel_aot_vop1_nops_warp 2.63s, pixel_aot_e64_spellings_warp 5.40s, rdna2_tools_check 12.83s, pixel_aot_warp 17.22s)
    • Windows Python checks (pixel_aot_check.py, rdna2_tools_check.py, form_coverage_check.py, docs_links_check.py, bidi_controls_check.py) -> all pass
  • Local mutation checks on tools/pixel_aot.py (restored via git checkout -- .):
    • Dropped "v_pipeflush" from accepted tuple -> tests/pixel_aot_check.py failed (rc=1)
    • Removed if mask != "entry" guard -> tests/pixel_aot_check.py failed (rc=1)

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6045755043 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1807#pullrequestreview-6045755043). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T19:17:22Z. **Review:** COMMENTED --- Verified commit `574f65faed6e92a4d168ed96380317e15974e1d2` (`shader: accept v_clrexcp and v_pipeflush as no-ops in pixel_aot`). No defects found. ### Diff & ISA review - `tools/pixel_aot.py`: accepts `v_clrexcp`, `v_clrexcp_e64`, `v_pipeflush`, and `v_pipeflush_e64` as exact no-op lines in the entry mask before export, matching `v_nop`/`v_nop_e64`. Non-entry masks raise `ValueError`, post-export placement is rejected, and any operands/modifiers/SDWA/DPP forms fall through to `Unsupported instruction`. - `tools/disasm_rdna2.py`: verified VOP1 and VOP3A encodings (`7e008200`, `d5c10000 00000000`, `7e003600`, `d59b0000 00000000`) decode cleanly as operandless instructions for both `gfx1013` and `gfx1030` via `llvm-mc-19` and `disasm_rdna2.decode_instruction`. - `tests/pixel_aot_check.py` & `CMakeLists.txt`: static HLSL equivalence with `v_nop`, non-entry mask and operand refusal checks, `check_binary` fixture, and `pixel_aot_vop1_nops_{warp,hardware}` draw test with `v_pipeflush` -> `v_mov_b32_e32 v13, 0` negative control. Clean-room documentation in `docs/experiments.md`. ### Commands executed locally - Linux: - `git diff --check origin/main...HEAD` -> pass - `python -B tests/docs_links_check.py` -> pass (17 Markdown files, 368 links) - `python -B tests/bidi_controls_check.py` -> pass (1313 tracked files) - `python -B tests/pixel_aot_check.py` -> pass - `python -B tests/rdna2_tools_check.py` -> pass (148 tests, 18 skipped) - `python -B tests/form_coverage_check.py` -> pass - `llvm-mc-19` / `llvm-objcopy-19` / `libLLVM-19.so` binary round-trip of `vop1_nop_program()` on `gfx1013` and `gfx1030` -> pass (120 bytes, 25 insns each, HLSL matches) - Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP): - Debug (`--preset dev`): `cmake --build --preset dev --target offscreen_check -- -j 8` + `ctest --preset dev -R '^(pixel_aot_vop1_nops_warp|pixel_aot_e64_spellings_warp|pixel_aot_warp|rdna2_tools_check)$' --parallel 6 --no-tests=error --output-on-failure` -> **4/4 passed** (`pixel_aot_vop1_nops_warp` 2.21s, `pixel_aot_e64_spellings_warp` 4.80s, `rdna2_tools_check` 11.26s, `pixel_aot_warp` 16.41s) - Release `/O2` (`--preset release`): `cmake --build --preset release --target offscreen_check -- -j 8` + `ctest --preset release -R '^(pixel_aot_vop1_nops_warp|pixel_aot_e64_spellings_warp|pixel_aot_warp|rdna2_tools_check)$' --parallel 6 --no-tests=error --output-on-failure` -> **4/4 passed** (`pixel_aot_vop1_nops_warp` 2.63s, `pixel_aot_e64_spellings_warp` 5.40s, `rdna2_tools_check` 12.83s, `pixel_aot_warp` 17.22s) - Windows Python checks (`pixel_aot_check.py`, `rdna2_tools_check.py`, `form_coverage_check.py`, `docs_links_check.py`, `bidi_controls_check.py`) -> all pass - Local mutation checks on `tools/pixel_aot.py` (restored via `git checkout -- .`): - Dropped `"v_pipeflush"` from accepted tuple -> `tests/pixel_aot_check.py` failed (rc=1) - Removed `if mask != "entry"` guard -> `tests/pixel_aot_check.py` failed (rc=1) AI-assisted; commands listed were executed locally.
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!1800
No description provided.