test: isolate readlane guarded refusal #1883

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

@⁠JustinDCosta on GitHub · 2026-11-24 20:04 UTC · original
JustinDCosta:test/readlane-guard-refusal → main · +4 −1 · 1 files · 1 commits · merged 2026-11-24 20:17 UTC

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

**@⁠JustinDCosta** on GitHub · 2026-11-24 20:04 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1883) `JustinDCosta:test/readlane-guard-refusal` → `main` · +4 −1 · 1 files · 1 commits · merged 2026-11-24 20:17 UTC 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
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:39:59 +00:00
github manually merged commit f13a7a7b67 into gh-pr/1883/base 2026-11-26 23:40:00 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 20:15 UTC · original · reviewed

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.

**@⁠tedin7** on GitHub · 2026-11-24 20:15 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1883#pullrequestreview-6046637225) · **reviewed** 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.