shader: cover eight SOPK, SOP1 and no-carry lowerings that no draw observed #620

Manually merged
github merged 1 commit from gh-pr/620/head into gh-pr/620/base 2026-11-26 22:06:26 +00:00
Owner

@⁠Leyukaka on GitHub · 2026-11-22 16:11 UTC · original
Leyukaka:sopk-controls → main · +28 −5 · 1 files · 1 commits · merged 2026-11-22 19:33 UTC

Change

This closes eight coverage gaps in the SOPK, SOP1 and no-carry lowerings of tools/pixel_aot.py. Each was a mutation of the translator that passed every WARP test on main. Only tests/pixel_aot_check.py changes; the translator does not.

  • The SOPK draw gains an s_cmpk_eq_u32 against 0x8001, an s_cmovk_i32 of 0x8000 (the lowest signed immediate), and rows where s_cmovk_i32 leaves its destination unchanged.
  • The SOP1 draw gains a probe where both high bits are set and s_bitset1_b32 targets bit 4.
  • The no-carry draw gains a v_subrev_nc_u32 with two VGPR operands.

The references extend the existing Python models; they do not call the translator.

Verification

On 9fac366 (branch on e7e9133), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14, WARP and NVIDIA GeForce RTX 5080:

ctest --preset dev --no-tests=error -R '_warp$' -j 4
ctest --preset dev --no-tests=error -j 4

All WARP tests pass, and so does the full suite (281 of 281).

Each mutation was applied to tools/pixel_aot.py one at a time, and all WARP tests were run. On main, all of them passed for each mutation. A control that turned v_subrev_nc_u32 into a forward subtraction was caught by five WARP tests, so the run does detect a broken translator. On this branch:

Mutation Caught by
s_cmpk_*_u32 clears immediate bit 0 pixel_aot_predicate_rounding_warp
s_cmovk_i32 zero-extends 0x8000 pixel_aot_predicate_rounding_warp
s_cmovk_i32 sets SCC from whether the value changed pixel_aot_predicate_rounding_warp
s_cmov_b32 sets SCC from whether the value changed pixel_aot_blend_scalar_warp
s_abs_i32 SCC looks only at bits 31 and 0 pixel_aot_blend_scalar_warp
s_bitset0_b32 with bit 31 clears bit 30 pixel_aot_blend_scalar_warp
s_bitset1_b32 always sets bit 31 pixel_aot_blend_scalar_warp
v_subrev_nc_u32 with two VGPRs subtracts forward pixel_aot_e64_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.

**@⁠Leyukaka** on GitHub · 2026-11-22 16:11 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/620) `Leyukaka:sopk-controls` → `main` · +28 −5 · 1 files · 1 commits · merged 2026-11-22 19:33 UTC ## Change This closes eight coverage gaps in the SOPK, SOP1 and no-carry lowerings of `tools/pixel_aot.py`. Each was a mutation of the translator that passed every WARP test on `main`. Only `tests/pixel_aot_check.py` changes; the translator does not. - The SOPK draw gains an `s_cmpk_eq_u32` against `0x8001`, an `s_cmovk_i32` of `0x8000` (the lowest signed immediate), and rows where `s_cmovk_i32` leaves its destination unchanged. - The SOP1 draw gains a probe where both high bits are set and `s_bitset1_b32` targets bit 4. - The no-carry draw gains a `v_subrev_nc_u32` with two VGPR operands. The references extend the existing Python models; they do not call the translator. ## Verification On `9fac366` (branch on `e7e9133`), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14, WARP and NVIDIA GeForce RTX 5080: ```text ctest --preset dev --no-tests=error -R '_warp$' -j 4 ctest --preset dev --no-tests=error -j 4 ``` All WARP tests pass, and so does the full suite (281 of 281). Each mutation was applied to `tools/pixel_aot.py` one at a time, and all WARP tests were run. On `main`, all of them passed for each mutation. A control that turned `v_subrev_nc_u32` into a forward subtraction was caught by five WARP tests, so the run does detect a broken translator. On this branch: | Mutation | Caught by | |---|---| | `s_cmpk_*_u32` clears immediate bit 0 | `pixel_aot_predicate_rounding_warp` | | `s_cmovk_i32` zero-extends `0x8000` | `pixel_aot_predicate_rounding_warp` | | `s_cmovk_i32` sets SCC from whether the value changed | `pixel_aot_predicate_rounding_warp` | | `s_cmov_b32` sets SCC from whether the value changed | `pixel_aot_blend_scalar_warp` | | `s_abs_i32` SCC looks only at bits 31 and 0 | `pixel_aot_blend_scalar_warp` | | `s_bitset0_b32` with bit 31 clears bit 30 | `pixel_aot_blend_scalar_warp` | | `s_bitset1_b32` always sets bit 31 | `pixel_aot_blend_scalar_warp` | | `v_subrev_nc_u32` with two VGPRs subtracts forward | `pixel_aot_e64_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.
The SOPK draw gains an s_cmpk_eq_u32 against 0x8001, an s_cmovk_i32 of
0x8000 (the lowest signed immediate) and rows where s_cmovk leaves its
destination unchanged. The SOP1 draw gains a probe where both high bits
are set and s_bitset1_b32 targets bit 4, and the no-carry draw gains a
v_subrev_nc_u32 with two VGPR operands. Each covers a pixel_aot mutation
that passed every WARP test before.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:06:25 +00:00
github manually merged commit 9fac3669a7 into gh-pr/620/base 2026-11-26 22:06:26 +00:00
Author
Owner

@⁠JB2WIN on GitHub · 2026-11-22 18:49 UTC · original

Independent Windows run of this PR on physical hardware, since the evidence so far is WARP-only:

  • Commit under test: 9fac366 (PR head), built from source
  • Windows 11 (10.0.26200.9974), VS Build Tools 2026 (MSVC 19.51), SDK 10.0.26100.8249 (DXC 1.8.2502.11), dev preset
  • Adapters: NVIDIA GeForce RTX 3080 (driver 32.0.16.2124) and WARP 10.0.26100.9818, D3D12 debug layer enabled

ctest --preset dev --no-tests=error -R '^pixel_aot_' -V: 22/22 passed, 11 hardware + 11 WARP, no skips. The debug layer reported debug_errors=0 on all 442 draws. pixel_aot_predicate_rounding_hardware took 33.2 s, pixel_aot_blend_scalar_hardware 34.6 s and pixel_aot_integer_nc_hardware 3.6 s.

I only ran the unmutated PR. I did not re-run the eight mutations on the RTX 3080.

AI-assisted.

**@⁠JB2WIN** on GitHub · 2026-11-22 18:49 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/620#issuecomment-7083900445) Independent Windows run of this PR on physical hardware, since the evidence so far is WARP-only: - Commit under test: `9fac366` (PR head), built from source - Windows 11 (10.0.26200.9974), VS Build Tools 2026 (MSVC 19.51), SDK 10.0.26100.8249 (DXC 1.8.2502.11), dev preset - Adapters: NVIDIA GeForce RTX 3080 (driver 32.0.16.2124) and WARP 10.0.26100.9818, D3D12 debug layer enabled `ctest --preset dev --no-tests=error -R '^pixel_aot_' -V`: **22/22 passed**, 11 hardware + 11 WARP, no skips. The debug layer reported `debug_errors=0` on all 442 draws. `pixel_aot_predicate_rounding_hardware` took 33.2 s, `pixel_aot_blend_scalar_hardware` 34.6 s and `pixel_aot_integer_nc_hardware` 3.6 s. I only ran the unmutated PR. I did not re-run the eight mutations on the RTX 3080. AI-assisted.
Author
Owner

@⁠JB2WIN on GitHub · 2026-11-22 19:00 UTC · original

Follow-up to my earlier run: I applied the eight mutations from the table to tools/pixel_aot.py on 9fac366, one at a time, and ran only the hardware variant of the listed test on the RTX 3080 (driver 32.0.16.2124). The unmutated head passes these tests (22/22 in the run above).

Mutation Test Result
s_cmpk_*_u32 clears immediate bit 0 pixel_aot_predicate_rounding_hardware failed, pixel_mismatch
s_cmovk_i32 zero-extends 0x8000 pixel_aot_predicate_rounding_hardware failed, pixel_mismatch
s_cmovk_i32 SCC from "value changed" pixel_aot_predicate_rounding_hardware failed, pixel_mismatch
s_cmov_b32 SCC from "value changed" pixel_aot_blend_scalar_hardware failed, pixel_mismatch
s_abs_i32 SCC from bits 31 and 0 only pixel_aot_blend_scalar_hardware failed, pixel_mismatch
s_bitset0_b32 bit 31 clears bit 30 pixel_aot_blend_scalar_hardware failed, pixel_mismatch
s_bitset1_b32 always sets bit 31 pixel_aot_blend_scalar_hardware failed, pixel_mismatch
v_subrev_nc_u32 two VGPRs subtracts forward pixel_aot_e64_hardware failed, case=0 status=mismatch expected

So on hardware too, every mutation is caught by the test the table names. For mutations 2 and 7 I used the most literal reading: only 0x8000 is zero-extended, and bit 31 is set regardless of the operand.

AI-assisted.

**@⁠JB2WIN** on GitHub · 2026-11-22 19:00 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/620#issuecomment-7084033086) Follow-up to my earlier run: I applied the eight mutations from the table to `tools/pixel_aot.py` on `9fac366`, one at a time, and ran only the hardware variant of the listed test on the RTX 3080 (driver 32.0.16.2124). The unmutated head passes these tests (22/22 in the run above). | Mutation | Test | Result | |---|---|---| | `s_cmpk_*_u32` clears immediate bit 0 | `pixel_aot_predicate_rounding_hardware` | failed, `pixel_mismatch` | | `s_cmovk_i32` zero-extends `0x8000` | `pixel_aot_predicate_rounding_hardware` | failed, `pixel_mismatch` | | `s_cmovk_i32` SCC from "value changed" | `pixel_aot_predicate_rounding_hardware` | failed, `pixel_mismatch` | | `s_cmov_b32` SCC from "value changed" | `pixel_aot_blend_scalar_hardware` | failed, `pixel_mismatch` | | `s_abs_i32` SCC from bits 31 and 0 only | `pixel_aot_blend_scalar_hardware` | failed, `pixel_mismatch` | | `s_bitset0_b32` bit 31 clears bit 30 | `pixel_aot_blend_scalar_hardware` | failed, `pixel_mismatch` | | `s_bitset1_b32` always sets bit 31 | `pixel_aot_blend_scalar_hardware` | failed, `pixel_mismatch` | | `v_subrev_nc_u32` two VGPRs subtracts forward | `pixel_aot_e64_hardware` | failed, `case=0 status=mismatch` expected | So on hardware too, every mutation is caught by the test the table names. For mutations 2 and 7 I used the most literal reading: only `0x8000` is zero-extended, and bit 31 is set regardless of the operand. AI-assisted.
This discussion has been locked. Commenting is limited to contributors.
No description provided.