tests: pin the SDWA v_movrel* selections without a GPU #1979

Manually merged
github merged 1 commit from gh-pr/1979/head into gh-pr/1979/base 2026-11-26 23:47:17 +00:00
Owner

@⁠legacy-code-archaeologist on GitHub · 2026-11-24 22:31 UTC · original
legacy-code-archaeologist:tests/sdwa-movrel-pins → main · +34 −1 · 2 files · 1 commits · merged 2026-11-24 22:49 UTC

Follow-up to @⁠ChazY11's review of #1934 (Refs #1917). Tests and docs only; tools/pixel_aot.py is unchanged.

What

The device-free pixel_aot_check.py run only asserted that SDWA_MOVREL_BODY translates. That is why replacing the sdwa_source(...) call with pass still passed it; the GPU draw caught it.

SDWA_MOVREL_PINS now lists the exact expression each source and destination selection of the body produces, with temporaries as \d+, and how often it must appear: once per static move, once per reachable destination of a dynamic one. check_sdwa_movrel_pins runs from the no-argument controls.

The pins cover:

  • R: BYTE_3 into WORD_1/PRESERVE; sext(BYTE_1) into BYTE_0/PRESERVE.
  • G: sext(BYTE_2) into WORD_0/PRESERVE, 4×; WORD_1 into BYTE_3/PAD.
  • B: WORD_0 into BYTE_2/PRESERVE, 4×; sext(BYTE_0) into DWORD/PAD.
  • A: WORD_0 into WORD_1/PRESERVE, 4×; BYTE_3 into BYTE_0/PAD.

Evidence

I applied each mutation to tools/pixel_aot.py on its own and ran python -B tests/pixel_aot_check.py with no arguments, which needs no GPU. The file is restored after each run.

Mutation Exit code
sdwa_source(...) replaced by pass (the reported survivor) 1
sext ignored (sdwa_source(..., False)) 1
single-destination sdwa_dest(...) replaced by pass 1
dynamic-destination sdwa_dest(...) dropped 1
dynamic UNUSED_PRESERVE treated as UNUSED_PAD 1

Without a mutation, the run exits 0. Windows 11 Pro 26100.9168, commit 2e5fdca4. tests/form_coverage_check.py and tests/docs_links_check.py pass.

🤖 Generated with Claude Code

**@⁠legacy-code-archaeologist** on GitHub · 2026-11-24 22:31 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1979) `legacy-code-archaeologist:tests/sdwa-movrel-pins` → `main` · +34 −1 · 2 files · 1 commits · merged 2026-11-24 22:49 UTC Follow-up to @⁠ChazY11's review of #1934 (Refs #1917). Tests and docs only; `tools/pixel_aot.py` is unchanged. ## What The device-free `pixel_aot_check.py` run only asserted that `SDWA_MOVREL_BODY` translates. That is why replacing the `sdwa_source(...)` call with `pass` still passed it; the GPU draw caught it. `SDWA_MOVREL_PINS` now lists the exact expression each source and destination selection of the body produces, with temporaries as `\d+`, and how often it must appear: once per static move, once per reachable destination of a dynamic one. `check_sdwa_movrel_pins` runs from the no-argument controls. The pins cover: - **R:** BYTE_3 into WORD_1/PRESERVE; sext(BYTE_1) into BYTE_0/PRESERVE. - **G:** sext(BYTE_2) into WORD_0/PRESERVE, 4×; WORD_1 into BYTE_3/PAD. - **B:** WORD_0 into BYTE_2/PRESERVE, 4×; sext(BYTE_0) into DWORD/PAD. - **A:** WORD_0 into WORD_1/PRESERVE, 4×; BYTE_3 into BYTE_0/PAD. ## Evidence I applied each mutation to `tools/pixel_aot.py` on its own and ran `python -B tests/pixel_aot_check.py` with no arguments, which needs no GPU. The file is restored after each run. | Mutation | Exit code | |---|---| | `sdwa_source(...)` replaced by `pass` (the reported survivor) | 1 | | `sext` ignored (`sdwa_source(..., False)`) | 1 | | single-destination `sdwa_dest(...)` replaced by `pass` | 1 | | dynamic-destination `sdwa_dest(...)` dropped | 1 | | dynamic `UNUSED_PRESERVE` treated as `UNUSED_PAD` | 1 | Without a mutation, the run exits 0. Windows 11 Pro 26100.9168, commit 2e5fdca4. `tests/form_coverage_check.py` and `tests/docs_links_check.py` pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Follow-up to ChazY11's review of #1934: the device-free pixel_aot_check.py
run only checked that SDWA_MOVREL_BODY translates, so dropping the source
selection still passed it (the draw caught it). SDWA_MOVREL_PINS now lists
the exact expression each source and destination selection of the body
produces, with temporaries as \d+, and how often it must appear (once per
static move, once per reachable destination of a dynamic one).

Each of five one-line mutations of tools/pixel_aot.py, applied alone, now
makes `python -B tests/pixel_aot_check.py` exit 1: the source selection
dropped (the reported survivor), sext ignored, the single-destination
selection dropped, the dynamic-destination selection dropped, and dynamic
UNUSED_PRESERVE treated as UNUSED_PAD. tools/pixel_aot.py is unchanged.

Refs #1917, #1934

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:47:16 +00:00
github manually merged commit 2e5fdca416 into gh-pr/1979/base 2026-11-26 23:47:17 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 22:39 UTC · original · reviewed

Review of head 2e5fdca416

Result: 0 P1, 0 P2. Clean-room check: the change touches only tests/pixel_aot_check.py and one docs paragraph; no CMake change, no third-party material.

What the change does: check_sdwa_movrel_pins matches the generated HLSL of SDWA_MOVREL_BODY against ten exact selection expressions (with a fixed occurrence count each), so the SDWA v_movrel* source and destination selections are pinned without a GPU.

Commands executed locally and results:

  • python3 -B tests/pixel_aot_check.py: rc=0
  • python3 tests/docs_links_check.py: pass (18 files, 387 links)
  • python3 tests/bidi_controls_check.py: pass
  • git diff --check origin/main...HEAD: clean
  • git merge-tree --write-tree --name-only origin/main HEAD: no conflicts
  • Win2025 (WARP node), Debug and Release /O2: python3 -B tests/pixel_aot_check.py rc=0; ctest -R "^pixel_aot_(sdwa_movrel|smovrel)_" 4/4 passed in both phases
  • GitHub CI: Linux Python checks, gfx1013 fixtures and Windows build all pass

Mutations in tools/pixel_aot.py (reverted with git checkout -- .):

  1. sdwa_source zero-extend path shifts by offset ^ 8: killed (pixel_aot_check.py rc=1, "SDWA movrel selection ... 0 occurrences, expected 1").
  2. sdwa_dest UNUSED_PRESERVE keep mask built from offset ^ 8: killed (rc=1).

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-24 22:39 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1979#pullrequestreview-6048520718) · **reviewed** Review of head 2e5fdca416ef1f99ee8e09d8dc6b5c05adc4ec9d Result: 0 P1, 0 P2. Clean-room check: the change touches only `tests/pixel_aot_check.py` and one docs paragraph; no CMake change, no third-party material. What the change does: `check_sdwa_movrel_pins` matches the generated HLSL of `SDWA_MOVREL_BODY` against ten exact selection expressions (with a fixed occurrence count each), so the SDWA v_movrel* source and destination selections are pinned without a GPU. Commands executed locally and results: - `python3 -B tests/pixel_aot_check.py`: rc=0 - `python3 tests/docs_links_check.py`: pass (18 files, 387 links) - `python3 tests/bidi_controls_check.py`: pass - `git diff --check origin/main...HEAD`: clean - `git merge-tree --write-tree --name-only origin/main HEAD`: no conflicts - Win2025 (WARP node), Debug and Release /O2: `python3 -B tests/pixel_aot_check.py` rc=0; `ctest -R "^pixel_aot_(sdwa_movrel|smovrel)_"` 4/4 passed in both phases - GitHub CI: Linux Python checks, gfx1013 fixtures and Windows build all pass Mutations in `tools/pixel_aot.py` (reverted with `git checkout -- .`): 1. `sdwa_source` zero-extend path shifts by `offset ^ 8`: killed (`pixel_aot_check.py` rc=1, "SDWA movrel selection ... 0 occurrences, expected 1"). 2. `sdwa_dest` UNUSED_PRESERVE keep mask built from `offset ^ 8`: killed (rc=1). AI-assisted; commands listed were executed locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.