tests: reuse and overlap binary16 draw shader compiles #2782

Merged
RavenCurseBurg merged 1 commit from upstream-pr/2790 into main 2026-11-26 09:28:50 +00:00
RavenCurseBurg commented 2026-11-26 09:23:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-26T09:23:56Z.


Change

Compile each distinct (profile, generated HLSL) once per compiler in the binary16 ALU draw fixture. Submit the pixel and vertex shaders for the current case together, with at most three compiler processes. Consume their results and issue the draws in the existing order. The final SDWA wrong-word control draws the shader pair from its corresponding positive case.

Refs #448. This addresses the remaining FXC/DXC cost mentioned in #2766. That PR changes the shared renderer. This change is confined to startup_gfx2hlsl_f16_alu_draw_check.py and can land independently.

Verification

Compared 4bbe52ee and 1e632e13 on Windows 11 build 26100.9711, DXC 1.9.2609.5 (SM 6.0), Windows SDK FXC (SM 5.1), D3D12 debug layer unavailable. The same MSVC-built offscreen_check was used on both revisions. Run the fixture on each checkout:

python tests/startup_gfx2hlsl_f16_alu_draw_check.py draw <dxc> <offscreen_check> warp <fxc>
python tests/startup_gfx2hlsl_f16_alu_draw_check.py draw <dxc> <offscreen_check> hardware <fxc>

Run the hardware command with XBOX2WINDOWS_ADAPTER=Intel and then NVIDIA. For each draw I recorded the profiles, SHA-256 of both HLSL sources and both compiled blobs, the expected pixel words, exit code, stdout and stderr.

Adapter Driver Identical ordered draws Expected wrong-word failures
Microsoft WARP 10.0.26100.9711 220/220 4/4
Intel UHD Graphics 770 32.0.101.5973 220/220 4/4
NVIDIA GeForce RTX 4060 32.0.15.9579 220/220 4/4

All three runs went from 338 compiler launches to 252 (86 fewer, 25.4%). Four successive full WARP runs with fresh temporary shader directories took 115.2 s, 69.7 s, 62.6 s, 119.6 s, in parent / branch / branch / parent order. Host load affects these times. The launch counts and draw comparisons were identical across adapters.

I also injected compiler failures at the pixel, first-vertex and second-vertex positions of a two-chunk case. Errors surfaced in draw order even when a later worker failed first. A first draw returning skip 77 still took precedence over the later shader's failure.

AI-assisted contribution using Codex.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6623517464 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2790). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-26T09:23:56Z. --- ## Change Compile each distinct (profile, generated HLSL) once per compiler in the binary16 ALU draw fixture. Submit the pixel and vertex shaders for the current case together, with at most three compiler processes. Consume their results and issue the draws in the existing order. The final SDWA wrong-word control draws the shader pair from its corresponding positive case. Refs #448. This addresses the remaining FXC/DXC cost mentioned in #2766. That PR changes the shared renderer. This change is confined to `startup_gfx2hlsl_f16_alu_draw_check.py` and can land independently. ## Verification Compared `4bbe52ee` and `1e632e13` on Windows 11 build 26100.9711, DXC 1.9.2609.5 (SM 6.0), Windows SDK FXC (SM 5.1), D3D12 debug layer unavailable. The same MSVC-built `offscreen_check` was used on both revisions. Run the fixture on each checkout: ```text python tests/startup_gfx2hlsl_f16_alu_draw_check.py draw <dxc> <offscreen_check> warp <fxc> python tests/startup_gfx2hlsl_f16_alu_draw_check.py draw <dxc> <offscreen_check> hardware <fxc> ``` Run the hardware command with `XBOX2WINDOWS_ADAPTER=Intel` and then `NVIDIA`. For each draw I recorded the profiles, SHA-256 of both HLSL sources and both compiled blobs, the expected pixel words, exit code, stdout and stderr. | Adapter | Driver | Identical ordered draws | Expected wrong-word failures | | --- | --- | ---: | ---: | | Microsoft WARP | 10.0.26100.9711 | 220/220 | 4/4 | | Intel UHD Graphics 770 | 32.0.101.5973 | 220/220 | 4/4 | | NVIDIA GeForce RTX 4060 | 32.0.15.9579 | 220/220 | 4/4 | All three runs went from **338 compiler launches to 252** (86 fewer, 25.4%). Four successive full WARP runs with fresh temporary shader directories took **115.2 s, 69.7 s, 62.6 s, 119.6 s**, in parent / branch / branch / parent order. Host load affects these times. The launch counts and draw comparisons were identical across adapters. I also injected compiler failures at the pixel, first-vertex and second-vertex positions of a two-chunk case. Errors surfaced in draw order even when a later worker failed first. A first draw returning skip 77 still took precedence over the later shader's failure. AI-assisted contribution using Codex.
upstream-sync closed this pull request 2026-11-26 10:04:01 +00:00
tedin7 commented 2026-11-26 10:04:01 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T09:28:21Z.

Review: COMMENTED


Review of head 1e632e13 (comment only). No blocking findings.

  • Change is confined to tests/startup_gfx2hlsl_f16_alu_draw_check.py. Compiles are deduplicated by (profile, HLSL source) and run at most three at a time. Results are consumed in draw order, so draws and expected words are unchanged and an earlier failure still wins over a later one.
  • The final SDWA wrong-word control reuses the shader pair of the first SDWA case (same config, same first four lanes) and is still expected to be rejected.
  • No sibling tables or callsites are affected. No other open or merged PR touches this fixture.
  • Win2025 WARP dev and release: startup_gfx2hlsl_f16_alu_draw_controls and startup_gfx2hlsl_f16_alu_draw_warp pass 2/2 on both (receipt in the thread). CI is green.

Commands run: python3 -m py_compile, git diff --check origin/main...HEAD, the controls mode of the fixture, and the Win2025 ctest runs above.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6071549094 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2790#pullrequestreview-6071549094). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T09:28:21Z. **Review:** COMMENTED --- Review of head 1e632e13 (comment only). No blocking findings. - Change is confined to `tests/startup_gfx2hlsl_f16_alu_draw_check.py`. Compiles are deduplicated by (profile, HLSL source) and run at most three at a time. Results are consumed in draw order, so draws and expected words are unchanged and an earlier failure still wins over a later one. - The final SDWA wrong-word control reuses the shader pair of the first SDWA case (same config, same first four lanes) and is still expected to be rejected. - No sibling tables or callsites are affected. No other open or merged PR touches this fixture. - Win2025 WARP dev and release: `startup_gfx2hlsl_f16_alu_draw_controls` and `startup_gfx2hlsl_f16_alu_draw_warp` pass 2/2 on both (receipt in the thread). CI is green. Commands run: `python3 -m py_compile`, `git diff --check origin/main...HEAD`, the `controls` mode of the fixture, and the Win2025 ctest runs above. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 10:04:04 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T09:27:09Z.


Win2025 WARP receipt for head 1e632e13.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 1e632e13b3235baa7f6a755d0cc44f2c50881776:

  • Debug (--preset dev): ctest --preset dev -R 'startup_gfx2hlsl_f16_alu_draw_(controls|warp)' --parallel 6 --no-tests=error --output-on-failure: 2/2 passed (startup_gfx2hlsl_f16_alu_draw_controls 0.33s, startup_gfx2hlsl_f16_alu_draw_warp 21.29s)
  • Release /O2 (--preset release): same command: 2/2 passed (controls 0.34s, warp 20.76s)
  • *_hardware not run (the VM only has WARP). Python-only change, so the prebuilt offscreen_check was reused.

Review of the exact head (comment only, no blocking findings):

  • The change is confined to tests/startup_gfx2hlsl_f16_alu_draw_check.py. The compile dedup key is (profile, HLSL source), so one source cannot be reused across profiles.
  • Results are consumed in draw order, so the draws and expected words are unchanged. The wrong-word control reuses the shader pair of the first SDWA case (same lanes, same config) and is still expected to fail.
  • Checked locally: python3 -m py_compile, git diff --check origin/main...HEAD, and the controls mode of the fixture.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7188008621 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2790#issuecomment-7188008621). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T09:27:09Z. --- Win2025 WARP receipt for head 1e632e13. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `1e632e13b3235baa7f6a755d0cc44f2c50881776`: - **Debug (`--preset dev`)**: `ctest --preset dev -R 'startup_gfx2hlsl_f16_alu_draw_(controls|warp)' --parallel 6 --no-tests=error --output-on-failure`: **2/2 passed** (`startup_gfx2hlsl_f16_alu_draw_controls` 0.33s, `startup_gfx2hlsl_f16_alu_draw_warp` 21.29s) - **Release /O2 (`--preset release`)**: same command: **2/2 passed** (controls 0.34s, warp 20.76s) - `*_hardware` not run (the VM only has WARP). Python-only change, so the prebuilt `offscreen_check` was reused. Review of the exact head (comment only, no blocking findings): - The change is confined to `tests/startup_gfx2hlsl_f16_alu_draw_check.py`. The compile dedup key is (profile, HLSL source), so one source cannot be reused across profiles. - Results are consumed in draw order, so the draws and expected words are unchanged. The wrong-word control reuses the shader pair of the first SDWA case (same lanes, same config) and is still expected to fail. - Checked locally: `python3 -m py_compile`, `git diff --check origin/main...HEAD`, and the `controls` mode of the fixture. AI-assisted; commands listed were executed locally.
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!2782
No description provided.