shader: batch remaining pixel_aot draw cases per shader #691

Merged
Ammmae0x merged 2 commits from upstream-pr/697 into main 2026-11-22 21:39:13 +00:00
Ammmae0x commented 2026-11-22 20:47:31 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Ammmae0x on 2026-11-22T20:47:31Z.


Change

Refs #448

  • Batch the remaining multi-case --check-pixel-case loops per compiled .cso shader in tests/pixel_aot_check.py via run_pixel_batch() and run_pixel_batch_statuses(), reducing renderer process launches and D3D12 device creations across draw-core, draw-predicate-rounding, draw-blend-scalar, draw-e64, draw-integer-nc, draw-bfm, three-way and full-RGBA buffer-color (494 -> 263 renderer launches per backend across all 8 modes).
  • Keep --check-pixel, --check-pixel-quad-lod, --dual-pixel and --check-pixel-case-rg on their existing single-draw paths, and preserve every reference case, negative-control mismatch assertion (pixel_mismatch x=0 y=0, expected mismatch status) and exit-77 capability skip check.
  • Document the batched launch counts under ## Offline pixel shader recompilation in docs/experiments.md.
  • No changes to tests/offscreen_check.cpp (independent of open PR #685).

Verification

  • Toolchain / OS: Windows 11 (10.0.26100.0), MSVC 19.50.35727 (x64), DXC 10.0.26100.0, debug_layer=unavailable
  • Adapters: Microsoft Basic Render Driver (warp, driver 10.0.26100.7309) and NVIDIA GeForce RTX 4050 Laptop GPU (hardware, vendor 10de, device 28e1, driver 32.0.15.9186)

Post-merge (26464b5, merged upstream/main 3b9bb1a):

  • python -B tests/pixel_aot_check.py -> Self-test passed. (exit 0)
  • python -B tests/docs_links_check.py -> Checked 10 Markdown files and 128 links. (exit 0)
  • python -B tests/bidi_controls_check.py -> Self-test passed. Checked 586 tracked source, script and build/CI files: no bidirectional controls. (exit 0)

Full dual-preset GPU / WARP matrix (5a54c77, before upstream fma_packed merge touching only CPU FMA3 fixtures):

  • cmake --build --preset dev --target offscreen_check and cmake --build --preset release --target offscreen_check: 0 errors, 0 compiler warnings.
  • ctest --preset dev --no-tests=error -R "^offscreen_" -> 3 passed, 0 skipped, 0 failed (0.77s).
  • ctest --preset release --no-tests=error -R "^offscreen_" -> 3 passed, 0 skipped, 0 failed (0.85s).
  • Direct 8-mode runs (python -B tests/pixel_aot_check.py <mode> <dxc.exe> out/build/<preset>/offscreen_check.exe <warp|hardware>):
    • dev: 16 passed (8 warp, 8 hardware), 0 skipped (exit 77), 0 failed.
    • release: 16 passed (8 warp, 8 hardware), 0 skipped (exit 77), 0 failed.
    • Renderer launches per backend (494 -> 263): draw-core (127 -> 65; warp 9.74s dev / 9.48s release, hardware 24.11s dev / 24.23s release), draw-predicate-rounding (147 -> 74), draw-blend-scalar (126 -> 61), draw-e64 (57 -> 50), draw-integer-nc (12 -> 3), draw-bfm (15 -> 3), three-way (4 -> 3), buffer-color (6 -> 4).
  • Negative-control verification ([pass, mismatch, pass] batch via offscreen_check.exe warp --check-pixel-batch, plus expected-pass assertion on mismatch): failed deterministically with exit 1 and case=0 status=pass / case=1 status=mismatch / case=2 status=pass.
  • Could not run CTest pixel_aot_* targets via INTAKE_PYTHON (out/pe-env not created; ziglang/iced-x86 not installed locally), nor pixel_aot_check.py binary (LLVM 15 not installed on Windows); covered by Windows CI (out/pe-env) and Ubuntu CI (LLVM 15).

Evidence and follow-up

  • No new external fixtures added; all batched cases reuse the existing source-built shader/reference fixtures in tests/pixel_aot_check.py with explicit name= case paths.
  • Single-draw non-default modes (--check-pixel, --check-pixel-quad-lod, --dual-pixel, --check-pixel-case-rg) remain individual invocations because --check-pixel-batch runs check_translated_pixel(..., swapRB=false, writeMask=ALL).

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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6547584058 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/697). Originally posted by [Ammmae0x](https://github.com/Ammmae0x) on 2026-11-22T20:47:31Z. --- ## Change Refs #448 - Batch the remaining multi-case `--check-pixel-case` loops per compiled `.cso` shader in `tests/pixel_aot_check.py` via `run_pixel_batch()` and `run_pixel_batch_statuses()`, reducing renderer process launches and D3D12 device creations across `draw-core`, `draw-predicate-rounding`, `draw-blend-scalar`, `draw-e64`, `draw-integer-nc`, `draw-bfm`, `three-way` and full-RGBA `buffer-color` (494 -> 263 renderer launches per backend across all 8 modes). - Keep `--check-pixel`, `--check-pixel-quad-lod`, `--dual-pixel` and `--check-pixel-case-rg` on their existing single-draw paths, and preserve every reference case, negative-control mismatch assertion (`pixel_mismatch x=0 y=0`, expected `mismatch` status) and exit-77 capability skip check. - Document the batched launch counts under `## Offline pixel shader recompilation` in `docs/experiments.md`. - No changes to `tests/offscreen_check.cpp` (independent of open PR #685). ## Verification - **Toolchain / OS**: Windows 11 (`10.0.26100.0`), MSVC `19.50.35727` (x64), DXC `10.0.26100.0`, `debug_layer=unavailable` - **Adapters**: `Microsoft Basic Render Driver` (`warp`, driver `10.0.26100.7309`) and `NVIDIA GeForce RTX 4050 Laptop GPU` (`hardware`, vendor `10de`, device `28e1`, driver `32.0.15.9186`) **Post-merge (`26464b5`, merged `upstream/main` `3b9bb1a`):** - `python -B tests/pixel_aot_check.py` -> `Self-test passed.` (exit `0`) - `python -B tests/docs_links_check.py` -> `Checked 10 Markdown files and 128 links.` (exit `0`) - `python -B tests/bidi_controls_check.py` -> `Self-test passed. Checked 586 tracked source, script and build/CI files: no bidirectional controls.` (exit `0`) **Full dual-preset GPU / WARP matrix (`5a54c77`, before upstream `fma_packed` merge touching only CPU FMA3 fixtures):** - `cmake --build --preset dev --target offscreen_check` and `cmake --build --preset release --target offscreen_check`: 0 errors, 0 compiler warnings. - `ctest --preset dev --no-tests=error -R "^offscreen_"` -> **3 passed, 0 skipped, 0 failed** (`0.77s`). - `ctest --preset release --no-tests=error -R "^offscreen_"` -> **3 passed, 0 skipped, 0 failed** (`0.85s`). - Direct 8-mode runs (`python -B tests/pixel_aot_check.py <mode> <dxc.exe> out/build/<preset>/offscreen_check.exe <warp|hardware>`): - `dev`: **16 passed** (`8` `warp`, `8` `hardware`), **0 skipped (exit 77)**, **0 failed**. - `release`: **16 passed** (`8` `warp`, `8` `hardware`), **0 skipped (exit 77)**, **0 failed**. - Renderer launches per backend (`494 -> 263`): `draw-core` (`127 -> 65`; `warp` `9.74s` `dev` / `9.48s` `release`, `hardware` `24.11s` `dev` / `24.23s` `release`), `draw-predicate-rounding` (`147 -> 74`), `draw-blend-scalar` (`126 -> 61`), `draw-e64` (`57 -> 50`), `draw-integer-nc` (`12 -> 3`), `draw-bfm` (`15 -> 3`), `three-way` (`4 -> 3`), `buffer-color` (`6 -> 4`). - Negative-control verification (`[pass, mismatch, pass]` batch via `offscreen_check.exe warp --check-pixel-batch`, plus expected-pass assertion on mismatch): failed deterministically with exit `1` and `case=0 status=pass` / `case=1 status=mismatch` / `case=2 status=pass`. - Could not run CTest `pixel_aot_*` targets via `INTAKE_PYTHON` (`out/pe-env` not created; `ziglang`/`iced-x86` not installed locally), nor `pixel_aot_check.py binary` (LLVM 15 not installed on Windows); covered by Windows CI (`out/pe-env`) and Ubuntu CI (LLVM 15). ## Evidence and follow-up - No new external fixtures added; all batched cases reuse the existing source-built shader/reference fixtures in `tests/pixel_aot_check.py` with explicit `name=` case paths. - Single-draw non-default modes (`--check-pixel`, `--check-pixel-quad-lod`, `--dual-pixel`, `--check-pixel-case-rg`) remain individual invocations because `--check-pixel-batch` runs `check_translated_pixel(..., swapRB=false, writeMask=ALL)`. ## 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.
upstream-sync closed this pull request 2026-11-24 06:44:23 +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!691
No description provided.