startup: run compute pipelines (captured as Scarlett DXIL) and execute Dispatch; dispatches are dropped #1412
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#1412
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@denn0x on GitHub · 2026-11-24 10:56 UTC · original
Summary
The startup runtime drops every compute dispatch. Command-list slot 14 (
Dispatch) is a no-op, and compute pipelines created through device slot 62 (D3D12_COMPUTE_PIPELINE_STATE_DESC) are dumped and given a placeholder.Correction (after capturing them): all 52 compute shaders that executable created were DXBC containers holding Scarlett DXIL (parts
SFI0 ISG1 OSG1 PSV0 RTS0 STAT ILDN HASH DXIL), not gfx1013 machine code.tools/dxil_retarget.pyretargets all 52 without error (output unsigned). So the compute path is retarget, sign and run, not ISA translation.For UI-only frames this is invisible. Once an executable leaves its loading phase, compute is most of the GPU work. In a local run of an executable (offline, Windows 11 26300, RX 9070 XT, release build), the command lists after loading averaged per frame:
The executable creates at least 52 compute pipelines through slot 62. The presented surface is black (mean level 0/255) from the first frame after loading. Before that, the UI frames render correctly with the translated vertex and pixel pipelines.
What it needs
tools/dxil_retarget.pyalready retargets these containers, and its--pemode signs them throughroot_probe --signand gates modules that call Xbox-only intrinsics.CSbytecode), keyed by the container's bytes, into the shader cache.RTS0with the Xbox flags cleared).Dispatch(list slot 14).SetComputeRoot*list slots).Steps 1 and 4 need no game data.
Related
tools/compute_store_aot.pyandtools/ffx_dispatch_aot.pytranslate specific compute fixtures, not runtime pipelines.compute_store_aot).AI-assisted (Claude Code).
@denn0x on GitHub · 2026-11-24 11:11 UTC · original
Xbox intrinsics in the captured compute modules
I ran the 52 captured compute containers through
dxil_retarget.retarget_containerandprobe_roots.validate_shader(root_probe, dxil.dll):xbox.*intrinsic, so they can be signed and run as retargeted.External function 'xbox.…' is not a DXIL function, status0x80aa0009).Modules per declared intrinsic:
xbox.global_load_dword_with_cachexbox.ReadLane.i32xbox.s_load_dword_with_cachexbox.Med3_F32xbox.global_load_dwordx3_with_cachexbox.Max3_F32,xbox.Min3_F32xbox.global_load_dwordx4_with_cachexbox.GetLaneIDxbox.LaneSwizzle.i32xbox.global_atomic_add,xbox.global_atomic_subxbox.V_CNDMASK_B32xbox.global_load_dwordx2_with_cache,xbox.MakeUniform.i32,xbox.V_ALIGNBYTE_B32xbox.BFIxbox.V_PK_MAX_F16,xbox.V_PK_MIN_F16,xbox.global_store_dwordx3/x4_with_cache,xbox.Ballot64,xbox.Max3_U32,xbox.Med3_U32,xbox.Min3_U32xbox.global_atomic_fmax,xbox.global_atomic_fminxbox.MBCNT64,xbox.S_BCNT1_U64,xbox.TypedLoad.i32,xbox.MakeUniform.i64,xbox.WaveMin_U32,xbox.global_store_dword_with_cacheSo step 1 above also needs DXIL lowering of
xbox.*calls before signing. Three groups:Med3/Min3/Max3(F32, U32),BFI,V_CNDMASK_B32,V_ALIGNBYTE_B32,V_PK_MIN/MAX_F16,S_BCNT1_U64.ReadLanemaps toWaveReadLaneAt,GetLaneIDtoWaveGetLaneIndex,Ballot64toWaveActiveBallot,WaveMin_U32toWaveActiveMin, andMakeUniformtoWaveReadLaneFirst.LaneSwizzleandMBCNT64needWaveReadLaneAtsequences and prefix bit counts.global_*/s_load_*_with_cache,global_atomic_*):address - window_base). That needs the window to be one resource, or a small table of resources.A bitcode-level rewrite can build on the reader and writer already in
tools/dxil_retarget.py. The alternative is a disassemble, edit and reassemble route through DXC, if its assembler is available. Group 1 is a good first PR, with a fixture per intrinsic: a source-built module containing thexbox.*declaration, lowered, validated and dispatched on WARP against a CPU reference. Related: #584 (the gate).AI-assisted (Claude Code).
@triggered02 on GitHub · 2026-11-24 11:18 UTC · original
Claiming the first slice of this: make
Dispatchexecute compute pipelines that need noxbox.*intrinsics.The correction in the issue body is what makes a first slice possible at all: the 52 compute shaders are DXBC containers holding Scarlett DXIL,
dxil_retarget.pyretargets all 52 without error, and denn0x measured that 9 of 52 reference noxbox.*intrinsic and can therefore be validated and signed. The other 43 are refused by validation withExternal function 'xbox.…' is not a DXIL function, which is a separate problem and not part of this claim.What I plan to change:
Dispatch) currently a no-op: forwardDispatch(x, y, z)to the desktop command list when the bound compute pipeline is real, and keep the existing no-op behaviour when it is not — no behaviour change for the placeholder case;D3D12_COMPUTE_PIPELINE_STATE_DESC): instead of a placeholder, retarget and sign the captured Scarlett DXIL container through the existingdxil_retargetpath, then create a real compute PSO; refuse with a logged reason when the container carriesxbox.*intrinsics or fails validation, rather than silently substituting a placeholder;Evidence I will report: dispatch count reaching the desktop list, pipeline creation results split into signed / refused with reasons, and the fixture's readback bytes before and after. What I will not claim: that the title's own compute work is correct or complete — the 43 modules with
xbox.*intrinsics remain unrunnable by design, and this slice cannot speak for them.If you would rather have the
xbox.*gate handled first (for example a translation shim for the most common intrinsics before wiringDispatch), say so and I will switch; otherwise I will start with the wiring plus the fixture, which is testable today.AI-assisted (Claude Code).
@R0Y00 on GitHub · 2026-11-24 11:22 UTC · original
Please proceed with the source-built no-intrinsic compute dispatch slice. Use an offline, validated and signed artifact with the existing shader cache. Keep the final-module gate from #584 for executable unresolved calls, and report which stage refuses a pipeline. For the end-to-end fixture, use distinct dispatch dimensions and a UAV sentinel so a dropped dispatch or wrong root binding changes the result. A refused module should record zero desktop dispatches. WARP and one physical adapter would make the first PR independently reviewable.
@triggered02 on GitHub · 2026-11-24 11:33 UTC · original
First slice up as #1441: compute pipelines that are already desktop DXIL become real, and
Dispatchrecords them.Scope, deliberately narrow:
DXILpart and names no console intrinsic; otherwise it keeps the placeholder and logs the reason;Dispatch(x, y, z)only when the bound pipeline is real — with a placeholder the path is unchanged, so the 43 modules withxbox.*intrinsics behave exactly as they do today;startup_compute_dxil(ctest) controls the classifier boundary, including the case that matters most from denn0x's data: a container that carries DXIL and names an intrinsic must be refused, not built and failed later.Explicitly not in this PR, and I would rather say so than let the first slice look bigger than it is:
xbox.*question for the remaining 43;AI-assisted (Claude Code).
@denn0x on GitHub · 2026-11-24 11:49 UTC · original
Correction: which pipelines the dispatches use
I counted
Dispatch(list slot 14) per bound pipeline, by the device slot that created it.Every dispatch measured so far used a pipeline from device slot 67, not slot 62.
image_load,image_store, VALU math andexec-masked branches.So for this issue, translating gfx1013 compute stages (slot 67) is the likelier critical path, not retargeting DXIL (slot 62). That means extending the graphics translator with:
numthreadsfrom the pipeline's register metadata;image_store/buffer_storeto UAVs, which the translator does not do yet;The intrinsic census in my previous comment still applies to the slot-62 modules, if they turn out to be used. I will post the post-load census once a run gets there.
AI-assisted (Claude Code).
@R0Y00 on GitHub · 2026-11-24 12:23 UTC · original
Thanks for separating recorded pipeline creation from the dispatches that actually use it. Please keep the verified slot 67 work as the next runtime target and treat slot 62 as a separate source-built experiment. A useful first slot 67 fixture would bind explicit group dimensions, a read buffer and a writable resource, then verify nonzero GPU output plus a dropped-dispatch or swapped-binding control. Keep the 333 post-load dispatches unclassified until there is matching evidence for that phase.
@denn0x on GitHub · 2026-11-24 12:35 UTC · original
Post-load census: most rendering is GPU-driven
A run now gets past loading, so I counted one busy frame after loading. The frame was traced in a local runtime build with per-call logging.
Work recorded in one frame:
ExecuteIndirect, all signaturesDispatchMesharguments (type 10)Dispatcharguments (type 2)DrawIndexedarguments (type 1)Drawarguments (type 0)DispatchDraw/DrawIndexedExecuteIndirectcall has a maximum count of 1 and no count buffer.ExecuteIndirectis not executed by the runtime yet.What reaches the render targets: I copied every render target of that frame back to the CPU at the end of the frame.
This matches the census: the scene is not drawn by direct draws.
Revised critical path for a picture after loading. Translating compute shaders alone is not enough. Three pieces are needed, and each depends on the one before:
ExecuteIndirectwith argument buffers that alias the executable's GPU memory, so arguments written by compute are what the desktop GPU reads.DispatchMeshpath, which is most of the indirect calls.I will start on piece 1, with the compute dispatches that feed the indirect argument buffers. Anyone interested in piece 2 or 3 is welcome to pick it up. Pieces 2 and 3 can be tested on their own with source-built fixtures: a compute shader writes indirect arguments, then
ExecuteIndirectconsumes them.AI-assisted (Claude Code).
@R0Y00 on GitHub · 2026-11-24 12:51 UTC · original
The post-load capture adds a separate producer-to-consumer question. The argument bytes seen at record time alone do not establish who produced them. For a source-built control, start the argument buffer with a sentinel, dispatch a writer, apply the required UAV and indirect-argument synchronization, then execute one desktop-supported indirect signature and verify its fenced output. Omit the writer or use an explicitly wrong record as a negative control. Keep the slot 67 direct-dispatch fixture independent, and leave the unclassified signature out of the first slice.
@ArnabSaga on GitHub · 2026-11-24 12:53 UTC · original · edited 2026-11-24 12:56 UTC
Thanks for the clarification.
I've been working locally on the slot 62 Scarlett DXIL compute path, including offline retargeting, cache integrity, compute PSO creation, root bindings, and Dispatch execution. The source implementation is in place, and the Python controls pass, but C++ compilation and GPU verification are still pending.
I agree that the slot 67 direct-dispatch fixture should remain independent of the producer-to-consumer indirect execution test.
For the latter, the sentinel-initialized argument buffer, compute writer, UAV synchronization, transition to INDIRECT_ARGUMENT, and fenced readback should provide a clear way to establish the dependency. Omitting the writer would serve as a useful negative control.
I'll keep these paths separate and avoid claiming runtime compatibility until the GPU results are verified.
@R0Y00 on GitHub · 2026-11-25 06:24 UTC · original
The slot 67 request-to-DXIL step is now on main in #2223. Windows Release passed all 19 selected request and compute checks. The source-built publisher fed the watcher, and the resulting bytecode matched all 320 words on WARP and RTX 4060 Laptop. Swapping the group dimensions changed the readback on both. The startup runtime still creates a placeholder, so this is a fixture result. For the next slot 67 slice, please coordinate with the #2223 author, who noted a runtime follow-up. The acceptance is to construct and bind the real PSO, dispatch through the shim, and read the fenced UAV. A stale or missing compiled entry and a wrong binding should produce distinguishable results. Keep the separate slot 62 work in its existing PR.