Repository navigation
startup: name the condition a compute buffer input failed instead of one refusal - #2624
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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
…compute-dispatch-heap-rootconst
…compute-dispatch-heap-bufindex
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…tch-translated # Conflicts: # docs/experiments.md
…te-dispatch-textures
… into startup/compute-dispatch-heap-rootconst
…ompute-dispatch-heap-bufindex
…ndex' into startup/compute-dispatch-input-ranges
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Not merging yet: this PR is stacked on #2470 -> #2490, and both are still open. #2532 and #2580 of the chain are merged now. What I checked (no merge, no push):
Next step: land #2470 and #2490 first, then update this branch with main (keep both sides) and run the review and the Win2025 tests on what is left of the diff. AI-assisted; commands listed were executed locally. |
|
Review and test receipt for #2624. Dependency: #2470 and #2490 are in main through #2532 and #2580. After merging origin/main, the diff against main is only this PR's 6 files (CMakeLists.txt, docs/experiments.md, d3d12_compute_dispatch.inl, d3d12_draw.inl, startup_compute_dispatch_input_check.py, startup_stream_consumer.cpp). Review of the remaining diff:
Verification (Win2025 WARP, patched on the PR head merged with main,
The live head f483a34 differs from the tested tree only in how the two tests are listed in AI-assisted; commands listed were executed locally. |
Depends on #2580 (stacked on #2470 -> #2490 -> #2532 -> #2580). Refs #2274.
What and why
A translated compute Dispatch whose raw buffer input did not resolve was refused with one reason,
an input is not a complete GPU-backed buffer range. In one local run that reason covered 18 program keys and 1,143,787 calls, the second largest runtime refusal, and the log could not say which condition failed.This change only names the condition.
indirect_table_buffertakes an optionalwhyout-parameter and sets it on every empty result; the compute Dispatch passes it and uses it as the refusal reason. The draw callers do not pass it; their results are unchanged (the indirect draw fixtures pass, see Tests). Reasons:an input buffer descriptor has zero recordsan input buffer range is over 16 MiB or not whole dwordsan input range crosses the end of a placed bufferan input range crosses the end of its upload allocationan input is in title memory outside any placed bufferan input is in a placed buffer that does not alias title memoryan input view token is not a buffer view of a desktop resourcean input buffer view has no element size or overflowsan input buffer view token names the list's upload memoryan input buffer view token's resource does not hold its rangean input buffer view token's resource is not on a default or upload heapan input buffer descriptor has a null addressan input buffer range is not 16-byte aligned in its resourcean input buffer's resource is releasedan input buffer's resource was not created in the common statean input buffer's resource is on another devicean input range is outside its desktop bufferThe first refusal of each key also logs one line with the input index, its table or heap source and the descriptor address (
x2w-draw compute <key> first refused input <i> (table|heap <a> <b>), descriptor at <address>). The line does not containrefused:, so the per-call refusal lines and the census format are unchanged.No form is newly bound. What was bound is still bound and what was refused is still refused.
What the existing log shows (local observation, counts only)
The census keeps the four descriptor words of each key's first refused call:
Hypotheses this change lets the next run settle:
#2218 (open, opt-in) owns backing slot 133 buffers the desktop cannot alias and overlaps the second form, so this PR does not add a copy for it. Whether its scope covers these keys is not checked: most of them sit in one buffer created with unordered access.
Tests
New
tests/startup_compute_dispatch_input_check.py, registered asstartup_compute_dispatch_input_{warp,hardware}. It runs case A through the stand-in's list. The unchanged recording matches all 320 output words. Then five input descriptors are replaced, and each Dispatch is refused with its own reason and one input line, and every output word keeps its sentinel:There is no new positive read-back because no form is newly bound. The existing dispatch tests, which pass unchanged, are the evidence that nothing changed.
Result: 10 of 10 passed, 0 skipped, 0 failed:
startup_compute_dispatch,_texture,_heap,_heap_wordand the new_input, each on WARP and on hardware. The debug layer was enabled and logged no error message in every run.indirect_table_bufferis shared with the indirect draw paths, so those fixtures ran too:ctest --preset dev --no-tests=error -j1 -R "^startup_(indirect_|compute_dispatch_input_)"passed 72 of 72 (WARP and hardware), 0 skipped.tests/docs_links_check.pyandtests/bidi_controls_check.pypass.Unverified
AI-assisted (Claude Code).
🤖 Generated with Claude Code