startup: name the condition a compute buffer input failed instead of one refusal #2616
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2624"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by NiiRoZz on 2026-11-25T23:29:54Z.
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
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T05:56:04Z.
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.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T06:24:50Z.
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.