startup: name the condition a compute buffer input failed instead of one refusal #2624
No reviewers
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!2624
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2624/head"
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?
@NiiRoZz on GitHub · 2026-11-25 23:29 UTC · original
NiiRoZz:startup/compute-dispatch-input-ranges→main· +181 −21 · 6 files · 79 commits · merged 2026-11-26 06:25 UTCDepends 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
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 <[email protected]>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 <[email protected]>gfx2hlsl.py lowers one form of a register-offset load through the directly indexed resource heap pointer of a compute root signature: s_lshl_b32 R, <root constant word>, 5 s_load_dwordx4 D, s[H:H+1], R ; s[H+1] a constant zero, no offset: with no write of R and no branch target in between. D is a buffer descriptor and the manifest names it `srv <i> buf heap rootconst <parameter> <word>`. Every other form keeps a refusal that names it, including an index read from a buffer. The stand-in records the title memory of the list's view heap on every slot 32 call (it kept only the sampler heap and, for oversized heaps, the wrapper) and a Dispatch reads the 16-byte descriptor at byte `word << 5` of that memory, then binds it through the path a table record takes. A record outside the heap refuses the dispatch and binds nothing. Checks: tests/startup_gfx2hlsl_heap_record_check.py (manifest and HLSL exact, 19 refused controls, one translator mutation, LLVM 15 reassembly) and tests/startup_compute_dispatch_heap_check.py on WARP and a physical adapter. Refs #2274 Co-Authored-By: Claude Fable 5.2 <[email protected]>8a4df523) d17d2629b89828b5d8); pin the entry-value and refusal controls a20521715af5b03039) into startup/compute-dispatch-textures 190e00a1691991fd08a1' into startup/compute-dispatch-heap-rootconst 63875b31055e185ab7df' into pr2490-fu 1991fd08a163875b3105' into startup/compute-dispatch-heap-bufindex 356b805fd360304f30' into HEAD aa11b13642aa11b13642' into HEAD 0ccd35b45b@tedin7 on GitHub · 2026-11-26 05:56 UTC · original
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):
gh pr view 2624: state OPEN, mergeable CONFLICTING, 124 commits behind main, 75 commits on the branch (the open #2470 and #2490 parts are inside it).python3 merge_check.py 2624: conflict plus no Win2025 receipt on this head.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.
@tedin7 on GitHub · 2026-11-26 06:24 UTC · original
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:
indirect_table_buffernow sets a named reason; the compute Dispatch passes&reason, the draw callers do not, so their results are unchanged.startup_compute_dispatch_input_{warp,hardware}checks five refusal reasons one by one (empty, past, unplaced, copied, token): exact reason text, no output word written, input unchanged, onefirst refused inputline.Verification (Win2025 WARP, patched on the PR head merged with main,
--regex '^startup_compute_(dispatch|live_retry)(_[a-z_]+)?_warp$'):python3 tests/docs_links_check.py,python3 tests/bidi_controls_check.pypass;git diff --checkclean.The live head
f483a34ediffers from the tested tree only in how the two tests are listed inset_tests_properties.AI-assisted; commands listed were executed locally.