Repository navigation
startup: translated compute Dispatch with 2D texture views, static samplers and a per-key census - #2490
startup: translated compute Dispatch with 2D texture views, static samplers and a per-key census#2490NiiRoZz wants to merge 47 commits into
Conversation
…33 and 35) Header-only state in list_compute_root.h with a Linux-testable check. Dispatch (slot 14) is not handled here; the state is exposed through ready() and table() for it. Refs R0Y00#870.
…root or heap change
Compute root constants are kept per list next to the graphics ones, in a shared 16 x 8 word store that refuses parameter >= 16 and offset >= 8. A new compute root signature clears them.
Part of R0Y00#870. Forward Dispatch only with a desktop compute pipeline and root bound and group counts within 65535 per axis; refuse otherwise.
…nts, document slot 14
…t against the bound root Slot 43 clears a parameter's binding when a replacement is rejected, slot 33 clears all bindings, and the compute pipeline records its root so a mismatched pair is refused.
Compute root constants are kept per list next to the graphics ones, in a shared 16 x 8 word store that refuses parameter >= 16 and offset >= 8. A new compute root signature clears them.
Part of R0Y00#870. Forward Dispatch only with a desktop compute pipeline and root bound and group counts within 65535 per axis; refuse otherwise.
…nts, document slot 14
…t against the bound root Slot 43 clears a parameter's binding when a replacement is rejected, slot 33 clears all bindings, and the compute pipeline records its root so a mismatched pair is refused.
Conflicts in d3d12_xs_device.cpp and docs/experiments.md resolved by keeping both sides: the pipeline root out-parameter of the stream builder next to the cached-mesh root, the bound root SRV mask next to the recorded upload SRV addresses, and both table entries and document sections. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Conflicts in d3d12_draw.inl and d3d12_xs_device.cpp resolved by keeping both sides: graphics root constants go through the shared store and still mark the words a slot 40 call set. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A device slot 67 placeholder keeps the key of its published request. At
list slot 14 the stand-in loads the stage cs manifest and compiled
program for that key and records the dispatch: raw buffer inputs and
outputs from hardware descriptors in the recorded compute tables, entry
values from the recorded compute root constants. Other manifest lines
leave the pipeline untranslated; a dispatch that cannot be bound
completely is refused with one logged reason and records nothing.
startup_compute_dispatch_{warp,hardware} drives a source-built program
through the stand-in list and reads the output back, with controls
before translation, without a Dispatch and for a refused output.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Dispatches that arrive before the offline translation no longer use up the lines kept for refusals at bind time. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The per-call refusal lines share one small budget, so a run cannot rank
keys by dispatch count. Each key now keeps its Dispatch count, the calls
recorded and the reason and table descriptor of its first refusal; the
periodic totals are followed by the refused dispatches per reason and the
40 keys with the most dispatches. A manifest that exists but cannot be
bound is counted apart from an absent one ("not modelled").
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A `uav <i> tex2d float table <param> <byte> channels 4` manifest line is bound from the token of the unordered access view the title created in its descriptor memory. Everything else is refused with its own reason: an entry that is no such token, a view the desktop did not create, a view that is not 2D, a format a float4 store cannot target, and a texture bound to two slots of one dispatch. Programs without entry values, inputs or outputs load too: the translated root no longer emits an empty range or drops the table when only outputs exist. The fixture stores through the stand-in's own list into a 32x8 RGBA16_FLOAT texture and reads it back with CopyTextureRegion. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A `srv <i> tex2d table <param> <byte>` manifest line is bound from the token of the shader resource view the title created, through the texture the draw path samples for that resource, uploaded first when the title filled it in memory. `smp` lines become static samplers of the translated root. A dispatch is refused, never bound to a null view, when the entry is no such token, the resource has no desktop texture, the view is not 2D or names a packed format, or the upload fails. Sampler heaps, comparison samplers and other texture kinds keep the translation unavailable. The fixture samples a 1x1 texture into the stored words of the raw buffer case; without a view the dispatch is refused and the output is untouched. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…s test The device check drains the debug layer; a draw runs it on every 64th call and the queue's execute drains the rest. A view token whose resource the caller released is the caller's misuse, as on the draw path. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…puts, print every census key A texture is refused only when the same call reads and writes it; two outputs of one texture share the unordered access state. A packed output view format gets its own refusal reason. The census prints every dispatched key instead of the first 40, and the wording on refused calls says what may already be recorded (an input texture upload). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…alue and refusal controls Slot 40 keeps the graphics words of main. The dispatch refuses an entry value no slot 37 or 39 call wrote since the compute root was set. Controls: both slots feed the readback, missing word, root changed, same root, list reset, wrong root, one buffer as input and output. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…egins The slot 67 cache owns desktop COM objects until module teardown. During process termination, the driver can already be shut down when static destructors run. Keep normal reference release on explicit unload and skip driver calls only during process termination. AI-assisted with Codex (GPT-6.2 Astra, xhigh).
…led texture to NON_PIXEL_SHADER_RESOURCE only sampled_state gives pixel-shader (and depth-read) states, which a compute list rejects at Close. dispatch-sampled-compute records the sampling fixture on a compute list and queue. The smp manifest line no longer scans two fields into one variable. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ifest version, stage, output also an input Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Thanks for the review. Head P1, compute list barrier. Fixed at the call site by list type: on a Refusals that were not pinned. Four fixtures in Minor. The Mutants (each applied alone, stand-in rebuilt,
Measured ctest --preset dev --no-tests=error -R '^startup_compute_dispatch_'4/4 passed, no skip: Not done
🤖 Generated with Claude Code |
|
@MasterDomino I independently ran |
MasterDomino
left a comment
There was a problem hiding this comment.
Re-review of 76ce41bc (stacked on #2470 1f5fb5e4). The P1 is fixed and the guards I listed are pinned.
P1: texture input on a COMPUTE list (resolved)
- On a COMPUTE list a sampled texture is now transitioned to
NON_PIXEL_SHADER_RESOURCEonly (d3d12_compute_dispatch.inl:292).dispatch-sampled-computerecords the sampling fixture on a compute list and queue, and gives all 320 words with no debug-layer error on WARP and the RX 9070 XT. - With the fix reverted, that mode fails on both adapters:
ResourceBarrier: D3D12_RESOURCE_STATES has invalid flags (0x80) for compute command list(id 537), thenlist Close failed 0x80070057, consumer exit 75. So the fixture guards the fix. DEPTH_READcan't arise on that path: a compute list never tracks it, andsampled_stateis no longer called there.
Runs (Windows 11 build 26300; RX 9070 XT, driver 32.0.32029.2010; WARP 10.0.26100.9818; debug layer enabled)
ctest --preset dev --no-tests=error -j1 -R '^startup_compute_dispatch_(texture_)?(warp|hardware)$' -V
ctest --preset dev --no-tests=error -j1 -R 'startup_list_dispatch|startup_compute|startup_root_constant|startup_gfx2hlsl_compute|startup_indirect|era_heap|desktop_root_signature|startup_stream|docs_links|startup_draw|startup_logical'- New tests: 4/4 pass, with no debug messages.
- Neighbour filter: 184 selected, 182 passed, 0 failed, 2 capability skips (
startup_logical_view_*).
Mutants (one line each, rebuilt, restored; startup_compute_dispatch_texture_warp)
| mutant | result |
|---|---|
| compute list uses the pixel-shader state again | caught on WARP and hardware (Close fails) |
return "manifest version"; → return nullptr; |
caught |
| any manifest version accepted | caught |
return "not a compute manifest"; → return nullptr; |
caught |
| any stage accepted | caught |
| same-texture input/output refusal off | caught (texture-store-self) |
| float/normalized output-format refusal off | caught (texture-store-uint) |
Thanks for pinning @ChazY11's two guards as well.
Still open (acknowledged in your note; not blocking for this slice)
- A texture that is a bound render target isn't moved back to
RENDER_TARGETafter a translated Dispatch. - An undescribed SRV on a typeless resource still gets a null description.
- The description still names
d0b9e774and doesn't mention the compute-list transition; worth refreshing.
Merge readiness
- This merges cleanly against
mainand lands after #2470, in the order @R0Y00 set there. - No title start-up progress is claimed: the 55 of 61 figure is an offline count over manifest text.
- Translated Dispatch isn't opt-in in render mode, so the final candidate needs an executable run before merge.
- The
x2w_d3d12_compute_censusexport is an interface addition for the maintainer to accept.
AI-assisted; commands listed were executed locally.
Resolved at 76ce41b: the COMPUTE-list transition is fixed and guarded, and the unpinned refusals are pinned. See my re-review on this head.
…shots list_compute_root cleared compute_srv_bound and recomputed compute_root_has_arguments twice; the second copy came from the second R0Y00#1974 snapshot merge and changed nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ute-dispatch-textures Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged the current #2470 head ( Changed
Measured (Windows 11 build 26300.10075, debug layer on, no error or corruption message) cmake --build --preset dev --target startup_stream_consumer
ctest --preset dev --no-tests=error -j1 -R "^startup_compute_dispatch_" -V
Not rerun
Still open (not in this slice)
|
|
On the two remaining notes:
🤖 Generated with Claude Code |
|
Thanks, @NiiRoZz. Both answers work for me, so neither note blocks this PR:
Still waiting on: the order #1803 → #1974 → #1975 → trimmed #2470, an executable run on the final candidate, and @R0Y00 accepting the AI-assisted. |
Upstream now records the compute root and tables (slots 33 and 35) and has its own DllMain with x2w_startup::d3d12_process_terminating, so this branch's flag and DllMain go. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
63875b3 to
1991fd0
Compare
…tch-translated # Conflicts: # docs/experiments.md
…te-dispatch-textures
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@NiiRoZz @MasterDomino #2532 was squash-merged into Is anything here still needed beyond what landed? If not, this PR could be closed as superseded by #2532. Any leftover tweak could go as a small follow-up against Thanks for the work on this stack. AI-assisted; commands listed were executed locally. |
|
Thanks, @tedin7. Confirmed on AI-assisted. |
Depends on #2470 (stacked on its branch, which itself carries #1803, #1974 and #1975); the new code is the last seven commits.
Why
A run of a console package with the first slice recorded no translated Dispatch. Its log and shader cache, counted
offline (counts only):
40 a raw buffer input, 9 a static sampler, 6 the
strideanddescword3entry values, 48 declare no entryvalue, 8 have no view at all, and none has a raw buffer output;
raw buffer, 6 declare no entry value, none uses a sampler;
keys by Dispatch count.
What changes
8e14a74b). Each key keeps its Dispatch count, the calls recorded, and the reason and tabledescriptor of its first refusal. The periodic totals line gains
not modelled <n>(a manifest exists but holdsa line the runtime does not bind, counted apart from an absent manifest) and is followed by the refused calls
per reason and every dispatched key by call count.
f2f7bfcc).uav <i> tex2d float table <param> <byte> channels 4is bound from thetoken of the unordered access view the caller created (device slot 19). Refused, each with its own reason: an
entry that is no such token, a view the desktop did not create, a view that is not 2D, a packed view format, a format a
float4store cannot target (integer, typeless), a texture that is also an input of the same call. Programs
without entry values, inputs or outputs now load: the translated root no longer emits an empty range, and keeps
its table when only outputs exist.
15e8b7ab).srv <i> tex2d table <param> <byte>is bound from thetoken of a shader resource view (device slot 18) through the texture the draw path samples for that resource,
uploaded first when the caller filled it in memory.
smplines become static samplers. Refused: no such token,no desktop texture, a view that is not 2D, a packed view format, a failed upload.
No view is bound null. A refused call records no Dispatch and binds nothing; the upload of an input texture the
caller filled in memory may already be recorded, which only syncs content.
With these line forms, 55 of the 61 manifests load, including all 7 the run dispatched (offline count against the
manifest text; the 6 others need
strideanddescword3).Not in this change
strideanddescword3entry values (6 manifests, none among the 7 dispatched).says a dispatched program needs it; the census of the next run will.
output of the same call (a mip chain pass), packed view formats.
Evidence
Commit under test:
d0b9e774for the four tests below;d3c396ccfor the neighbouring run (the commits between them throttle a device check, drop a liveness test, narrow the same-texture refusal to input against output, refuse packed output formats by name and print every census key). Windows 11 build 26300.startup_compute_dispatch_warpstartup_compute_dispatch_texture_warpstartup_compute_dispatch_hardwarestartup_compute_dispatch_texture_hardwareback through CopyTextureRegion on the stand-in's list. Expected: mip 0 of the fixture's CPU reference (64 halves
changed). Negative controls, same run: before the offline translation, without a Dispatch, and with a texture
that has no unordered access, every half keeps its sentinel and the refusal is logged once.
word. Expected: the case's 288 written words XOR the bits of 1.0f, the 32 others untouched. Negative control: no
view at the table entry, the dispatch is refused and every word keeps its sentinel.
ud 0.Neighbouring tests,
ctest --preset dev --no-tests=error -R '^startup_|sampler|list_copy|compute' -j 6: 864 selected, 860 passed, 0 failed. Capability skips, reported apart (4):startup_view_heap_warp,startup_small_texture_4k_addrlib,startup_logical_view_warp,startup_run_sh.Limits and open points
mode the static sampler has.
(one register field changed); the check asserts that the translation reads it as written, llvm-mc did not
assemble it here.
ud 0case uses an edited manifest on a program compiled with three unused entry values.something measured for compute; the census prints the first refused descriptor per key to settle it.
can show that this is right.
of about 1,500 Dispatch calls per frame and a few views each, the ring wraps after tens of frames; that a
recorded list never outlives a wrap is the draw path's assumption, not re-measured for compute.
measured run: its log names 8 dispatching keys (7 that waited for the runtime, 1 whose translation failed) and
no per-key count. The census answers it on the next run.
🤖 Generated with Claude Code