startup: keep the wave size in the in-memory compute request #3521
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3521
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3519"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Leyukaka on GitHub · 2026-11-29 21:22 UTC · original
Leyukaka:runtime-frozen-request-wave-size→main· +26 −11 · 4 files · 1 commits · merged 2026-11-30 08:43 UTCRefs #3226 (part 1 of our claim there).
Draft, held under our open-PR cap (#3516).
Why
The in-memory compute request copy (
FrozenComputeRequests::put, called fromsrc/startup_stubs/d3d12_draw.inl:879) did not setComputeRequest::wave32, so the field kept its default oftrue. The disk readerread_compute_requestderives it from state block A, dword 4 bit 20 (sa[18] & 0x10; set = wave32, clear = wave64).Wave64 programs taken from the in-memory copy were therefore analysed as wave32 and refused natively with "unbound numeric SGPR" on the high half of a 64-bit compare pair.
In one long local run of the application, most compute dispatches left without a translation came from such programs. No counts were recorded.
What
src/shader_compute_request.cpp:335: newcompute_request_wave32(state_a)(declared atsrc/shader_compute_request.h:59). Same expression as before. It returnstruewhen the block is not 28 bytes; shape validation rejects that case.src/shader_compute_request.cpp:322:read_compute_requestcalls the helper aftervalidate_compute_request_shape. Behaviour unchanged.src/frozen_compute_requests.h:38:putderiveswave32fromrequest.sabefore taking the lock. Its only caller builds the request withoutwave32, so nothing is overwritten.wave32was the onlyComputeRequestfield the in-memory copy omitted:true(before this change)Tests
native_frozen_requestnow puts one request with bit 20 clear and one with it set through the production put/take path, and assertswave32on each aftertake.Mutations, each run against
native_frozen_request:request.wave32 = true== 0)Regression run, dev preset with
X2W_WITH_OPUS=OFF:ctest -R '^native_frozen_request$': passed.ctest -R '^(startup_compute_|native_compute_)' -j 4: 212 tests, 198 passed, 11 skipped, 3 failed.The 3 failures also occur with the base sources (
ff9dcef0) rebuilt in the same tree:startup_compute_builder_gate_runtime(builder mode exit 3)startup_compute_dispatch_cube_warp("debug layer not enabled")startup_compute_dispatch_cube_hardware("debug layer not enabled")Not covered
No long-run re-measurement of the application with this change yet.
@lukaslw-lab on GitHub · 2026-11-30 07:52 UTC · original · approved these changes
Reviewed
babe3170by reading the diff; not built or run. I also checked one of our existing native-only runs against it.Verdict: approve.
putnow deriveswave32with the same expression as the disk reader, andComputeRequest::wave32was the only field the in-memory copy left at its default. No MUST.Our run backs the claim. Native-only run446: main
44a3ad5a+ #3508 #3518 #3466 #3523 #3097 #3529 + local profiling counters; 190 s fresh start; Windows 10 19045. It loggedcompute request snapshots: hits 58, so the frozen path was used. It refused 16 slot-67 keys natively, and 12 of them asunbound numeric SGPR sN(11 on an odd SGPR, the high half of a pair). For all 12, state block A has bit 20 of dword 4 clear (wave64). Several have 32 threads (8×4), which is the narrow-wave64 case. I did not rerun with this change..csiror manifest. Offlinecompile_dxiland pack entries went through the disk reader. The DXC bytecode cache is keyed by the new IR.compute_request_wave32returnstruefor a non-28-byte block, but every caller validates the shape (takepath atd3d12_compute_dispatch.inl:495, the disk reader before the call).Tests:
native_frozen_requestnow puts a wave64 and a wave32 request through the realput/takepath and checks each, and the two mutations show both are reached. CI did not run it (not in the Windowsprfilter), although it needs no GPU. The only result is the author's local run.