runtime: name each refused condition of a compute output buffer #3229

Merged
Not-Saii merged 6 commits from upstream-pr/3229 into main 2026-11-28 01:06:41 +00:00
Not-Saii commented 2026-11-28 00:04:28 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Not-Saii on 2026-11-28T00:04:28Z.


Change

The compute Dispatch refusal an output is not an aliased placed buffer range with unordered access covered several conditions. Each one now has its own reason in the refusal log line and the census. They are checked in this order:

  1. an output buffer descriptor is a view token
  2. an output buffer descriptor has zero records
  3. an output buffer range is over 16 MiB or not whole dwords
  4. an output range crosses the end of a placed buffer
  5. an output is in title memory outside any placed buffer
  6. an output is in a placed buffer that does not alias title memory (a copied placement)
  7. an output buffer's resource was not created in the common state
  8. an output buffer range is not 16-byte aligned in its resource
  9. an output buffer has no unordered access

What is bound and what is refused do not change. The claim listed five conditions; "no placed buffer aliases the address" is split into reasons 2 to 6, because the input-side split showed one such sub-case can dominate. Reason 7 also covers an aliased resource with no recorded information, which no fixture reaches.

Output view tokens are not lowered here. #2961 binds buffer UAV tokens before these checks, so with it reason 1 is not reached. Both PRs edit the same placed line. Whichever lands second drops the token test from that line, and the texture-token case here then refuses with #2961's token reason. The fixture mode is named dispatch-output-texture-token so it does not clash with #2961's dispatch-output-token.

Tests

tests/startup_compute_dispatch_output_check.py (new, registered in tests/cmake/startup_compute_dispatch_output.cmake) dispatches case A through the stand-in's list. The unchanged recording matches all 320 words. Then each of the nine conditions is produced by one change to the output descriptor or its buffer: five new consumer modes, three X2W_TEST_DISPATCH_FIELDS values, and the existing dispatch-swapped. Each case checks its refusal line, the census reason line and that every output word keeps its sentinel. The common-state case also checks that the slot 133 log shows its buffer as aliased.

startup_compute_dispatch_check.py now expects an output buffer has no unordered access for dispatch-swapped.

Test WARP RTX 4090
startup_compute_dispatch pass pass
startup_compute_dispatch_output pass pass
startup_compute_dispatch_input pass not run

The debug layer was enabled and reported no errors.

Negative control: with only the d3d12_compute_dispatch.inl change reverted (local, restored), both tests fail. Run one by one against that build, all nine cases are still refused, each with the old message, and the output stays untouched, so 9/9 per-reason expectations fail. The unchanged dispatch still matches, so the same cases are refused before and after.

A texture view created at heap byte 16, which is not a whole descriptor slot, ends the consumer with exit 2173. The fixture creates the view at byte 64 and copies its token words into the output's entry. I did not investigate that exit; it is existing behavior.

Commands

cmake --build --preset dev --target startup_stream_consumer
ctest --preset dev --no-tests=error -R "^startup_compute_dispatch(_output)?_(warp|hardware)$" -V
ctest --preset dev --no-tests=error -R "^startup_compute_dispatch_input_warp$" -V

tests/docs_links_check.py and tests/bidi_controls_check.py pass.

Environment

Tested at b732c44b on main ad306425; the last commit only adds results to the note. Windows 11 build 26300, MSVC (dev preset, Debug), Windows SDK 10.0.26100, DXC from that SDK. WARP 10.0.26100.9818. NVIDIA GeForce RTX 4090, driver 32.0.16.1088.

Measurement

Counts only, from one local 300 s start-up run of this build (79edac55; translator at ad306425, whose gfx2hlsl.py is unchanged since 2e12dd8e). The census keeps each key's first refusal and counts all of its untranslated dispatches under it, so these are first-refusal buckets, not counts per condition. The 25 keys whose first refusal was the old reason in a run of the parent build (505,473 of 5,490,863 compute dispatches) fall in two buckets here. For 23 keys (141,224 dispatches) the first refusal is a view token, and in each key's first refused dispatch the token names a device slot 19 view. For 2 keys (2,015 dispatches) the first refusal is zero records, with an all-zero descriptor. No key had reasons 3 to 9 as its first refusal; later dispatches were not recorded per condition. A second run with #2961 merged locally translates every dispatch of 12 of the 23 token keys. 10 have as first refusal an entry value that reads the output descriptor, and 1 has its view range as first refusal. Details are in the note and on #3224, and no second implementation PR follows from these counts.

Refs #3224

AI-assisted.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5534735645 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3229). Originally posted by [Not-Saii](https://github.com/Not-Saii) on 2026-11-28T00:04:28Z. --- ## Change The compute Dispatch refusal `an output is not an aliased placed buffer range with unordered access` covered several conditions. Each one now has its own reason in the refusal log line and the census. They are checked in this order: 1. `an output buffer descriptor is a view token` 2. `an output buffer descriptor has zero records` 3. `an output buffer range is over 16 MiB or not whole dwords` 4. `an output range crosses the end of a placed buffer` 5. `an output is in title memory outside any placed buffer` 6. `an output is in a placed buffer that does not alias title memory` (a copied placement) 7. `an output buffer's resource was not created in the common state` 8. `an output buffer range is not 16-byte aligned in its resource` 9. `an output buffer has no unordered access` What is bound and what is refused do not change. The claim listed five conditions; "no placed buffer aliases the address" is split into reasons 2 to 6, because the input-side split showed one such sub-case can dominate. Reason 7 also covers an aliased resource with no recorded information, which no fixture reaches. Output view tokens are not lowered here. #2961 binds buffer UAV tokens before these checks, so with it reason 1 is not reached. Both PRs edit the same `placed` line. Whichever lands second drops the token test from that line, and the texture-token case here then refuses with #2961's token reason. The fixture mode is named `dispatch-output-texture-token` so it does not clash with #2961's `dispatch-output-token`. ## Tests `tests/startup_compute_dispatch_output_check.py` (new, registered in `tests/cmake/startup_compute_dispatch_output.cmake`) dispatches case A through the stand-in's list. The unchanged recording matches all 320 words. Then each of the nine conditions is produced by one change to the output descriptor or its buffer: five new consumer modes, three `X2W_TEST_DISPATCH_FIELDS` values, and the existing `dispatch-swapped`. Each case checks its refusal line, the census reason line and that every output word keeps its sentinel. The common-state case also checks that the slot 133 log shows its buffer as aliased. `startup_compute_dispatch_check.py` now expects `an output buffer has no unordered access` for `dispatch-swapped`. | Test | WARP | RTX 4090 | |---|---|---| | `startup_compute_dispatch` | pass | pass | | `startup_compute_dispatch_output` | pass | pass | | `startup_compute_dispatch_input` | pass | not run | The debug layer was enabled and reported no errors. Negative control: with only the `d3d12_compute_dispatch.inl` change reverted (local, restored), both tests fail. Run one by one against that build, all nine cases are still refused, each with the old message, and the output stays untouched, so 9/9 per-reason expectations fail. The unchanged dispatch still matches, so the same cases are refused before and after. A texture view created at heap byte 16, which is not a whole descriptor slot, ends the consumer with exit 2173. The fixture creates the view at byte 64 and copies its token words into the output's entry. I did not investigate that exit; it is existing behavior. ## Commands ```powershell cmake --build --preset dev --target startup_stream_consumer ctest --preset dev --no-tests=error -R "^startup_compute_dispatch(_output)?_(warp|hardware)$" -V ctest --preset dev --no-tests=error -R "^startup_compute_dispatch_input_warp$" -V ``` `tests/docs_links_check.py` and `tests/bidi_controls_check.py` pass. ## Environment Tested at `b732c44b` on `main` `ad306425`; the last commit only adds results to the note. Windows 11 build 26300, MSVC (dev preset, Debug), Windows SDK 10.0.26100, DXC from that SDK. WARP 10.0.26100.9818. NVIDIA GeForce RTX 4090, driver 32.0.16.1088. ## Measurement Counts only, from one local 300 s start-up run of this build (`79edac55`; translator at `ad306425`, whose `gfx2hlsl.py` is unchanged since `2e12dd8e`). The census keeps each key's first refusal and counts all of its untranslated dispatches under it, so these are first-refusal buckets, not counts per condition. The 25 keys whose first refusal was the old reason in a run of the parent build (505,473 of 5,490,863 compute dispatches) fall in two buckets here. For 23 keys (141,224 dispatches) the first refusal is a view token, and in each key's first refused dispatch the token names a device slot 19 view. For 2 keys (2,015 dispatches) the first refusal is zero records, with an all-zero descriptor. No key had reasons 3 to 9 as its first refusal; later dispatches were not recorded per condition. A second run with #2961 merged locally translates every dispatch of 12 of the 23 token keys. 10 have as first refusal an entry value that reads the output descriptor, and 1 has its view range as first refusal. Details are in the note and on #3224, and no second implementation PR follows from these counts. Refs #3224 AI-assisted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
R0Y00 commented 2026-11-28 00:38:47 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T00:38:47Z.

Review: CHANGES_REQUESTED


Reviewed de0303d0c5. Its runtime and test files match the independently tested candidate: Debug and Release /O2 each passed all six dispatch, output and input tests on WARP and RTX 4060 Laptop, with no skips. The runtime split is scoped to diagnostics.

Please correct the claim that a startup run “gives the count of every condition” and the interpretation of the two tables. The census records the first refusal once per key (d3d12_compute_dispatch.inl:609–612) and attributes all untranslated invocations of that key to that bucket (713–717). Later invocations can hit different conditions, and the detailed lines are capped. Please label these as first-refusal buckets and qualify zero rows as “no key had this first refusal.” The synthetic nine-way controls can keep their exact per-case statements because each exercises one condition. The PR can keep its current runtime scope.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6094680568 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3229#pullrequestreview-6094680568). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-28T00:38:47Z. **Review:** CHANGES_REQUESTED --- Reviewed de0303d0c53ca756e8dd4a86682c47052bed47d9. Its runtime and test files match the independently tested candidate: Debug and Release /O2 each passed all six dispatch, output and input tests on WARP and RTX 4060 Laptop, with no skips. The runtime split is scoped to diagnostics. Please correct the claim that a startup run “gives the count of every condition” and the interpretation of the two tables. The census records the first refusal once per key (d3d12_compute_dispatch.inl:609–612) and attributes all untranslated invocations of that key to that bucket (713–717). Later invocations can hit different conditions, and the detailed lines are capped. Please label these as first-refusal buckets and qualify zero rows as “no key had this first refusal.” The synthetic nine-way controls can keep their exact per-case statements because each exercises one condition. The PR can keep its current runtime scope.
Not-Saii commented 2026-11-28 00:47:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Not-Saii on 2026-11-28T00:47:10Z.


Thanks, you're right: the census keeps one first refusal per key and counts every untranslated dispatch of that key under it. Fixed in 797954e1:

  • The note no longer says a run "gives the count of every condition". It describes the census as first-refusal buckets, and says a later dispatch of a key can fail on another condition and that the per-call lines are capped.
  • Both tables are labelled as first-refusal buckets with untranslated dispatches. The zero row now reads "no key had one of these first refusals".
  • Statements about the token slot and the all-zero descriptor now refer to each key's first refused dispatch.
  • The synthetic per-case statements are unchanged.

I updated the PR body's Measurement section and both counts comments on #3224 the same way. The runtime scope is unchanged.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7231189836 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3229#issuecomment-7231189836). Originally posted by [Not-Saii](https://github.com/Not-Saii) on 2026-11-28T00:47:10Z. --- Thanks, you're right: the census keeps one first refusal per key and counts every untranslated dispatch of that key under it. Fixed in 797954e1: - The note no longer says a run "gives the count of every condition". It describes the census as first-refusal buckets, and says a later dispatch of a key can fail on another condition and that the per-call lines are capped. - Both tables are labelled as first-refusal buckets with untranslated dispatches. The zero row now reads "no key had one of these first refusals". - Statements about the token slot and the all-zero descriptor now refer to each key's first refused dispatch. - The synthetic per-case statements are unchanged. I updated the PR body's Measurement section and both counts comments on #3224 the same way. The runtime scope is unchanged. AI-assisted.
R0Y00 commented 2026-11-28 01:06:37 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T01:06:37Z.

Review: APPROVED


The requested census wording is resolved at 797954e1ea. The tables distinguish first-refusal buckets from individual dispatches and now limit observations to the first refused dispatch per key. The diagnostic split and nine source-built controls are unchanged.

Independently tested this head over main 7364e6a9, candidate tree 4aab644fee. Debug and Release /O2 each passed all six dispatch, input and output tests on WARP and RTX, zero skips. The unchanged reference compares 320 words; each refusal preserves every sentinel. Windows 11 26200.9974, RTX 4060 Laptop driver 32.0.16.1656, WARP 10.0.26100.9818.

ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^startup_compute_dispatch(_output|_input)?_(warp|hardware)$'
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6094813604 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3229#pullrequestreview-6094813604). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-28T01:06:37Z. **Review:** APPROVED --- The requested census wording is resolved at 797954e1ea26cfa8f05c7949a6adceb6182aa86b. The tables distinguish first-refusal buckets from individual dispatches and now limit observations to the first refused dispatch per key. The diagnostic split and nine source-built controls are unchanged. Independently tested this head over main 7364e6a9, candidate tree 4aab644fee01b27113baf6e3925fdae25c8be3a4. Debug and Release /O2 each passed all six dispatch, input and output tests on WARP and RTX, zero skips. The unchanged reference compares 320 words; each refusal preserves every sentinel. Windows 11 26200.9974, RTX 4060 Laptop driver 32.0.16.1656, WARP 10.0.26100.9818. ```powershell ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^startup_compute_dispatch(_output|_input)?_(warp|hardware)$' ```
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!3229
No description provided.