startup: bind a compute input behind a memory view token in its own resource #2617

Merged
NiiRoZz merged 82 commits from upstream-pr/2625 into main 2026-11-26 07:00:01 +00:00
NiiRoZz commented 2026-11-25 23:30:05 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by NiiRoZz on 2026-11-25T23:30:05Z.


Depends 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_buffer resolved such a token through the placement index, found no owner for the range and refused with an 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_buffer is 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:

ctest --test-dir out/build/dev --no-tests=error -j4 -R "^startup_compute_dispatch"   -> 10/10 passed (5 warp, 5 hardware)

startup_compute_dispatch_input has 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.inl change reverted, the same case is refused with an input buffer view token's resource does not hold its range and 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

  • Measured: the fixture read-back on both adapters; the negative control; the token shape in the local run.
  • Hypothesis: that the 4 keys translate their dispatches after this change. No run with the change has been made; another input or an output of the same key may be refused next.

Not verified

  • No run of real requests with this change.
  • An adapter without existing-heap support gets the upload copy; that path stays refused and is not exercised by the fixture.
  • The committed-resource form on a custom heap (title memory from the allocation hook, data in the desktop resource) matches the same test and is bound the same way; no fixture creates one.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6615915950 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2625). Originally posted by [NiiRoZz](https://github.com/NiiRoZz) on 2026-11-25T23:30:05Z. --- Depends 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_buffer` resolved such a token through the placement index, found no owner for the range and refused with `an 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_buffer` is 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: ``` ctest --test-dir out/build/dev --no-tests=error -j4 -R "^startup_compute_dispatch" -> 10/10 passed (5 warp, 5 hardware) ``` `startup_compute_dispatch_input` has 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.inl` change reverted, the same case is refused with `an input buffer view token's resource does not hold its range` and 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 - Measured: the fixture read-back on both adapters; the negative control; the token shape in the local run. - Hypothesis: that the 4 keys translate their dispatches after this change. No run with the change has been made; another input or an output of the same key may be refused next. ## Not verified - No run of real requests with this change. - An adapter without existing-heap support gets the upload copy; that path stays refused and is not exercised by the fixture. - The committed-resource form on a custom heap (title memory from the allocation hook, data in the desktop resource) matches the same test and is bound the same way; no fixture creates one. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tedin7 commented 2026-11-26 06:02:08 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T05:56:16Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7183940189 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2625#issuecomment-7183940189). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T05:56:16Z. --- 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.
upstream-sync closed this pull request 2026-11-26 07:00:12 +00:00
R0Y00 commented 2026-11-26 07:00:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T06:59:47Z.

Review: APPROVED


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6069773009 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2625#pullrequestreview-6069773009). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T06:59:47Z. **Review:** APPROVED --- 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.
R0Y00 commented 2026-11-26 07:00:28 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T06:34:34Z.


I compared fdc087f8 with 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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7184566172 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2625#issuecomment-7184566172). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T06:34:34Z. --- I compared fdc087f8 with 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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!2617
No description provided.