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

Manually merged
github merged 1 commit from gh-pr/384/head into gh-pr/384/base 2026-11-26 21:47:39 +00:00
Owner

@⁠Leyukaka on GitHub · 2026-11-22 00:00 UTC · original
Leyukaka:pixel-controls → main · +32 −1 · 2 files · 1 commits · merged 2026-11-22 03:03 UTC

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.

**@⁠Leyukaka** on GitHub · 2026-11-22 00:00 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/384) `Leyukaka:pixel-controls` → `main` · +32 −1 · 2 files · 1 commits · merged 2026-11-22 03:03 UTC ## 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.
A second half draw converts the literal 0x3c00, an s_ashr_i64 by 2 and an
s_bfm_b64 mask of width 16. A third scalar64 set gives s_not_b64 a
result whose only set bit is in the high word and s_bfe_i32 a width of
64. Each covers a pixel_aot mutation that passed both pixel tests before.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:47:39 +00:00
github manually merged commit c14eb8bacd into gh-pr/384/base 2026-11-26 21:47:39 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.