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

Merged
legacy-code-archaeologist merged 1 commit from upstream-pr/1979 into main 2026-11-24 22:49:53 +00:00
legacy-code-archaeologist commented 2026-11-24 22:31:47 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-24T22:31:47Z.


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

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6592726429 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1979). Originally posted by [legacy-code-archaeologist](https://github.com/legacy-code-archaeologist) on 2026-11-24T22:31:47Z. --- 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)
upstream-sync closed this pull request 2026-11-24 23:03:23 +00:00
tedin7 commented 2026-11-24 23:03:24 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T22:39:26Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6048520718 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1979#pullrequestreview-6048520718). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T22:39:26Z. **Review:** COMMENTED --- 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.
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!1972
No description provided.