Skip to content

startup: run a GPU-written indirect Dispatch on a translated slot 67 pipeline - #2771

Merged
tedin7 merged 2 commits into
R0Y00:mainfrom
RavenCurseBurg:tests/slot67-indirect-current-main
Nov 26, 2026
Merged

tedin7 merged 2 commits into
R0Y00:mainfrom
RavenCurseBurg:tests/slot67-indirect-current-main

Conversation

@RavenCurseBurg

Copy link
Copy Markdown
Contributor

Refs #2492 and #2532. This is the standalone candidate requested in the issue discussion.

The fixture records a GPU producer, an argument readback copy and a slot 61 indirect Dispatch on one command list. A single fence covers both the argument readback and the translated consumer's output. Counts 2 and 5 write exactly 2 and 5 words from the same source-built gfx1013 program. Each dispatch compares all 320 words, including the untouched tail. The direct slot 14 run provides a reference for both counts. The producer helper is shared with the existing desktop indirect fixture.

Why the slot 61 change is included

I first built the test consumer against the unmodified main runtime at 9e5efae4 and published a valid translation. WARP, Intel and NVIDIA all produced the guarded argument records for 2 and 5. Direct Dispatch matched its reference at both counts. Slot 61 reported requires a desktop compute pipeline and root and left all 320 words untouched. #2532 provides direct Dispatch through slot 14. This patch reuses that binding path and records ExecuteIndirect for one rootless command with fixed-table raw buffers. It validates the placed range, transitions the argument resource, and refuses an argument buffer also bound to the shader. The GPU reads the count at execution time.

Verification

Tested on Windows 11 build 26100.9711 with DXC 1.9.2609.5, WARP 10.0.26100.9711, Intel UHD 770 32.0.101.5973 and RTX 4060 32.0.15.9579. I built the native binaries with Zig 0.13/Clang, using Windows-header compatibility definitions for HRESULT, constexpr enum flags and the debug-object-name GUID. The D3D12 debug layer was unavailable locally.

All three adapters passed the translated indirect fixture, the adjacent direct Dispatch and the same-pipeline retry on e94e984a. The final commit 7fdc253a updates one reference in the desktop counted test to the shared helper name. With an optimized rebuild of the runtime, XG DLL and both consumers at that head, the new fixture and the existing desktop plain, root-constants and counted modes all passed on each adapter (12 runs). In the local unoptimized Zig build, the existing desktop test trapped on its placeholder enum value on both the unmodified runtime and this branch.

python -B tests/startup_slot67_indirect_dispatch_check.py mutation
python -B tests/startup_slot67_indirect_dispatch_check.py binary <llvm-mc>
python -B tests/startup_slot67_indirect_dispatch_check.py <startup_stream_consumer> <dxc> <warp|hardware>
python -B tests/startup_compute_dispatch_check.py <startup_stream_consumer> <dxc> <warp|hardware>
python -B tests/startup_compute_live_retry_check.py <startup_stream_consumer> <dxc> <warp|hardware>

The GPU evidence includes the actual guarded argument records at both counts. The no-producer control reads [0,0,0]. The missing-translation control reads [5,1,1], reports no translation, and preserves all 320 sentinels. Multi-command, counted, out-of-range and output-alias cases each check the refusal and all 320 words. Texture and heap-entry manifests also remain refused with untouched outputs. The independent CPU oracle detects a flipped first/last result, a flipped first/last sentinel and a short/long readback. The machine code matches LLVM 15's gfx1013 assembly. The direct and retry scripts above are adjacent regression runs.

The repository's MSVC commands are cmake --build --preset release --target startup_stream_consumer followed by ctest --preset release --no-tests=error -j 1 -R "^startup_slot67_indirect_dispatch_(warp|hardware)$" -V. The previous independent MSVC run is for the earlier combined branch. The fixture uses repository-authored synthetic buffers and shaders.

AI-assisted with Codex (GPT-6.2 Astra, xhigh).

@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 7fdc253 against main (fixture and code only).

Checked:

  • record_translated_dispatch keeps the direct slot 14 behavior; the indirect path adds the single rootless command and no-count-buffer checks, the fixed-table raw buffer restriction, the argument-aliasing refusal and the INDIRECT_ARGUMENT transition.
  • Mutation oracle: python3 -B tests/startup_slot67_indirect_dispatch_check.py mutation PASS (consumer and sentinel flips detected).
  • python3 tests/docs_links_check.py, python3 tests/bidi_controls_check.py, git diff --check origin/main...HEAD: clean.
  • Win2025 WARP dev and release: startup_slot67_indirect_dispatch_warp/hardware and the sibling startup_indirect_dispatch_* pass, 5/5 each (receipt in the next comment).

No blocking findings. This is fixture-level evidence only; I have no game, so no executable startup result is claimed.

AI-assisted; commands listed were executed locally.

@tedin7

tedin7 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

Win2025 WARP receipt for head 7fdc253 (3 commits behind main, not updated).

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

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_indirect_dispatch startup_stream_consumer -- -j 2): 32.98s (configure 2.22s)
    • Test (ctest --preset dev -R 'startup_slot67_indirect|startup_indirect_dispatch' --parallel 2 --no-tests=error --output-on-failure): 5/5 passed (2.10s: startup_indirect_dispatch_warp 0.10s, startup_indirect_dispatch_hardware 0.10s, startup_slot67_indirect_dispatch_warp 1.53s, startup_indirect_dispatch_adapter_filter 0.13s, startup_slot67_indirect_dispatch_hardware 1.86s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_indirect_dispatch startup_stream_consumer -- -j 2): 62.40s (configure 2.32s)
    • Test (ctest --preset release -R 'startup_slot67_indirect|startup_indirect_dispatch' --parallel 2 --no-tests=error --output-on-failure): 5/5 passed (1.59s: startup_indirect_dispatch_warp 0.10s, startup_indirect_dispatch_hardware 0.10s, startup_slot67_indirect_dispatch_hardware 1.24s, startup_slot67_indirect_dispatch_warp 1.35s, startup_indirect_dispatch_adapter_filter 0.10s)
  • sccache: 2/22 hits; wall 108.7s

AI-assisted; commands listed were executed locally.

@tedin7
tedin7 merged commit cd5fb38 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