tests: pin the swaprel selects and the plain movrel entry-mask refusal #1868

Merged
legacy-code-archaeologist merged 1 commit from upstream-pr/1875 into main 2026-11-24 21:28:18 +00:00
legacy-code-archaeologist commented 2026-11-24 19:56:23 +00:00 (Migrated from github.com)

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


Follow-up to @tedin7's reviews of #1785 (P3) and #1844 (P2). Tests and docs only; tools/pixel_aot.py is unchanged.

What

  • #1844 P2: the device-free run now pins the v_swaprel_b32 selects.
    • check_swaprel_exact translates two swaps:
      • a static swap of v25 and v26 (m0 = 0x10002);
      • a dynamic swap inside one bank, with m0 masked to 0x30001. The source offset then reaches v24 and v25, and the destination offset reaches v24 to v27.
    • The swap lines must equal an expected text. In that text the temporaries are renamed in order of first appearance, and the bank values are named by their literal (v1.0 … v4.0). So the pin checks which side reads which old value, which m0 half each side uses, and that both selects exist, independent of how many lines come before the swap.
  • #1785 P3: the plain movrel branch's own entry-mask refusal is exercised. v_movrels_b32_e32 and v_movreld_b32_e64 in the whole-quad region must be refused with Invalid v_movrels_b32 outside entry mask and Invalid v_movreld_b32 outside entry mask.
  • docs/experiments.md says so in the two existing paragraphs.

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 four swaprel mutations are tedin7's from #1844.

Mutation Exit code
source-side registers read swap_sval instead of swap_dval 1
static m0 halves swapped 1
dynamic source offsets taken from m0_mask >> 16 1
destination-side select removed 1
plain-movrel mask != "entry" refusal removed 1

Without a mutation, the run exits 0. The file is restored after each run.

On Windows 11 Pro 26100.9168 (WARP 10.0.26100.8972 and Quadro M1000M 32.0.15.7371, debug layer unavailable), at commit 36c70fa8:

  • ctest --preset dev --no-tests=error -R '^pixel_aot_(swaprel|plain_movrel|dpp_movrel)_(warp|hardware)$' passes 6/6.
  • tests/form_coverage_check.py and tests/docs_links_check.py pass.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6590209266 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1875). Originally posted by [legacy-code-archaeologist](https://github.com/legacy-code-archaeologist) on 2026-11-24T19:56:23Z. --- Follow-up to @tedin7's reviews of #1785 (P3) and #1844 (P2). Tests and docs only; `tools/pixel_aot.py` is unchanged. ## What - **#1844 P2: the device-free run now pins the `v_swaprel_b32` selects.** - `check_swaprel_exact` translates two swaps: - a static swap of v25 and v26 (`m0 = 0x10002`); - a dynamic swap inside one bank, with `m0` masked to `0x30001`. The source offset then reaches v24 and v25, and the destination offset reaches v24 to v27. - The swap lines must equal an expected text. In that text the temporaries are renamed in order of first appearance, and the bank values are named by their literal (`v1.0` … `v4.0`). So the pin checks which side reads which old value, which `m0` half each side uses, and that both selects exist, independent of how many lines come before the swap. - **#1785 P3: the plain movrel branch's own entry-mask refusal is exercised.** `v_movrels_b32_e32` and `v_movreld_b32_e64` in the whole-quad region must be refused with `Invalid v_movrels_b32 outside entry mask` and `Invalid v_movreld_b32 outside entry mask`. - `docs/experiments.md` says so in the two existing paragraphs. ## 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 four swaprel mutations are tedin7's from #1844. | Mutation | Exit code | |---|---| | source-side registers read `swap_sval` instead of `swap_dval` | 1 | | static `m0` halves swapped | 1 | | dynamic source offsets taken from `m0_mask >> 16` | 1 | | destination-side select removed | 1 | | plain-movrel `mask != "entry"` refusal removed | 1 | Without a mutation, the run exits 0. The file is restored after each run. On Windows 11 Pro 26100.9168 (WARP 10.0.26100.8972 and Quadro M1000M 32.0.15.7371, debug layer unavailable), at commit 36c70fa8: - `ctest --preset dev --no-tests=error -R '^pixel_aot_(swaprel|plain_movrel|dpp_movrel)_(warp|hardware)$'` passes 6/6. - `tests/form_coverage_check.py` and `tests/docs_links_check.py` pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tedin7 commented 2026-11-24 21:01:03 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T20:01:15Z.

Review: COMMENTED


Review of head 36c70fa84b (tests and docs only; no change to tools/pixel_aot.py).

Result: no blocking findings. The new device-free pins in tests/pixel_aot_check.py kill real logic mutations of v_swaprel_b32 and the plain v_movrel* branch.

Commands run locally on Linux in a clean worktree at that head:

  • git diff --check origin/main...HEAD: rc 0
  • python -B tests/docs_links_check.py: rc 0 (18 Markdown files, 375 links)
  • python -B tests/bidi_controls_check.py: rc 0 (1325 files, no bidirectional controls)
  • python -B tests/pixel_aot_check.py: rc 0

Mutations applied to tools/pixel_aot.py, each followed by tests/pixel_aot_check.py, then reverted (worktree clean afterwards):

  • swapped static m0[9:0]/m0[25:16] halves in the v_swaprel_b32 branch: rc 1 (killed by SWAPREL_STATIC_LINES)
  • swapped dynamic soff/doff expressions: rc 1 (killed by SWAPREL_DYNAMIC_LINES)
  • source side taking the source value instead of the old destination value: rc 1 (killed)
  • destination select removed: rc 1 (killed)
  • source value read from the destination base: rc 1 (killed, KeyError)
  • entry-mask refusal removed from the plain v_movrel* branch: rc 1 (killed by the new quad-region control)

Nit, non-blocking: the diff adds a stray blank line after the "Expected a numeric VGPR at v29" control tuple in _check_controls_inline.

Not covered by this review: the WARP / NVIDIA draw results quoted in docs/experiments.md were not re-run (Linux only).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6046436153 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1875#pullrequestreview-6046436153). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T20:01:15Z. **Review:** COMMENTED --- Review of head 36c70fa84b1b78f47f74b25f30e5999e077ece4d (tests and docs only; no change to tools/pixel_aot.py). Result: no blocking findings. The new device-free pins in tests/pixel_aot_check.py kill real logic mutations of v_swaprel_b32 and the plain v_movrel* branch. Commands run locally on Linux in a clean worktree at that head: - git diff --check origin/main...HEAD: rc 0 - python -B tests/docs_links_check.py: rc 0 (18 Markdown files, 375 links) - python -B tests/bidi_controls_check.py: rc 0 (1325 files, no bidirectional controls) - python -B tests/pixel_aot_check.py: rc 0 Mutations applied to tools/pixel_aot.py, each followed by tests/pixel_aot_check.py, then reverted (worktree clean afterwards): - swapped static m0[9:0]/m0[25:16] halves in the v_swaprel_b32 branch: rc 1 (killed by SWAPREL_STATIC_LINES) - swapped dynamic soff/doff expressions: rc 1 (killed by SWAPREL_DYNAMIC_LINES) - source side taking the source value instead of the old destination value: rc 1 (killed) - destination select removed: rc 1 (killed) - source value read from the destination base: rc 1 (killed, KeyError) - entry-mask refusal removed from the plain v_movrel* branch: rc 1 (killed by the new quad-region control) Nit, non-blocking: the diff adds a stray blank line after the "Expected a numeric VGPR at v29" control tuple in _check_controls_inline. Not covered by this review: the WARP / NVIDIA draw results quoted in docs/experiments.md were not re-run (Linux only). AI-assisted; commands listed were executed locally.
ChazY11 commented 2026-11-24 21:01:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T20:05:05Z.


Both claimed pins hold

At the PR head, Windows 11 build 26300.9974, device-free:

out/pe-env/Scripts/python.exe -B tests/pixel_aot_check.py
exit 0

Four mutations to tools/pixel_aot.py, each reverted:

mutation result
static m0: swap the two halves — src=[m0 & 0x3ff], dst=[(m0>>16) & 0x3ff] → the reverse caught
dynamic m0: soff_expr/doff_expr swap the & 0x3ff and >> 16 halves caught
Invalid {op} outside entry mask → pass (the plain movrel refusal this PR adds a case for) caught
Invalid DPP movrel outside entry mask → pass caught

So check_swaprel_exact distinguishes which side reads which old value and which m0 half each side uses — exactly what the
description claims — and the plain-movrel entry-mask case is load-bearing too. The expected-text pin (renamed temporaries,
bank values named by literal) is doing its job: the two halves are not interchangeable under it.

Two neighbouring refusals are still unreached

Same sweep, two more raise statements in the same region:

site mutation result
Invalid v_swaprel_b32 outside entry mask (line 5326) → pass green
Invalid scratch operation in non-entry mask (line 4125) → pass green

Both are the "this form is only valid under the full entry mask" guard, one for swaprel and one for the scratch path. The PR
covers the plain movrel and DPP movrel versions of the same rule; these two are the same rule again and would be cheap to add
in the same style (a word with a partial mask, expect the named refusal). Not a blocker for this PR — noting them so the
follow-up does not have to rediscover them.

Docs

The docs/experiments.md line describes the two new pins in the same shape as the surrounding entries. Nothing to add.

Verdict

Reviewed. Both P2/P3 items in the description are pinned by mutations I ran myself, and nothing in tools/pixel_aot.py moved,
which is what a tests-and-docs change should look like.

Notes

  • AI-assisted review.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7143018608 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1875#issuecomment-7143018608). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-24T20:05:05Z. --- ## Both claimed pins hold At the PR head, Windows 11 build 26300.9974, device-free: ```powershell out/pe-env/Scripts/python.exe -B tests/pixel_aot_check.py exit 0 ``` Four mutations to `tools/pixel_aot.py`, each reverted: | mutation | result | |---|---| | static `m0`: swap the two halves — `src=[m0 & 0x3ff]`, `dst=[(m0>>16) & 0x3ff]` → the reverse | **caught** | | dynamic `m0`: `soff_expr`/`doff_expr` swap the `& 0x3ff` and `>> 16` halves | **caught** | | `Invalid {op} outside entry mask` → `pass` (the plain movrel refusal this PR adds a case for) | **caught** | | `Invalid DPP movrel outside entry mask` → `pass` | **caught** | So `check_swaprel_exact` distinguishes which side reads which old value and which `m0` half each side uses — exactly what the description claims — and the plain-movrel entry-mask case is load-bearing too. The expected-text pin (renamed temporaries, bank values named by literal) is doing its job: the two halves are not interchangeable under it. ## Two neighbouring refusals are still unreached Same sweep, two more `raise` statements in the same region: | site | mutation | result | |---|---|---| | `Invalid v_swaprel_b32 outside entry mask` (line 5326) | → `pass` | **green** | | `Invalid scratch operation in non-entry mask` (line 4125) | → `pass` | **green** | Both are the "this form is only valid under the full entry mask" guard, one for `swaprel` and one for the scratch path. The PR covers the plain movrel and DPP movrel versions of the same rule; these two are the same rule again and would be cheap to add in the same style (a word with a partial mask, expect the named refusal). Not a blocker for this PR — noting them so the follow-up does not have to rediscover them. ## Docs The `docs/experiments.md` line describes the two new pins in the same shape as the surrounding entries. Nothing to add. ## Verdict Reviewed. Both P2/P3 items in the description are pinned by mutations I ran myself, and nothing in `tools/pixel_aot.py` moved, which is what a tests-and-docs change should look like. ## Notes - AI-assisted review.
tedin7 commented 2026-11-24 21:27:26 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T21:10:14Z.

Review: COMMENTED


Review of head 36c70fa84b

Not merged. Commands run locally: x2w_pipe.py safe-merge-check --pr 1875 --head-sha 36c70fa84b1b78f47f74b25f30e5999e077ece4d (verdict BLOCK).

Findings:

  • The PR conflicts with main (mergeable CONFLICTING, state DIRTY). It needs a rebase.
  • The head commit is authored or co-authored by the repo owner, so the self-merge gate blocks it.

No code defects were reviewed, since the PR cannot merge in this state.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6047460809 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1875#pullrequestreview-6047460809). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T21:10:14Z. **Review:** COMMENTED --- Review of head 36c70fa84b1b78f47f74b25f30e5999e077ece4d Not merged. Commands run locally: `x2w_pipe.py safe-merge-check --pr 1875 --head-sha 36c70fa84b1b78f47f74b25f30e5999e077ece4d` (verdict BLOCK). Findings: - The PR conflicts with main (mergeable CONFLICTING, state DIRTY). It needs a rebase. - The head commit is authored or co-authored by the repo owner, so the self-merge gate blocks it. No code defects were reviewed, since the PR cannot merge in this state. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-24 22:00:48 +00:00
tedin7 commented 2026-11-24 22:00:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T21:35:38Z.

Review: COMMENTED


Review of head 5c243aba55 (after the rebase). Tier B tests: docs/experiments.md and tests/pixel_aot_check.py only, no CMakeLists.txt change, one commit by the PR author. 0 P1, 0 P2.

Commands executed locally:

  • git merge-tree --write-tree --name-only origin/main HEAD: exit 0, no conflicts
  • git diff --check origin/main...HEAD: exit 0
  • python3 tests/docs_links_check.py: self-test passed, 18 Markdown files, 386 links
  • python3 tests/bidi_controls_check.py: self-test passed, 1351 files, no bidirectional controls
  • python3 -B tests/pixel_aot_check.py (controls, Linux): exit 0
  • Win2025 (Build 26100, MSVC 14.44, WARP): pixel_aot_(plain_movrel|swaprel|dpp_movrel)_{warp,hardware} 6/6 passed in Debug and in Release /O2; tests/pixel_aot_check.py Windows Python check ok
  • GitHub CI: Build and test on Windows, Python checks on Linux and gfx1013 fixtures all SUCCESS

Mutations in tools/pixel_aot.py, each reverted with git checkout -- .:

  1. Disabled the plain-movrel entry-mask refusal (Invalid {op} outside entry mask). The controls fail: the new loop for v_movrels_b32_e32 no longer sees the expected message. Killed.
  2. In v_swaprel_b32, made the source-offset select take swap_sval instead of swap_dval. The controls fail in check_swaprel_exact (static lines differ). Killed.

Notes, not blocking:

  • check_swaprel_exact compares generated HLSL text, so a harmless change in naming or line order of the swap lowering will need the pinned lines updated. The renaming helper limits this, and the pin is what catches mutation 2 without a device.
  • Nit: a stray blank line was added inside the for bad_seq tuple in _check_controls_inline.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6047795042 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1875#pullrequestreview-6047795042). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T21:35:38Z. **Review:** COMMENTED --- Review of head 5c243aba55955b195cca6d5c1a13e36c3e766205 (after the rebase). Tier B tests: docs/experiments.md and tests/pixel_aot_check.py only, no CMakeLists.txt change, one commit by the PR author. 0 P1, 0 P2. Commands executed locally: - `git merge-tree --write-tree --name-only origin/main HEAD`: exit 0, no conflicts - `git diff --check origin/main...HEAD`: exit 0 - `python3 tests/docs_links_check.py`: self-test passed, 18 Markdown files, 386 links - `python3 tests/bidi_controls_check.py`: self-test passed, 1351 files, no bidirectional controls - `python3 -B tests/pixel_aot_check.py` (controls, Linux): exit 0 - Win2025 (Build 26100, MSVC 14.44, WARP): `pixel_aot_(plain_movrel|swaprel|dpp_movrel)_{warp,hardware}` 6/6 passed in Debug and in Release /O2; `tests/pixel_aot_check.py` Windows Python check ok - GitHub CI: Build and test on Windows, Python checks on Linux and gfx1013 fixtures all SUCCESS Mutations in tools/pixel_aot.py, each reverted with `git checkout -- .`: 1. Disabled the plain-movrel entry-mask refusal (`Invalid {op} outside entry mask`). The controls fail: the new loop for `v_movrels_b32_e32` no longer sees the expected message. Killed. 2. In v_swaprel_b32, made the source-offset select take `swap_sval` instead of `swap_dval`. The controls fail in `check_swaprel_exact` (static lines differ). Killed. Notes, not blocking: - `check_swaprel_exact` compares generated HLSL text, so a harmless change in naming or line order of the swap lowering will need the pinned lines updated. The renaming helper limits this, and the pin is what catches mutation 2 without a device. - Nit: a stray blank line was added inside the `for bad_seq` tuple in `_check_controls_inline`. 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!1868
No description provided.