shader: cover five pixel translator semantics that no draw observed #378

Merged
Leyukaka merged 1 commit from upstream-pr/384 into main 2026-11-22 03:03:11 +00:00
Leyukaka commented 2026-11-22 00:00:50 +00:00 (Migrated from github.com)

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


Change

This closes five coverage gaps in the gfx1013 pixel translator, tools/pixel_aot.py. Each was a one-line mutation of the translator that passed pixel_aot_warp and pixel_aot_hardware on main. Only tests/pixel_aot_check.py and the scalar64 paragraph of docs/experiments.md change; the translator does not.

  • check_half_draw gains a second draw: v_cvt_f32_f16 of the literal 0x3c00, of s_ashr_i64 0xf000, 2, and of s_bfm_b64 16, 0 masked with 0x3c00. Each is expected to read 1.0. The fourth channel is unchanged.
  • The scalar64 check gains a third constant set, as a draw only. Its a word is 0x11234567_ffffffff and its bfe_ctrl_b is 0x00400018. The two existing sets and their SCC mutation checks are unchanged.

The expected values come from half_value and from the existing scalar64_reference model. As a negative control, the half draw expects -8192.0 in green (a shift by zero) and must report pixel_mismatch. An assertion checks that the third set's s_not_b64 result is exactly bit 63.

Verification

On c14eb8b (branch on 4f6c39d), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14, NVIDIA GeForce RTX 5080 for the hardware test:

ctest --preset dev --no-tests=error -R pixel

Both tests pass, and so does the full suite (146 of 146 tests).

Each mutation was applied to tools/pixel_aot.py one at a time, followed by a rebuild and both pixel tests. On main, both tests passed for each one; a mutation of the s_movk_i32 immediate in the same run was caught by the #342 check. On this branch, each mutation fails both pixel_aot_warp and pixel_aot_hardware:

Mutation Caught through
Inline literal masked to its low byte red: 0x3c00 reads 0.0 instead of 1.0
s_ashr_i64 count masked with 61 green: a shift by 0 reads 0xf000 (-8192.0)
s_bfm_b64 width masked with 47 blue: a width-0 mask clears 0x3c00
s_not_b64 SCC from the low word only third scalar64 set: the complement is 0x80000000_00000000
s_bfe_i32 width masked with 63 third scalar64 set: width 64 at offset 24

Evidence and follow-up

Follows #372, which covered the jump-table translator the same way.

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:6536075168 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/384). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-22T00:00:50Z. --- ## Change This closes five coverage gaps in the gfx1013 pixel translator, `tools/pixel_aot.py`. Each was a one-line mutation of the translator that passed `pixel_aot_warp` and `pixel_aot_hardware` on `main`. Only `tests/pixel_aot_check.py` and the `scalar64` paragraph of `docs/experiments.md` change; the translator does not. - `check_half_draw` gains a second draw: `v_cvt_f32_f16` of the literal `0x3c00`, of `s_ashr_i64 0xf000, 2`, and of `s_bfm_b64 16, 0` masked with `0x3c00`. Each is expected to read `1.0`. The fourth channel is unchanged. - The scalar64 check gains a third constant set, as a draw only. Its `a` word is `0x11234567_ffffffff` and its `bfe_ctrl_b` is `0x00400018`. The two existing sets and their SCC mutation checks are unchanged. The expected values come from `half_value` and from the existing `scalar64_reference` model. As a negative control, the half draw expects `-8192.0` in green (a shift by zero) and must report `pixel_mismatch`. An assertion checks that the third set's `s_not_b64` result is exactly bit 63. ## Verification On `c14eb8b` (branch on `4f6c39d`), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14, NVIDIA GeForce RTX 5080 for the hardware test: ```text ctest --preset dev --no-tests=error -R pixel ``` Both tests pass, and so does the full suite (146 of 146 tests). Each mutation was applied to `tools/pixel_aot.py` one at a time, followed by a rebuild and both pixel tests. On `main`, both tests passed for each one; a mutation of the `s_movk_i32` immediate in the same run was caught by the #342 check. On this branch, each mutation fails both `pixel_aot_warp` and `pixel_aot_hardware`: | Mutation | Caught through | |---|---| | Inline literal masked to its low byte | red: `0x3c00` reads `0.0` instead of `1.0` | | `s_ashr_i64` count masked with `61` | green: a shift by 0 reads `0xf000` (`-8192.0`) | | `s_bfm_b64` width masked with `47` | blue: a width-0 mask clears `0x3c00` | | `s_not_b64` SCC from the low word only | third scalar64 set: the complement is `0x80000000_00000000` | | `s_bfe_i32` width masked with `63` | third scalar64 set: width 64 at offset 24 | ## Evidence and follow-up Follows #372, which covered the jump-table translator the same way. ## 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:42:45 +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!378
No description provided.