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

Merged
roansystemlabs merged 1 commit from upstream-pr/564 into main 2026-11-22 13:16:15 +00:00
roansystemlabs commented 2026-11-22 12:46:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-22T12:46:12Z.


Change

Refs #448. Follows #556, as agreed in https://github.com/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).

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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6542550885 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/564). Originally posted by [roansystemlabs](https://github.com/roansystemlabs) on 2026-11-22T12:46:12Z. --- ## Change Refs #448. Follows #556, as agreed in https://github.com/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.
upstream-sync closed this pull request 2026-11-24 06:43:42 +00:00
RonLogic commented 2026-11-24 06:48:35 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-22T16:32:07Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7082148426 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/564#issuecomment-7082148426). Originally posted by [RonLogic](https://github.com/RonLogic) on 2026-11-22T16:32:07Z. --- 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.
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!558
No description provided.