startup: bind a compute input behind a memory view token in its own resource #2625
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!2625
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2625/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:30 UTC · original
NiiRoZz:startup/compute-dispatch-view-token-range→main· +40 −3 · 3 files · 82 commits · merged 2026-11-26 07:00 UTCDepends on #2624 (stacked on #2580). Refs #1723.
What changed
A buffer view published through device slot 70 over memory that no buffer is placed over gets a stand-in buffer placed in the title's own heap (opened from the address). That resource has title memory but no placement record, and its heap type is custom.
indirect_table_bufferresolved such a token through the placement index, found no owner for the range and refused withan input buffer view token's resource does not hold its range.The desktop resource of that buffer is the memory itself, so the token is now bound in its own resource at the view offset when the resource is on a custom heap and outside the placement index. Everything after that is unchanged: alignment, released resource, initial state, device, description and range checks still apply.
Still refused, with the same reason as before: a token whose resource is an indexed placement while the range resolves to another owner, and a token whose resource is the upload copy the memory view path falls back to (that copy is not the memory).
indirect_table_bufferis shared with the draw path, so a draw input of this form is accepted the same way. No draw of this form was measured.Tests
Windows 11, at this branch's head:
startup_compute_dispatch_inputhas a new case,dispatch-input-memory-view: the consumer publishes a structured buffer view (first element 4, 320 elements of 4 bytes) of memory no buffer is placed over through device slot 70, with the token in place of the input descriptor, and writes the input words there after the view exists. All 320 output words match on WARP and on hardware, with the debug layer enabled and no error message. The five refused inputs of that check are unchanged.Negative control: with the
d3d12_draw.inlchange reverted, the same case is refused withan input buffer view token's resource does not hold its rangeand the output keeps the sentinel (observed on WARP with a tolerant version of the assertion; the committed assertion fails there).Local observation (not reproducible from the repository)
In one local run this reason was the first refusal of 4 compute keys, 1,012,151 dispatches. A once-per-key diagnostic showed for the 3 tokens logged: no placement record, heap type 4, 0x10000 or 0x20000 bytes, one reference, and no placed owner for the view's range.
Measured versus hypothesis
Not verified
🤖 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 0ccd35b45b0ccd35b45b' into HEAD 347ffaa111@tedin7 on GitHub · 2026-11-26 05:56 UTC · original
Not merging yet: this PR says it depends on #2624 (stacked on #2580). #2580 is merged, but #2624 is still open, so this PR cannot land on its own. It is also 124 commits behind main and currently conflicts.
Next step: once #2624 is merged, update this branch with main (merge, keep both sides) and rerun the
startup_compute_dispatch*tests on Win2025 dev+release. I did not run Win2025 on the current head, because that run would include #2624's unmerged changes.Commands executed:
gh pr view 2625,python3 merge_check.py 2625(CONFLICTING, behind=124),gh pr view 2624/2580.AI-assisted; commands listed were executed locally.
@R0Y00 on GitHub · 2026-11-26 06:34 UTC · original
I compared
fdc087f8with my separate projection of the three-file contribution onto main after #2624. The Git trees are identical. Fresh Windows Release built startup_stream_consumer and passed all six input, entry and heap-word CTests serially on WARP and RTX 4060 Laptop. The custom-heap token case matched all 320 words and the five inherited refusal cases still left output untouched. No skips or debug errors.@R0Y00 on GitHub · 2026-11-26 06:59 UTC · original · approved these changes
Both upstream dependencies are on main. The final tree matches the independently rebuilt candidate. All six Release input, entry and heap-word CTests passed on WARP and RTX 4060 Laptop. The custom-heap token matched 320 words and all five refusal cases preserved the target. The final diff is confined to the draw consumer and source-built tests.