shader: reject seven sampled-coverage programs the guards should refuse #708

Merged
Leyukaka merged 1 commit from upstream-pr/714 into main 2026-11-22 22:35:32 +00:00
Leyukaka commented 2026-11-22 22:18:43 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-22T22:18:43Z.


Change

This closes seven coverage gaps in the guards of tools/sampled_coverage_aot.py. Each was a one-line mutation that passed every WARP test on main. Only tests/sampled_coverage_check.py changes (36 added lines); the translator does not.

Seven rejection controls, each rejected by the intended guard and by no earlier one:

Control Guard Kind
selector read before its s_waitcnt lgkmcnt(0) scalar load consumed before wait wrong on hardware
sampled product read before s_waitcnt vmcnt(0) sampled product read before the vector wait wrong on hardware
attr0.x and attr0.y swapped in the interpolation sample coordinates must be uv.x, uv.y in order legal on hardware, but the emitted Sample(samp, uv) would be wrong
selector_byte=False the selector byte must be an int, not a bool translator policy
the constant descriptor listed twice overlapping descriptors translator policy
sampler loaded with s_load_dwordx8 descriptor width translator policy
s_wqm_b64 expanded from s[52:53] instead of the saved mask mask operands translator policy

Not covered: the CLI output-suffix check. It only runs in the LLVM binary mode, which this machine does not run.

Verification

On 3c20938 (branch on 6f48648), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14, WARP:

ctest --preset dev --no-tests=error -j 4

All 303 tests pass.

Each mutation was applied to tools/sampled_coverage_aot.py one at a time, and all WARP tests were run. On main, all of them passed for each mutation. A control that inverted the coordinate-order check was caught by sampled_coverage_warp, so the run does detect a broken translator. On this branch, each of the seven mutations fails sampled_coverage_warp.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed. (No capability changed.)
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6548532956 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/714). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-22T22:18:43Z. --- ## Change This closes seven coverage gaps in the guards of `tools/sampled_coverage_aot.py`. Each was a one-line mutation that passed every WARP test on `main`. Only `tests/sampled_coverage_check.py` changes (36 added lines); the translator does not. Seven rejection controls, each rejected by the intended guard and by no earlier one: | Control | Guard | Kind | |---|---|---| | selector read before its `s_waitcnt lgkmcnt(0)` | scalar load consumed before wait | wrong on hardware | | sampled product read before `s_waitcnt vmcnt(0)` | sampled product read before the vector wait | wrong on hardware | | `attr0.x` and `attr0.y` swapped in the interpolation | sample coordinates must be `uv.x`, `uv.y` in order | legal on hardware, but the emitted `Sample(samp, uv)` would be wrong | | `selector_byte=False` | the selector byte must be an `int`, not a `bool` | translator policy | | the constant descriptor listed twice | overlapping descriptors | translator policy | | sampler loaded with `s_load_dwordx8` | descriptor width | translator policy | | `s_wqm_b64` expanded from `s[52:53]` instead of the saved mask | mask operands | translator policy | Not covered: the CLI output-suffix check. It only runs in the LLVM binary mode, which this machine does not run. ## Verification On `3c20938` (branch on `6f48648`), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14, WARP: ```text ctest --preset dev --no-tests=error -j 4 ``` All 303 tests pass. Each mutation was applied to `tools/sampled_coverage_aot.py` one at a time, and all WARP tests were run. On `main`, all of them passed for each mutation. A control that inverted the coordinate-order check was caught by `sampled_coverage_warp`, so the run does detect a broken translator. On this branch, each of the seven mutations fails `sampled_coverage_warp`. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [ ] I updated README/docs when a capability or build requirement changed. (No capability changed.) - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted.
upstream-sync closed this pull request 2026-11-24 06:44:28 +00:00
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!708
No description provided.