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

Manually merged
github merged 1 commit from gh-pr/1807/head into gh-pr/1807/base 2026-11-26 23:34:32 +00:00
Owner

@⁠legacy-code-archaeologist on GitHub · 2026-11-24 19:01 UTC · original
legacy-code-archaeologist:shader/vop1-nops → main · +74 −0 · 4 files · 1 commits · merged 2026-11-24 19:19 UTC

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

**@⁠legacy-code-archaeologist** on GitHub · 2026-11-24 19:01 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1807) `legacy-code-archaeologist:shader/vop1-nops` → `main` · +74 −0 · 4 files · 1 commits · merged 2026-11-24 19:19 UTC 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)
v_clrexcp and v_pipeflush, and their VOP3 encodings v_clrexcp_e64 and
v_pipeflush_e64, are accepted as no-ops in the entry mask, like v_nop.
LLVM 15 decodes them identically for gfx1013 and gfx1030 and prints the
VOP3 form without a suffix. v_pipeflush flushes a VALU destination cache;
v_clrexcp clears the wave's exception state, which only s_getreg_b32 of
the trap status could observe, and pixel_aot lowers no such read. Any
other mask and any operand are refused.

The check inserts all four spellings after the sample wait of the
standard sampled program, where v12 to v15 are live. The HLSL must equal
the same program with v_nop in each place, the WQM-mask and operand
forms must be refused, and draw-vop1-nops draws it against the sampled
texture reference; a control that turns v_pipeflush into a write to v13
must report a pixel mismatch. The program joins the check_binary list.

Windows 11 26100: pixel_aot_vop1_nops_warp (WARP 10.0.26100.8972) and
_hardware (Quadro M1000M, 32.0.15.7371, debug layer unavailable) pass,
4096 pixels with zero error; the control mismatched. Full dev suite
without _hardware: 786/786. check_binary not run locally (no llvm-mc).

Refs #1791

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:34:30 +00:00
github manually merged commit 574f65faed into gh-pr/1807/base 2026-11-26 23:34:32 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 19:17 UTC · original · reviewed

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.

**@⁠tedin7** on GitHub · 2026-11-24 19:17 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1807#pullrequestreview-6045755043) · **reviewed** 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.