shader: cover the s_pack half masks and the DPP16 src1 neg modifier #572

Merged
Leyukaka merged 1 commit from upstream-pr/578 into main 2026-11-22 14:13:44 +00:00
Leyukaka commented 2026-11-22 13:50:15 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-22T13:50:15Z.


Change

This closes three coverage gaps in tools/pixel_aot.py. Each was a one-line mutation of the translator that passed every WARP test on main. Only tests/pixel_aot_check.py changes; the translator does not.

  • check_scalar_pack_draw gains a third word pair, (0x0000ffff, 0xffffffff). It sets every bit of each half that s_pack_ll_b32_b16, s_pack_lh_b32_b16 and s_pack_hh_b32_b16 select, so a mask that drops one bit of the selected low or high half no longer compares equal. The two existing pairs keep their flags (index % 2), and the LL-against-LH control still runs on the first pair only.
  • DPP_BODY gains v_add_f32_dpp v45, v23, -v23 quad_perm:[3,2,1,0], folded into channel 0. v23 is 3.0 in every lane, so the result is 0 and dpp_reference is unchanged; without the src1 negation it is 6. A must-mismatch control removes the modifier, in the same style as the existing src0 control.

Verification

On 8da68ed (branch on d4c7656), 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 (275 of 275, including pixel_aot_hardware).

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 replaced QuadReadAcrossX with QuadReadAcrossY was caught, so the run does detect a broken translator. On this branch:

Mutation Caught by
s_pack_ll_b32_b16 low mask 0xffff becomes 0xfffd pixel_aot_predicate_rounding_warp
s_pack_lh_b32_b16 high mask 0xffff0000 becomes 0xfffe0000 pixel_aot_predicate_rounding_warp
the DPP16 src1 neg modifier is dropped pixel_aot_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:6543162003 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/578). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-22T13:50:15Z. --- ## Change This closes three coverage gaps in `tools/pixel_aot.py`. Each was a one-line mutation of the translator that passed every WARP test on `main`. Only `tests/pixel_aot_check.py` changes; the translator does not. - `check_scalar_pack_draw` gains a third word pair, `(0x0000ffff, 0xffffffff)`. It sets every bit of each half that `s_pack_ll_b32_b16`, `s_pack_lh_b32_b16` and `s_pack_hh_b32_b16` select, so a mask that drops one bit of the selected low or high half no longer compares equal. The two existing pairs keep their flags (`index % 2`), and the LL-against-LH control still runs on the first pair only. - `DPP_BODY` gains `v_add_f32_dpp v45, v23, -v23 quad_perm:[3,2,1,0]`, folded into channel 0. `v23` is 3.0 in every lane, so the result is 0 and `dpp_reference` is unchanged; without the src1 negation it is 6. A must-mismatch control removes the modifier, in the same style as the existing src0 control. ## Verification On `8da68ed` (branch on `d4c7656`), 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 (275 of 275, including `pixel_aot_hardware`). 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 replaced `QuadReadAcrossX` with `QuadReadAcrossY` was caught, so the run does detect a broken translator. On this branch: | Mutation | Caught by | |---|---| | `s_pack_ll_b32_b16` low mask `0xffff` becomes `0xfffd` | `pixel_aot_predicate_rounding_warp` | | `s_pack_lh_b32_b16` high mask `0xffff0000` becomes `0xfffe0000` | `pixel_aot_predicate_rounding_warp` | | the DPP16 src1 `neg` modifier is dropped | `pixel_aot_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:46 +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!572
No description provided.