shader: batch the integer and SDWA predicate draws in pixel_aot #564

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

@⁠roansystemlabs on GitHub · 2026-11-22 12:46 UTC · original
roansystemlabs:shader/predicate-int-sdwa-batch → main · +56 −32 · 2 files · 1 commits · merged 2026-11-22 13:16 UTC

Change

Refs #448. Follows #556, as agreed in #448 (the #556 author had no overlapping follow-up).

draw-predicate-rounding still launched offscreen_check once per case for three predicate suites. They now use run_pixel_batch() from #556, one --check-pixel-batch process per compiled group, with the same references:

Suite Before After
32-bit integer (check_int_predicate_draws) 33 8
16-bit integer (check_int16_predicate_draws) 48 + 3 controls 8 + 3 controls
SDWA (check_sdwa_predicate_draws) 24 4
Whole draw-predicate-rounding 168 83
  • The signed-against-unsigned control (first i32 e32 group) and the inverted-unordered control of each SDWA group stay inside their batch as expected mismatches, each followed by a passing draw, as #556 does for the finite-instead-of-NaN control.
  • The three 16-bit must_mismatch controls keep one single-case draw each; two of them compile mutated shaders.
  • Case files are named after the group and input words, and a failing batch gets a note with the backend and group, so a failure still says which comparison differed.
  • The signed/unsigned control no longer recompiles its shader: DXC runs 59 times instead of 60.
  • docs/experiments.md: one paragraph after the #556 one.

Correction to my comment on #448: I wrote 45 single-case 16-bit draws and 102 → 20 for the three suites. The 16-bit suite has 48 (8 groups × 6 word pairs), so it is 105 → 20 without the three controls, or 108 → 23 with them, as in the table.

Verification

Windows 11 (build 26200), RTX 3070 (driver 32.0.16.2101) and WARP 10.0.26100, MSVC Build Tools 2022, DXC from Windows SDK 10.0.26100.0, debug layer enabled, on this branch rebased onto b1be506 (since rebased cleanly onto d3586dd, which only adds CPU translator tests; CPU checks re-run there: exit 0).

cmake --preset dev; cmake --build --preset dev
ctest --preset dev --no-tests=error -R "^pixel_aot_"
python -B tests/pixel_aot_check.py
python -B tests/docs_links_check.py
  • ctest: 18/18 passed; pixel_aot_predicate_rounding_hardware 28.1 s, _warp 6.1 s. The machine was loaded by other work, so I only quote the launch counts as the result; the times are indicative.
  • pixel_aot_check.py (CPU checks) and docs_links_check.py: exit 0.
  • Launch counts above come from wrapping subprocess.run around the unchanged test entry point, on 915a9ee and on this branch before the rebase, on both adapters (same counts on both). b1be506 only adds CPU tests and does not touch these files.

Negative controls, run against the three changed checks on both the RTX 3070 and WARP. Each mutation must fail with an AssertionError from the pixel comparison, and each did, naming the group:

Mutation RTX 3070 WARP
none pass pass
i32 comparisons emitted as u32 fails, i32 e32 first=0 same
i16 comparisons emitted as u16 fails, i16 e32 group 0 same
SDWA nlt emitted as ordered ge fails, first=12 same
expected-mismatch controls relabelled pass (int, SDWA) fails, i32 e32 first=0 / first=0 same

Evidence and follow-up

No new fixtures: the cases are the existing synthetic inputs and references, grouped per compiled shader. pixel_aot_hardware and pixel_aot_blend_scalar_hardware stay out of scope. @⁠RonLogic offered on #448 to verify this PR on RTX 4070 and WARP.

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: prepared with an AI coding agent and reviewed by a human before posting.

**@⁠roansystemlabs** on GitHub · 2026-11-22 12:46 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/564) `roansystemlabs:shader/predicate-int-sdwa-batch` → `main` · +56 −32 · 2 files · 1 commits · merged 2026-11-22 13:16 UTC ## Change Refs #448. Follows #556, as agreed in https://git.gtahub.st/github/R0Y00--Xbox2Windows/issues/448 (the #556 author had no overlapping follow-up). `draw-predicate-rounding` still launched `offscreen_check` once per case for three predicate suites. They now use `run_pixel_batch()` from #556, one `--check-pixel-batch` process per compiled group, with the same references: | Suite | Before | After | |---|---:|---:| | 32-bit integer (`check_int_predicate_draws`) | 33 | 8 | | 16-bit integer (`check_int16_predicate_draws`) | 48 + 3 controls | 8 + 3 controls | | SDWA (`check_sdwa_predicate_draws`) | 24 | 4 | | Whole `draw-predicate-rounding` | 168 | 83 | - The signed-against-unsigned control (first `i32` e32 group) and the inverted-unordered control of each SDWA group stay inside their batch as expected mismatches, each followed by a passing draw, as #556 does for the finite-instead-of-NaN control. - The three 16-bit `must_mismatch` controls keep one single-case draw each; two of them compile mutated shaders. - Case files are named after the group and input words, and a failing batch gets a note with the backend and group, so a failure still says which comparison differed. - The signed/unsigned control no longer recompiles its shader: DXC runs 59 times instead of 60. - `docs/experiments.md`: one paragraph after the #556 one. Correction to my comment on #448: I wrote 45 single-case 16-bit draws and 102 → 20 for the three suites. The 16-bit suite has 48 (8 groups × 6 word pairs), so it is 105 → 20 without the three controls, or 108 → 23 with them, as in the table. ## Verification Windows 11 (build 26200), RTX 3070 (driver 32.0.16.2101) and WARP 10.0.26100, MSVC Build Tools 2022, DXC from Windows SDK 10.0.26100.0, debug layer enabled, on this branch rebased onto `b1be506` (since rebased cleanly onto `d3586dd`, which only adds CPU translator tests; CPU checks re-run there: exit 0). ```powershell cmake --preset dev; cmake --build --preset dev ctest --preset dev --no-tests=error -R "^pixel_aot_" python -B tests/pixel_aot_check.py python -B tests/docs_links_check.py ``` - `ctest`: 18/18 passed; `pixel_aot_predicate_rounding_hardware` 28.1 s, `_warp` 6.1 s. The machine was loaded by other work, so I only quote the launch counts as the result; the times are indicative. - `pixel_aot_check.py` (CPU checks) and `docs_links_check.py`: exit 0. - Launch counts above come from wrapping `subprocess.run` around the unchanged test entry point, on `915a9ee` and on this branch before the rebase, on both adapters (same counts on both). `b1be506` only adds CPU tests and does not touch these files. Negative controls, run against the three changed checks on both the RTX 3070 and WARP. Each mutation must fail with an `AssertionError` from the pixel comparison, and each did, naming the group: | Mutation | RTX 3070 | WARP | |---|---|---| | none | pass | pass | | `i32` comparisons emitted as `u32` | fails, `i32 e32 first=0` | same | | `i16` comparisons emitted as `u16` | fails, `i16 e32 group 0` | same | | SDWA `nlt` emitted as ordered `ge` | fails, `first=12` | same | | expected-mismatch controls relabelled `pass` (int, SDWA) | fails, `i32 e32 first=0` / `first=0` | same | ## Evidence and follow-up No new fixtures: the cases are the existing synthetic inputs and references, grouped per compiled shader. `pixel_aot_hardware` and `pixel_aot_blend_scalar_hardware` stay out of scope. @⁠RonLogic offered on #448 to verify this PR on RTX 4070 and WARP. ## 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: prepared with an AI coding agent and reviewed by a human before posting.
Refs #448. Follows #556, which batched the floating-point predicate draws.
The 32-bit integer, 16-bit integer and SDWA predicate suites in
draw-predicate-rounding now run one --check-pixel-batch process per compiled
group through run_pixel_batch(), with the same references: 108 offscreen_check
launches become 23, and the whole test goes from 168 to 83.

The signed-against-unsigned control of the first i32 e32 group and the
inverted-unordered control of each SDWA group stay inside their batch as
expected mismatches, each followed by a passing draw. The three 16-bit
must_mismatch controls, two of them on mutated shaders, keep their single-case
draws. The signed/unsigned control reuses the group's compiled shader, so DXC
runs 59 times instead of 60.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:02:10 +00:00
github manually merged commit f608ac54f4 into gh-pr/564/base 2026-11-26 22:02:12 +00:00
Author
Owner

@⁠RonLogic on GitHub · 2026-11-22 16:32 UTC · original

Independent Windows verification for #448 on the submitted head f608ac54f409ab78199268115c10fd896d3736e1. Windows 11 build 26300.9974, x64 MSVC 19.52.37029.0, Windows SDK 10.0.26100.0, D3D12 debug layer enabled.

ctest --preset dev --no-tests=error -R '^pixel_aot_(predicate_rounding|e64)_(warp|hardware)$' -V
Adapter Predicate rounding e64
RTX 4070, driver 32.0.16.2124 pass, 24.51 s pass, 12.85 s
WARP, driver 10.0.26100.9818 pass, 4.27 s pass, 2.59 s

All four tests passed with no skips. The predicate suite's expected signed/unsigned and inverted-unordered mismatches were detected, and the passing cases after them completed successfully. Times are from this run only.

AI-assisted.

**@⁠RonLogic** on GitHub · 2026-11-22 16:32 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/564#issuecomment-7082148426) Independent Windows verification for #448 on the submitted head `f608ac54f409ab78199268115c10fd896d3736e1`. Windows 11 build 26300.9974, x64 MSVC 19.52.37029.0, Windows SDK 10.0.26100.0, D3D12 debug layer enabled. ```powershell ctest --preset dev --no-tests=error -R '^pixel_aot_(predicate_rounding|e64)_(warp|hardware)$' -V ``` | Adapter | Predicate rounding | e64 | | --- | ---: | ---: | | RTX 4070, driver 32.0.16.2124 | pass, 24.51 s | pass, 12.85 s | | WARP, driver 10.0.26100.9818 | pass, 4.27 s | pass, 2.59 s | All four tests passed with no skips. The predicate suite's expected signed/unsigned and inverted-unordered mismatches were detected, and the passing cases after them completed successfully. Times are from this run only. AI-assisted.
This discussion has been locked. Commenting is limited to contributors.
No description provided.