test: isolate readlane guarded refusal #1876

Merged
JustinDCosta merged 1 commit from upstream-pr/1883 into main 2026-11-24 20:17:41 +00:00
JustinDCosta commented 2026-11-24 20:04:21 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JustinDCosta on 2026-11-24T20:04:21Z.


Follow-up to the merged #1858. The guarded v_readlane_b32 control previously rejected through a later use of its result, so it did not isolate the translator's guard check.

This fixture now performs the readlane inside a guarded region, leaves its SGPR result unused, and stores an already-known VGPR while guarded. The normal translator refuses the instruction with the readlane diagnostic. A local mutation that removes only the guard_span refusal accepted the fixture, confirming that the negative control directly detects this check.

Validation:

  • Debug and Release compute_store_aot_readlane_(warp|hardware): 2/2 passed in both configurations.
  • Guard-disabled mutation: accepted by the mutated translator, so the control detects the missing refusal.
  • Markdown links: 18 files / 371 links; git diff --check passed.

Refs #1543

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6590352287 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1883). Originally posted by [JustinDCosta](https://github.com/JustinDCosta) on 2026-11-24T20:04:21Z. --- Follow-up to the merged #1858. The guarded `v_readlane_b32` control previously rejected through a later use of its result, so it did not isolate the translator's guard check. This fixture now performs the readlane inside a guarded region, leaves its SGPR result unused, and stores an already-known VGPR while guarded. The normal translator refuses the instruction with the readlane diagnostic. A local mutation that removes only the `guard_span` refusal accepted the fixture, confirming that the negative control directly detects this check. Validation: - Debug and Release `compute_store_aot_readlane_(warp|hardware)`: 2/2 passed in both configurations. - Guard-disabled mutation: accepted by the mutated translator, so the control detects the missing refusal. - Markdown links: 18 files / 371 links; `git diff --check` passed. Refs #1543
upstream-sync closed this pull request 2026-11-24 21:01:06 +00:00
tedin7 commented 2026-11-24 21:01:06 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Peer review of head f13a7a7b67d83e57e9bd81a46861723447836141.

Result: no P1/P2 defects found. The new guarded case now isolates the readlane guard: it fails when that guard is removed, and it passes only for that reason.

The change (tests/compute_store_check.py, readlane_controls) rebuilds the "readlane inside an exec-masked region" program so that nothing else in it can be refused. The guarded region now contains a valid buffer_store_dword v1, v0, s[8:11], 0 idxen next to the v_readlane_b32, and the later use of the readlane result and the final store are removed, so the program has no unused or dangling result. The expected diagnostic is unchanged (Unverified readlane operand or wave layout), and rejects already requires that exact text.

  • The only condition in tools/compute_store_aot.py that can produce that diagnostic for this program is guard_span is not None in the readlane branch (around line 611).
  • Control (local script, not part of the PR): the same guarded program with the readlane line left out of the guard lowers successfully, so the readlane is the only thing the lowering can object to.

Linux checks run locally in a clean worktree at this head:

  • git diff --check origin/main...HEAD: clean
  • tests/docs_links_check.py: passed (18 files, 376 links)
  • tests/bidi_controls_check.py: passed (1326 files)
  • tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so: exit 0 (the two "Unsupported MUBUF cache invalidation" lines in its output are the check's own expected refusals)

Mutations in tools/compute_store_aot.py (local, each reverted with git checkout -- .; tree clean):

  1. Remove or guard_span is not None from the readlane condition. With the new test, compute_store_check.py binary ... exits 1 at the guarded case with AssertionError: Expected rejection: Unverified readlane operand or wave layout (the program is accepted, as it should not be). With the previous version of the test, the same mutation also exits 1, but only because the guarded program was then refused for another reason (Unverified ALU operand), so the old case did not isolate this guard.
  2. Invert it (guard_span is None): the check exits 1 earlier, at the unguarded readlane baseline (Unverified readlane operand or wave layout raised for READLANE).

I did not run the Windows build or the draw checks for this change.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6046637225 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1883#pullrequestreview-6046637225). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T20:15:07Z. **Review:** COMMENTED --- Peer review of head `f13a7a7b67d83e57e9bd81a46861723447836141`. **Result: no P1/P2 defects found. The new guarded case now isolates the readlane guard: it fails when that guard is removed, and it passes only for that reason.** The change (`tests/compute_store_check.py`, `readlane_controls`) rebuilds the "readlane inside an exec-masked region" program so that nothing else in it can be refused. The guarded region now contains a valid `buffer_store_dword v1, v0, s[8:11], 0 idxen` next to the `v_readlane_b32`, and the later use of the readlane result and the final store are removed, so the program has no unused or dangling result. The expected diagnostic is unchanged (`Unverified readlane operand or wave layout`), and `rejects` already requires that exact text. - The only condition in `tools/compute_store_aot.py` that can produce that diagnostic for this program is `guard_span is not None` in the readlane branch (around line 611). - Control (local script, not part of the PR): the same guarded program with the readlane line left out of the guard lowers successfully, so the readlane is the only thing the lowering can object to. Linux checks run locally in a clean worktree at this head: - `git diff --check origin/main...HEAD`: clean - `tests/docs_links_check.py`: passed (18 files, 376 links) - `tests/bidi_controls_check.py`: passed (1326 files) - `tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so`: exit 0 (the two "Unsupported MUBUF cache invalidation" lines in its output are the check's own expected refusals) Mutations in `tools/compute_store_aot.py` (local, each reverted with `git checkout -- .`; tree clean): 1. Remove `or guard_span is not None` from the readlane condition. With the new test, `compute_store_check.py binary ...` exits 1 at the guarded case with `AssertionError: Expected rejection: Unverified readlane operand or wave layout` (the program is accepted, as it should not be). With the previous version of the test, the same mutation also exits 1, but only because the guarded program was then refused for another reason (`Unverified ALU operand`), so the old case did not isolate this guard. 2. Invert it (`guard_span is None`): the check exits 1 earlier, at the unguarded readlane baseline (`Unverified readlane operand or wave layout` raised for `READLANE`). I did not run the Windows build or the draw checks for this change. 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!1876
No description provided.