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

Merged
Leyukaka merged 1 commit from upstream-pr/620 into main 2026-11-22 19:33:11 +00:00
Leyukaka commented 2026-11-22 16:11:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-22T16:11:41Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6544642434 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/620). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-22T16:11:41Z. --- ## 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.
upstream-sync closed this pull request 2026-11-24 06:43:59 +00:00
JB2WIN commented 2026-11-24 06:48:40 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-22T18:49:46Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7083900445 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/620#issuecomment-7083900445). Originally posted by [JB2WIN](https://github.com/JB2WIN) on 2026-11-22T18:49:46Z. --- 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 commented 2026-11-24 06:48:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-22T19:00:22Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7084033086 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/620#issuecomment-7084033086). Originally posted by [JB2WIN](https://github.com/JB2WIN) on 2026-11-22T19:00:22Z. --- 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.
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!614
No description provided.