shader: cover five integer and float conversion paths that no draw observed #579

Merged
Leyukaka merged 1 commit from upstream-pr/585 into main 2026-11-22 14:30:28 +00:00
Leyukaka commented 2026-11-22 14:18:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-22T14:18:23Z.


Change

This closes five coverage gaps in the integer and float conversions 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 conversion draws gain inputs from classes they never used. Each new case has a draw with independently computed expected values and a must-mismatch control:

  • check_cvt_float_int_draw: hex binary32 literals as the source of v_cvt_u32_f32_e32 and v_cvt_i32_f32_e32 (3.5, -2.75, 0x4f7fffff, -3.25);
  • check_cvt_int_f32_e64_draw: SGPR words with the sign bit set (0xC0000000, 0xBF800000) for unclamped v_cvt_f32_u32_e64, and clamped v_cvt_f32_i32_e64 words whose low half is zero (0x00010000, 0x7FFF0000);
  • CVT_INT_WORDS: the round-up ties 2**24+3 and 2**25-1 of [2**24, 2**25), plus a control that rejects their low-bit-cleared neighbours.

Verification

On 8950851 (branch on 1a4c728), 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).

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, each mutation fails pixel_aot_e64_warp:

Mutation Input class
v_cvt_u32_f32 clamps a hex literal source to [0, 1] literal source
v_cvt_i32_f32 takes the magnitude of a hex literal source literal source
unclamped v_cvt_f32_u32_e64 reads an SGPR word as signed SGPR source
clamped v_cvt_f32_i32_e64 drops bits 16 to 30 of a VGPR word clamp, VGPR source
v_cvt_f32_u32_e32 clears the low bit of a word in [2**24, 2**25) round-up ties

The new programs are drawn on WARP and hardware. They are not part of the binary LLVM fixture list.

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:6543444790 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/585). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-22T14:18:23Z. --- ## Change This closes five coverage gaps in the integer and float conversions 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 conversion draws gain inputs from classes they never used. Each new case has a draw with independently computed expected values and a must-mismatch control: - `check_cvt_float_int_draw`: hex binary32 literals as the source of `v_cvt_u32_f32_e32` and `v_cvt_i32_f32_e32` (3.5, -2.75, `0x4f7fffff`, -3.25); - `check_cvt_int_f32_e64_draw`: SGPR words with the sign bit set (`0xC0000000`, `0xBF800000`) for unclamped `v_cvt_f32_u32_e64`, and clamped `v_cvt_f32_i32_e64` words whose low half is zero (`0x00010000`, `0x7FFF0000`); - `CVT_INT_WORDS`: the round-up ties `2**24+3` and `2**25-1` of `[2**24, 2**25)`, plus a control that rejects their low-bit-cleared neighbours. ## Verification On `8950851` (branch on `1a4c728`), 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). 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, each mutation fails `pixel_aot_e64_warp`: | Mutation | Input class | |---|---| | `v_cvt_u32_f32` clamps a hex literal source to [0, 1] | literal source | | `v_cvt_i32_f32` takes the magnitude of a hex literal source | literal source | | unclamped `v_cvt_f32_u32_e64` reads an SGPR word as signed | SGPR source | | clamped `v_cvt_f32_i32_e64` drops bits 16 to 30 of a VGPR word | clamp, VGPR source | | `v_cvt_f32_u32_e32` clears the low bit of a word in `[2**24, 2**25)` | round-up ties | The new programs are drawn on WARP and hardware. They are not part of the `binary` LLVM fixture list. ## 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:48 +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!579
No description provided.