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

Manually merged
github merged 1 commit from gh-pr/691/head into gh-pr/691/base 2026-11-26 22:12:03 +00:00
Owner

@⁠Leyukaka on GitHub · 2026-11-22 20:34 UTC · original
Leyukaka:bfe64-controls → main · +4 −0 · 1 files · 1 commits · merged 2026-11-22 21:06 UTC

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.

**@⁠Leyukaka** on GitHub · 2026-11-22 20:34 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/691) `Leyukaka:bfe64-controls` → `main` · +4 −0 · 1 files · 1 commits · merged 2026-11-22 21:06 UTC ## 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.
The s_bfe_u64/s_bfe_i64 draw gains a control word with only reserved
bit 23 set (width and offset stay zero) and a 60-bit field at offset 1
whose signed result has halves that sum to zero. Each covers a pixel_aot
mutation that passed every WARP test before.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:12:01 +00:00
github manually merged commit 9be5a34a64 into gh-pr/691/base 2026-11-26 22:12:03 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.