shader: admit modeled scalar ALU in pixel_aot masked regions #1064

Manually merged
github merged 2 commits from gh-pr/1064/head into gh-pr/1064/base 2026-11-26 22:38:43 +00:00
Owner

@⁠romn4rch on GitHub · 2026-11-24 00:01 UTC · original
romn4rch:romn4rch-pixel-aot-scalar-masking → main · +232 −28 · 4 files · 2 commits · merged 2026-11-24 00:37 UTC

Change

Implements the narrow scalar-ALU follow-up for #987 (Refs #987). Masked pixel_aot regions now accept only the existing lowerings for s_mov_b32, s_movk_i32, s_add_i32, s_mul_i32, signed s_cmp_*_i32, and s_cselect_b32, with inputs the scalar tracker can prove. Region-written SGPRs and SCC remain usable within that region but are treated as conditional after restore; reads reject until an unconditional rewrite. Scalar loads and other scalar operations remain refused. Both openers, save-pair checks, and existing empty-wave-skip rules are preserved.

Added translation controls, fixture binary round-trip inputs, WARP and hardware CTest entries, and experiment documentation. The draw fixture checks mixed, full, and empty masks and expects the unmasked reference to mismatch.

Verification

  • & .\out\pe-env\Scripts\python.exe -B tests\pixel_aot_check.py — passed.
  • cmake --build --preset dev --target offscreen_check — passed with the Visual Studio 2022 x64 developer environment loaded by tools/dev.ps1.
  • ctest --preset dev --no-tests=error -R '^pixel_aot_region_scalar_alu_warp$' -V — passed (1/1), Windows 11 build 26300, WARP backend. The deliberate unmasked-reference negative control was detected as a mismatch; no unexpected mismatch occurred.
  • ctest --preset dev --no-tests=error -R '^pixel_aot_region_waits_warp$' -V — passed (1/1), preserving the existing masked-wait stage.
  • & .\out\pe-env\Scripts\python.exe -B tests\docs_links_check.py — passed (15 Markdown files, 237 links).
  • & .\out\pe-env\Scripts\python.exe -B tests\bidi_controls_check.py — passed (889 tracked files checked).
  • git diff --check — passed.
  • LLVM 15 gfx1013 round-trip was not run because llvm-mc, llvm-objcopy, and LLVM-C.dll are unavailable in this environment.
  • The physical-GPU CTest was intentionally not run. No physical GPU result is claimed.

Evidence and follow-up

Fixtures are synthetic, source-built instruction sequences in tests/pixel_aot_check.py; no game files or proprietary binaries are used. WARP readback verifies only these fixtures and does not establish behavior for arbitrary shaders. The LLVM round-trip remains to be run in an environment with LLVM 15 gfx1013 support.

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.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted.

**@⁠romn4rch** on GitHub · 2026-11-24 00:01 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1064) `romn4rch:romn4rch-pixel-aot-scalar-masking` → `main` · +232 −28 · 4 files · 2 commits · merged 2026-11-24 00:37 UTC ## Change Implements the narrow scalar-ALU follow-up for #987 (Refs #987). Masked pixel_aot regions now accept only the existing lowerings for `s_mov_b32`, `s_movk_i32`, `s_add_i32`, `s_mul_i32`, signed `s_cmp_*_i32`, and `s_cselect_b32`, with inputs the scalar tracker can prove. Region-written SGPRs and SCC remain usable within that region but are treated as conditional after restore; reads reject until an unconditional rewrite. Scalar loads and other scalar operations remain refused. Both openers, save-pair checks, and existing empty-wave-skip rules are preserved. Added translation controls, fixture binary round-trip inputs, WARP and hardware CTest entries, and experiment documentation. The draw fixture checks mixed, full, and empty masks and expects the unmasked reference to mismatch. ## Verification - `& .\out\pe-env\Scripts\python.exe -B tests\pixel_aot_check.py` — passed. - `cmake --build --preset dev --target offscreen_check` — passed with the Visual Studio 2022 x64 developer environment loaded by `tools/dev.ps1`. - `ctest --preset dev --no-tests=error -R '^pixel_aot_region_scalar_alu_warp$' -V` — passed (1/1), Windows 11 build 26300, WARP backend. The deliberate unmasked-reference negative control was detected as a mismatch; no unexpected mismatch occurred. - `ctest --preset dev --no-tests=error -R '^pixel_aot_region_waits_warp$' -V` — passed (1/1), preserving the existing masked-wait stage. - `& .\out\pe-env\Scripts\python.exe -B tests\docs_links_check.py` — passed (15 Markdown files, 237 links). - `& .\out\pe-env\Scripts\python.exe -B tests\bidi_controls_check.py` — passed (889 tracked files checked). - `git diff --check` — passed. - LLVM 15 gfx1013 round-trip was not run because `llvm-mc`, `llvm-objcopy`, and `LLVM-C.dll` are unavailable in this environment. - The physical-GPU CTest was intentionally not run. No physical GPU result is claimed. ## Evidence and follow-up Fixtures are synthetic, source-built instruction sequences in `tests/pixel_aot_check.py`; no game files or proprietary binaries are used. WARP readback verifies only these fixtures and does not establish behavior for arbitrary shaders. The LLVM round-trip remains to be run in an environment with LLVM 15 gfx1013 support. ## 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. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted.
Co-authored-by: Copilot App <[email protected]>
Combine scalar bitmask invalidation with conditional definition tracking. Use encodable register operands for the scalar select round-trip fixture.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:38:41 +00:00
github manually merged commit 8e45488a08 into gh-pr/1064/base 2026-11-26 22:38:43 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-24 00:18 UTC · original

I resolved the shared scalar-tracker conflict and kept both mask invalidation and masked-region definedness. I also corrected the round-trip fixture: LLVM 15 rejects two distinct literal operands on the same scalar select, so the fixture materializes the same constants before the region. The full LLVM 15 binary suite and all six Windows Release masked-region tests passed on the integrated candidate (RTX 4060 Laptop and WARP).
Candidate: 8e45488a08

**@⁠R0Y00** on GitHub · 2026-11-24 00:18 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1064#issuecomment-7117934803) I resolved the shared scalar-tracker conflict and kept both mask invalidation and masked-region definedness. I also corrected the round-trip fixture: LLVM 15 rejects two distinct literal operands on the same scalar select, so the fixture materializes the same constants before the region. The full LLVM 15 binary suite and all six Windows Release masked-region tests passed on the integrated candidate (RTX 4060 Laptop and WARP). Candidate: 8e45488a0886f3d40313af417588c4d22cacb270
This discussion has been locked. Commenting is limited to contributors.
No description provided.