Skip to content

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

Merged
R0Y00 merged 1 commit into
R0Y00:mainfrom
legacy-code-archaeologist:tests/sdwa-movrel-pins
Nov 24, 2026
Merged

R0Y00 merged 1 commit into
R0Y00:mainfrom
legacy-code-archaeologist:tests/sdwa-movrel-pins

Conversation

@legacy-code-archaeologist

Copy link
Copy Markdown
Contributor

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 2e5fdca. tests/form_coverage_check.py and tests/docs_links_check.py pass.

🤖 Generated with Claude Code

Follow-up to ChazY11's review of R0Y00#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 R0Y00#1917, R0Y00#1934

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of head 2e5fdca

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.

@R0Y00
R0Y00 merged commit 4b8d92e into R0Y00:main Nov 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants