Skip to content

tests: reuse and overlap binary16 draw shader compiles - #2790

Merged
tedin7 merged 1 commit into
R0Y00:mainfrom
RavenCurseBurg:tests/reuse-half-alu-draw-compiles
Nov 26, 2026
Merged

tedin7 merged 1 commit into
R0Y00:mainfrom
RavenCurseBurg:tests/reuse-half-alu-draw-compiles

Conversation

@RavenCurseBurg

@RavenCurseBurg RavenCurseBurg commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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.

@tedin7

tedin7 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

Win2025 WARP receipt for head 1e632e1.

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.

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of head 1e632e1 (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
tedin7 merged commit 38628ca into R0Y00:main Nov 26, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants