shader: cover five 64-bit scalar bit-field extract lowerings #685

Merged
Leyukaka merged 1 commit from upstream-pr/691 into main 2026-11-22 21:06:06 +00:00
Leyukaka commented 2026-11-22 20:34:49 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-22T20:34:49Z.


Change

This closes five coverage gaps in the s_bfe_u64/s_bfe_i64 lowering of tools/pixel_aot.py. Each was a one-line mutation that passed every WARP test on main. Only tests/pixel_aot_check.py changes (4 added lines); the translator does not.

New row (source, control) Mutations it covers
(1, 0x800000): only reserved bit 23 set, so width and offset stay 0 and the result is 0 width masked with 8 bits instead of 7; width 0 returning 0 only when the offset is nonzero
(0x1000000010000000, 0x3c0001): a 60-bit field at offset 1 width mask losing bit 2; sign extension applied only for right shifts of 32 or more; SCC from the sum of the two halves, which wraps to 0 for the signed result

Both rows go through the existing scalar_bfe64 program and its Python reference, and are appended after the existing ones, so the cross-op mismatch control keeps its index.

Verification

On 9be5a34 (branch on 3b9bb1a), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14, WARP:

ctest --preset dev --no-tests=error -j 4

All 297 tests pass.

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 shifted the alignment by one bit was caught by pixel_aot_blend_scalar_warp, so the run does detect a broken translator. On this branch, each of the five mutations fails pixel_aot_blend_scalar_warp.

#688 also edits the s_bfe_[ui]64 handling and tests/pixel_aot_check.py, so one of the two may need a rebase.

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:6547453603 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/691). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-22T20:34:49Z. --- ## Change This closes five coverage gaps in the `s_bfe_u64`/`s_bfe_i64` lowering of `tools/pixel_aot.py`. Each was a one-line mutation that passed every WARP test on `main`. Only `tests/pixel_aot_check.py` changes (4 added lines); the translator does not. | New row (source, control) | Mutations it covers | |---|---| | `(1, 0x800000)`: only reserved bit 23 set, so width and offset stay 0 and the result is 0 | width masked with 8 bits instead of 7; width 0 returning 0 only when the offset is nonzero | | `(0x1000000010000000, 0x3c0001)`: a 60-bit field at offset 1 | width mask losing bit 2; sign extension applied only for right shifts of 32 or more; SCC from the sum of the two halves, which wraps to 0 for the signed result | Both rows go through the existing `scalar_bfe64` program and its Python reference, and are appended after the existing ones, so the cross-op mismatch control keeps its index. ## Verification On `9be5a34` (branch on `3b9bb1a`), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14, WARP: ```text ctest --preset dev --no-tests=error -j 4 ``` All 297 tests pass. 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 shifted the alignment by one bit was caught by `pixel_aot_blend_scalar_warp`, so the run does detect a broken translator. On this branch, each of the five mutations fails `pixel_aot_blend_scalar_warp`. #688 also edits the `s_bfe_[ui]64` handling and `tests/pixel_aot_check.py`, so one of the two may need a rebase. ## 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:44:21 +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!685
No description provided.