test: trace GPU-written indirect Dispatch to offscreen pixels #3222
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3222"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by xiaoqi72665 on 2026-11-27T23:20:05Z.
Closes #3209. Reuses #2492 / #2771 and the existing compute and graphics test helpers; related: #3211, #3213, #1759, #3074.
Scope
Extend the existing synthetic slot-67 indirect fixture rather than adding a new runtime path, executable or dependency. The GPU writer stores a 12-byte Dispatch record at byte interval [4,16) in the actual placed argument resource, with a leading DWORD guard and a three-DWORD neighboring guard at [16,28).
Actual local evidence
Final commit
3228f8c99d, rebased onto main9345c21(including merged #3217). Debug and Release, RX 7900 XT (32.0.32029.2010) and WARP (1.0.22.0), app-local Agility SDK 1.620.2.All 20 cases across the four adapter/configuration combinations passed. 6,400 output DWORDs, 280 argument/guard DWORDs and 1,280 captured RGBA8 pixels checked.
Example: final Release RX 7900 XT, X=5 (addresses are process-specific):
The existing indirect controls remain intact. Device-free mutation oracle and documentation link check pass (122 Markdown files, 621 links).
Expanded regression: 23/25 passed in each configuration (Debug 14.05s, Release 12.36s), no skips. Two unrelated native-compute tests fail identically on a clean, unmodified main
2e12dd8baseline:Separate evidence: https://github.com/R0Y00/Xbox2Windows/pull/3213#issuecomment-7230034055. Neither unrelated failure was hidden or changed in this PR.
Reproduction
Repeat with the release preset. Expanded regression filter:
The compute consumer uses the existing offline translator/DXC path. The graphics observer is desktop HLSL, not a translated title graphics shader. This is an offscreen synthetic end-to-end proof, not retail scene rendering or a performance claim. The D3D12 debug layer was unavailable locally. No production change was needed for this fixture.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T23:34:56Z.
Review: APPROVED
Independently reviewed
3228f8c9overmainfad97f47(clean trial tree106b6cf6). The test records the actual placed resource and byte range before and after the GPU writer and before ExecuteIndirect, checks both fenced snapshots and guard words, and reads the GPU-written compute output directly in the offscreen observer. The stale-SRV draw is a discriminating pixel control. The patch is confined to the source fixture and its reproduction note.I built
startup_stream_consumer d3d12_xs_shim compile_dxil startup_indirect_dispatchand ranctest --test-dir <build> --no-tests=error -j1 -V -R '^(startup_slot67_indirect_dispatch_(warp|hardware)|startup_indirect_(dispatch|root_constants|count|count_split)_(warp|hardware))$'. Debug and Release /O2 each passed 10/10, no skips. Both WARP 10.0.26100.9818 and RTX 4060 Laptop driver 32.0.16.1656 exercised the writer, zero, omitted-writer and stale-SRV cases. Windows 11 26200.9974; the slot-67 fixture reported debug layer enabled.python -B tests/startup_slot67_indirect_dispatch_check.py mutation, docs links and required hosted Windows all passed. This is source-built evidence for #3209.Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T23:35:50Z.
Review: APPROVED
I reviewed
3228f8c9merged overmainfad97f47. The merge is clean (tree106b6cf6) andgit diff --cached --checkis clean.What I traced.
capture_before_consumercopies the same placed resource on the guest list just before slot 61. It checks the native resource pointer and GPU VA against the writer's.0xc5c5c5c5sentinel and writes the low three bytes as UNORM8, which is exact for 0..255;placed[0](the input). It must fail the positive oracle and match its own predicted colours, so the observer really reads the buffer it names.What I ran. I built
d3d12_xs_shim startup_stream_consumer startup_indirect_dispatchindevandrelease, then ran:/O2, 13 of 14 WARP tests pass and 3 of 3 hardware tests pass, with no skips.startup_compute_dispatch_native_warpfails with "the native route left ['revision.txt'] in the cache", and it fails the same way onmainfad97f47.startup_slot67_indirect_dispatch_hardwarematched all five pixel cases on the RTX 5090:mainfad97f47, the PR'sstartup_slot67_indirect_dispatch_check.pyagainstmain'sstartup_stream_consumerfails at the first pixel case (('2', 'compute output mismatch')). Thedispatch-indirect-pixel-*modes don't exist there.Mutants in
src/startup_stubs/d3d12_compute_dispatch.inl. For each, I rebuilt indevand ranstartup_slot67_indirect_dispatch_warp:ExecuteIndirectargument offset one DWORD lateDispatch(x, y, z)instead of the GPU-read argumentsRestored and rebuilt afterwards;
git diff --quietis clean.Non-blocking.
position.x, repeated over 4 rows). A word whose low 24 bits are zero would look like the clear colour. No word in the fixture has that pattern, and the 320-word compare covers the rest.Verdict: approve on
3228f8c9.Environment: NVIDIA GeForce RTX 5090 driver 32.0.16.1088 and WARP, Windows 11 25H2 build 26200.9974, MSVC 19.52.37029, Windows SDK 10.0.28000.0 DXC, Python 3.12.10; the observer's info queue was available on hardware.
CI:
Build and test on Windowspasses on3228f8c9.This reply was AI-assisted.