startup: name each refused slot-19 output view interval #3387

Merged
Not-Saii merged 3 commits from upstream-pr/3387 into main 2026-11-28 19:34:10 +00:00
Not-Saii commented 2026-11-28 18:07:09 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Not-Saii on 2026-11-28T18:07:09Z.


Refs #3224

The slot-19 output-token path (#3094) refused six byte-interval conditions with one message, an output UAV interval is unaligned, oversized or outside its buffer. In the 900 s census on #3224, that message is the largest runtime refusal: one shader, 1,146,106 dispatches. This PR gives each condition its own reason, in the same order, so a run shows which one fails. It is the same approach as #3229. The accepted and refused sets do not change.

# Reason Fixture
1 an output UAV interval is empty none (see below)
2 an output UAV interval is not whole dwords R16_UINT view, 1 element
3 an output UAV interval is over 16 MiB raw view, 16 MiB + 16 bytes of a committed 16 MiB + 64 KiB buffer
4 an output UAV interval is not 16-byte aligned in its buffer R32_UINT view at byte 4
5 an output UAV interval starts past its buffer none
6 an output UAV interval crosses the end of its buffer none

Reasons 1, 5 and 6 need a view that D3D12 rejects when it is created. With the debug layer on, CreateUnorderedAccessView removes the device (measured on WARP and the RTX 4090), so no fixture creates such a view. The stand-in checks the same desktop buffer width that D3D12 validated.

Fixture. tests/startup_compute_token_interval_check.py uses case A of startup_gfx2hlsl_compute_check.py with 32-byte table records, published through gfx2hlsl.py --pending.

  • A raw slot-19 view at byte 16 of the placed output buffer binds. Words 4-315 match the CPU reference.
  • Each case above replaces the view through X2W_TEST_DISPATCH_UAV. Each is refused with its own reason in the log and the census, and every word keeps its sentinel.
  • Consumer change: byte 32 of the four-descriptor heap is not a descriptor on WARP, and a view created there exits with 2173. The dispatch-uav-token-* modes now create the view at byte 64 and copy the token to byte 32, as dispatch-output-texture-token already does.

Test (commit 61bdb434 on main d418f70e, Windows 11 build 26300, debug layer on):

ctest --preset dev --no-tests=error -R "^startup_compute_token_interval_(warp|hardware)$" -V
  • startup_compute_token_interval_warp: pass (Microsoft Basic Render Driver 10.0.26100.9818)
  • startup_compute_token_interval_hardware: pass (NVIDIA GeForce RTX 4090, driver 32.0.16.1088)
  • Negative control: with only the .inl change reverted, all 3 per-reason expectations fail. Each case is still refused, with the old message.
  • native_compute_pack_hardware (uses the same dispatch-uav-token-* modes): pass on the RTX 4090; each of the five slot-19 modes reads back its expected 320 words (bound modes written, refused modes untouched), debug layer on

Next on #3224: find which condition the 1.15M-dispatch shader hits. The existing once-per-key x2w-draw compute UAV line already logs the view's format, element range, stride, flags, backing width, offset and byte count.

AI-assisted.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5543136899 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3387). Originally posted by [Not-Saii](https://github.com/Not-Saii) on 2026-11-28T18:07:09Z. --- Refs #3224 The slot-19 output-token path (#3094) refused six byte-interval conditions with one message, `an output UAV interval is unaligned, oversized or outside its buffer`. In the 900 s census on #3224, that message is the largest runtime refusal: one shader, 1,146,106 dispatches. This PR gives each condition its own reason, in the same order, so a run shows which one fails. It is the same approach as #3229. The accepted and refused sets do not change. | # | Reason | Fixture | |---|---|---| | 1 | `an output UAV interval is empty` | none (see below) | | 2 | `an output UAV interval is not whole dwords` | R16_UINT view, 1 element | | 3 | `an output UAV interval is over 16 MiB` | raw view, 16 MiB + 16 bytes of a committed 16 MiB + 64 KiB buffer | | 4 | `an output UAV interval is not 16-byte aligned in its buffer` | R32_UINT view at byte 4 | | 5 | `an output UAV interval starts past its buffer` | none | | 6 | `an output UAV interval crosses the end of its buffer` | none | Reasons 1, 5 and 6 need a view that D3D12 rejects when it is created. With the debug layer on, `CreateUnorderedAccessView` removes the device (measured on WARP and the RTX 4090), so no fixture creates such a view. The stand-in checks the same desktop buffer width that D3D12 validated. **Fixture.** `tests/startup_compute_token_interval_check.py` uses case A of `startup_gfx2hlsl_compute_check.py` with 32-byte table records, published through `gfx2hlsl.py --pending`. - A raw slot-19 view at byte 16 of the placed output buffer binds. Words 4-315 match the CPU reference. - Each case above replaces the view through `X2W_TEST_DISPATCH_UAV`. Each is refused with its own reason in the log and the census, and every word keeps its sentinel. - Consumer change: byte 32 of the four-descriptor heap is not a descriptor on WARP, and a view created there exits with 2173. The `dispatch-uav-token-*` modes now create the view at byte 64 and copy the token to byte 32, as `dispatch-output-texture-token` already does. **Test** (commit `61bdb434` on `main` `d418f70e`, Windows 11 build 26300, debug layer on): ```powershell ctest --preset dev --no-tests=error -R "^startup_compute_token_interval_(warp|hardware)$" -V ``` - `startup_compute_token_interval_warp`: pass (Microsoft Basic Render Driver 10.0.26100.9818) - `startup_compute_token_interval_hardware`: pass (NVIDIA GeForce RTX 4090, driver 32.0.16.1088) - Negative control: with only the `.inl` change reverted, all 3 per-reason expectations fail. Each case is still refused, with the old message. - `native_compute_pack_hardware` (uses the same `dispatch-uav-token-*` modes): pass on the RTX 4090; each of the five slot-19 modes reads back its expected 320 words (bound modes written, refused modes untouched), debug layer on Next on #3224: find which condition the 1.15M-dispatch shader hits. The existing once-per-key `x2w-draw compute UAV` line already logs the view's format, element range, stride, flags, backing width, offset and byte count. AI-assisted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Leyukaka commented 2026-11-28 19:34:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T19:34:07Z.

Review: APPROVED


Review of 61bdb434.

  • The change splits one refusal condition into named reasons; the accepted and refused sets are unchanged.
  • Run here in Windows Sandbox, network off, vGPU, Windows 11 build 26300 host, release build of main f2972840 with this PR and 17 other open PRs merged locally: startup_compute_token_interval_warp and _hardware pass. Raising the 16 MiB bound to 32 MiB makes both fail.

Not covered: three of the new reasons have no fixture, so swapping two of their messages would pass.

Approve.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6099772529 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3387#pullrequestreview-6099772529). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-28T19:34:07Z. **Review:** APPROVED --- Review of `61bdb434`. - The change splits one refusal condition into named reasons; the accepted and refused sets are unchanged. - Run here in Windows Sandbox, network off, vGPU, Windows 11 build 26300 host, release build of `main` `f2972840` with this PR and 17 other open PRs merged locally: `startup_compute_token_interval_warp` and `_hardware` pass. Raising the 16 MiB bound to 32 MiB makes both fail. Not covered: three of the new reasons have no fixture, so swapping two of their messages would pass. Approve.
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!3387
No description provided.