Repository navigation
gpu: reuse vertex fetch shaders across readback references - #2255
Merged
Merged
Conversation
tedin7
reviewed
Nov 25, 2026
tedin7
left a comment
Collaborator
There was a problem hiding this comment.
Review of head a4fba55 (test-only, tests/startup_vertex_fetch_formats_check.py).
Findings: 0 P1, 0 P2.
- The change splits the old run() into compile_fetch() and run_reference(), so each format compiles its vertex and compute-wrapper shaders once and reuses the binary for every wrong-reference readback. Only the mutation cases still recompile, which is required because the HLSL differs there.
- Behaviour is unchanged: stride constant, case layout (337 words), return-code checks (77 skip, 1 mismatch) and the
word=N expected=assertion are the same.correct = expected(name)is hoisted and compared with the same values as before. - No competing open PR touches this file (checked open PRs mentioning vertex fetch: #2193, #2138, #2006 touch tools/tests for other formats, not this harness).
Commands executed locally:
python3 tests/docs_links_check.py-> 428 links OKpython3 tests/bidi_controls_check.py-> no bidi controlsgit diff --check origin/main...HEAD-> cleanpython3 tests/startup_vertex_fetch_formats_check.py controls-> passed- Mutation (controls): changed the alignment assertion threshold
> 1to> 9; the controls check failed as expected, then reverted. The GPU path (readback) cannot run on Linux, so its mutation coverage is the in-test MUTATIONS/WRONG cases, exercised on Win2025. x2w_pipe.py win2025 2255 --scope direct --targets offscreen_check --regex startup_vertex_fetch_formats: Debug and Release /O2 each 100% passed (3/3: _warp, _hardware, _controls), [PASS].- CI: Build and test on Windows = pass, Linux Python checks = pass.
AI-assisted; commands listed were executed locally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The vertex fetch suite recompiles a format’s vertex shader and compute readback wrapper for every deliberately incorrect CPU reference. Those runs change only the words in the case file. Compile each normal format once and reuse its compute binary while checking the different references. Each mutated shader is still compiled separately as both VS and CS. The 52 device invocations, mismatch checks and capability skip are retained.
On Windows, starting at e94e14f, I ran the full entry point with DXC 1.9 on WARP and a physical D3D12 adapter. For every device invocation I compared the SHA-256 of the compiled compute shader and the complete binary case file, in order, along with the exit status and first-word mismatch diagnostic. All 52 records matched between revisions on both adapters: 12 normal successes and 40 expected failures.
The WARP median fell from 12.743 to 8.130 seconds (36%). Both devices executed the tests. Reproduce with
python -B tests/startup_vertex_fetch_formats_check.py <dxc> <offscreen_check> warpand again withhardware. The controls, stream-fetch translation, documentation links, bidi check andgit diff --checkpassed. This test-only change also merges cleanly with #2193 and #2006.