startup: record a UAV of a resource without unordered access as not created #2702

Merged
tedin7 merged 7 commits from upstream-pr/2710 into main 2026-11-26 05:35:09 +00:00
tedin7 commented 2026-11-26 03:02:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:02:02Z.


Part of #1723

What this unblocks: startup_compute_dispatch_texture_warp and _hardware (added by #2532), which fail on main at tests/startup_compute_dispatch_texture_check.py:101.

Cause

In the texture-store-denied case the title creates an unordered access view of a texture that lacks ALLOW_UNORDERED_ACCESS. The runtime skips the view. Before #2649 a skipped view was still recorded as "not created", and the title descriptor memory got a view token. The skip rework routes every skip through refuse_view, which for a UAV (slot 19) records nothing. A translated compute Dispatch then finds no view token and refuses with "an output texture entry is not the token of an unordered access view". The fixture expects "an output texture view was not created on the desktop".

Change

  • src/startup_stubs/d3d12_xs_device.cpp: remember that the skip came from the missing unordered access flag and record that UAV as not created in refuse_view, only when the descriptor does not already hold a view created on the desktop. Skips for a mismatched or unknown view dimension still leave the previous descriptor record alone, as #2649 intended.
  • src/startup_stubs/d3d12_capture.inl: descriptor_has_live_view (a refused creation must not replace a live UAV, whether the view was created in that slot or its token was copied there in title memory).
  • tests/startup_stream_consumer.cpp, tests/startup_compute_dispatch_texture_check.py: new texture-store-occupied and texture-store-copied cases; the first or copied view stays and the Dispatch still writes the texture (GPU readback).

Verification

Linux:

  • git diff --check origin/main..HEAD: clean
  • python3 tests/bidi_controls_check.py, python3 tests/docs_links_check.py: ok

Win2025 on head e6dfa885 (dev and release, default slot pool):

cmake --build --preset dev --target startup_stream_consumer d3d12_xs_shim
ctest --preset dev --no-tests=error -R "^startup_(compute_dispatch|pixel_uav)" -V
  • dev: 13/13 passed (texture, heap, dispatch and pixel UAV tests, WARP and hardware adapter)
  • release: 13/13 passed, same tests
  • Negative control (occupied-slot case, measured on 5accaeae): with the live-view check removed, both startup_compute_dispatch_texture_* tests fail in the occupied-slot case (startup_compute_dispatch_texture_check.py:106): the Dispatch is refused with "an output texture view was not created on the desktop".

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6618559705 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2710). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:02:02Z. --- Part of #1723 What this unblocks: `startup_compute_dispatch_texture_warp` and `_hardware` (added by #2532), which fail on main at `tests/startup_compute_dispatch_texture_check.py:101`. ## Cause In the `texture-store-denied` case the title creates an unordered access view of a texture that lacks `ALLOW_UNORDERED_ACCESS`. The runtime skips the view. Before #2649 a skipped view was still recorded as "not created", and the title descriptor memory got a view token. The skip rework routes every skip through `refuse_view`, which for a UAV (slot 19) records nothing. A translated compute Dispatch then finds no view token and refuses with "an output texture entry is not the token of an unordered access view". The fixture expects "an output texture view was not created on the desktop". ## Change - `src/startup_stubs/d3d12_xs_device.cpp`: remember that the skip came from the missing unordered access flag and record that UAV as not created in `refuse_view`, only when the descriptor does not already hold a view created on the desktop. Skips for a mismatched or unknown view dimension still leave the previous descriptor record alone, as #2649 intended. - `src/startup_stubs/d3d12_capture.inl`: `descriptor_has_live_view` (a refused creation must not replace a live UAV, whether the view was created in that slot or its token was copied there in title memory). - `tests/startup_stream_consumer.cpp`, `tests/startup_compute_dispatch_texture_check.py`: new `texture-store-occupied` and `texture-store-copied` cases; the first or copied view stays and the Dispatch still writes the texture (GPU readback). ## Verification Linux: - `git diff --check origin/main..HEAD`: clean - `python3 tests/bidi_controls_check.py`, `python3 tests/docs_links_check.py`: ok Win2025 on head `e6dfa885` (dev and release, default slot pool): ``` cmake --build --preset dev --target startup_stream_consumer d3d12_xs_shim ctest --preset dev --no-tests=error -R "^startup_(compute_dispatch|pixel_uav)" -V ``` - dev: 13/13 passed (texture, heap, dispatch and pixel UAV tests, WARP and hardware adapter) - release: 13/13 passed, same tests - Negative control (occupied-slot case, measured on `5accaeae`): with the live-view check removed, both `startup_compute_dispatch_texture_*` tests fail in the occupied-slot case (`startup_compute_dispatch_texture_check.py:106`): the Dispatch is refused with "an output texture view was not created on the desktop". AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-26 04:04:29 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T03:55:09Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5accaeaeec

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068334049 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2710#pullrequestreview-6068334049). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T03:55:09Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `5accaeaeec` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
RavenCurseBurg commented 2026-11-26 04:04:39 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-26T03:27:07Z.


I built 2484b5ab and ran the registered texture fixture on Intel UHD 770, RTX 4060 and WARP. All three passed the original fresh-slot case, the 1,024-half texture output, and the 320-word sampled input. I also found a regression in the occupied-slot case.

  • Create a valid RGBA16_FLOAT 2D UAV at table byte 64 as in texture-store. Immediately attempt slot 19 again at exactly that handle, with the same view description and a different texture created with D3D12_RESOURCE_FLAG_NONE. Then dispatch the original translated shader and read the first texture.
  • With the base runtime source, the second creation logs view skipped: resource lacks unordered access, and the original UAV remains usable. All 1,024 halves match the reference, including the 64 changed ones. The comparison binary came from 5bc3211c, whose entire src/ tree matches this PR's parent d1cf6688.
  • On 2484b5ab the same second creation is skipped, then Dispatch refuses with an output texture view was not created on the desktop. All 1,024 halves retain their sentinel, giving 64 mismatches. Omitting only the second creation restores all 64 writes on both builds. Each of the three backends produced the same four results.

The new record_view(false) also replaces the descriptor record when the slot already has a live view. The desktop heap still contains the earlier UAV. Could the handler preserve an existing materialized record while giving a previously empty slot the desired refusal? Both fresh and occupied slots would make useful fixture cases.

The two-file regression test applies directly to this head. On the original PR all three backends fail its new assertion with exactly 64 mismatched halves. As a diagnostic I recorded the denied UAV only when shadow_id(args[D]) was zero. With that change the full registered texture fixture, including both the fresh and the occupied slot, passed on all three. These runs used serial writes to a descriptor.

Windows 11 26100.9711, Zig/Clang 0.13.0, DXC 1.9.2609. Intel driver 32.0.101.5973, NVIDIA 32.0.15.9579, WARP 10.0.26100.9711. Debug layer unavailable. AI-assisted with Codex (GPT-6.2 Astra, xhigh).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7181730800 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2710#issuecomment-7181730800). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-26T03:27:07Z. --- I built `2484b5ab` and ran the registered texture fixture on Intel UHD 770, RTX 4060 and WARP. All three passed the original fresh-slot case, the 1,024-half texture output, and the 320-word sampled input. I also found a regression in the occupied-slot case. - Create a valid RGBA16_FLOAT 2D UAV at table byte 64 as in `texture-store`. Immediately attempt slot 19 again at exactly that handle, with the same view description and a different texture created with `D3D12_RESOURCE_FLAG_NONE`. Then dispatch the original translated shader and read the first texture. - With the base runtime source, the second creation logs `view skipped: resource lacks unordered access`, and the original UAV remains usable. All 1,024 halves match the reference, including the 64 changed ones. The comparison binary came from `5bc3211c`, whose entire `src/` tree matches this PR's parent `d1cf6688`. - On `2484b5ab` the same second creation is skipped, then Dispatch refuses with `an output texture view was not created on the desktop`. All 1,024 halves retain their sentinel, giving 64 mismatches. Omitting only the second creation restores all 64 writes on both builds. Each of the three backends produced the same four results. The new `record_view(false)` also replaces the descriptor record when the slot already has a live view. The desktop heap still contains the earlier UAV. Could the handler preserve an existing materialized record while giving a previously empty slot the desired refusal? Both fresh and occupied slots would make useful fixture cases. The [two-file regression test](https://github.com/RavenCurseBurg/Xbox2Windows/commit/4af512252ee82468eb43e779e76b8591a6229741) applies directly to this head. On the original PR all three backends fail its new assertion with exactly 64 mismatched halves. As a diagnostic I recorded the denied UAV only when `shadow_id(args[D])` was zero. With that change the full registered texture fixture, including both the fresh and the occupied slot, passed on all three. These runs used serial writes to a descriptor. Windows 11 26100.9711, Zig/Clang 0.13.0, DXC 1.9.2609. Intel driver 32.0.101.5973, NVIDIA 32.0.15.9579, WARP 10.0.26100.9711. Debug layer unavailable. AI-assisted with Codex (GPT-6.2 Astra, xhigh).
tedin7 commented 2026-11-26 04:04:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:46:11Z.


@RavenCurseBurg thank you, the occupied-slot case was a real regression. Fixed in 5accaeae (fix commit 737762fa, plus a merge of main).

  • Cause: the refused slot-19 creation always called record_view(false), which replaced the descriptor record even when the desktop heap still held the earlier UAV.
  • Fix: the refusal now records "not created" only when the descriptor does not already hold a view created on the desktop (desktop_slot_has_live_view, d3d12_capture.inl). A fresh slot keeps the desired refusal. An occupied slot keeps its record, so Dispatch still writes the first texture.
  • Fixture cases: texture-store-denied is the fresh slot, still refused. New texture-store-occupied creates the valid UAV at table byte 64 and then asks for slot 19 at the same handle over a D3D12_RESOURCE_FLAG_NONE texture. It checks all 1,024 halves and the translated Dispatch. Both are in startup_compute_dispatch_texture_check.py.
  • Fails before, passes after: with the guard reverted locally on 5accaeae, startup_compute_dispatch_texture_warp and _hardware fail with occupied slot: half=0 (64 halves differ), the same 64 as your run. With the fix they pass.

Verification (Windows Server 2025, build 26100, D3D12 WARP, head 5accaeae):

  • x2w_pipe.py win2025 2710 --wt . : dev + release builds of d3d12_xs_device_obj d3d12_xs_shim startup_stream_consumer, PASS.
  • x2w_pipe.py win2025 2710 --wt . --force --regex startup_compute_dispatch : dev 6/6 and release 6/6 passed (heap, plain and texture, WARP and hardware adapter).
  • CI on the head: Windows build and test, Linux Python checks and gfx1013 fixtures green.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182007462 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2710#issuecomment-7182007462). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T03:46:11Z. --- @RavenCurseBurg thank you, the occupied-slot case was a real regression. Fixed in `5accaeae` (fix commit `737762fa`, plus a merge of main). - **Cause:** the refused slot-19 creation always called `record_view(false)`, which replaced the descriptor record even when the desktop heap still held the earlier UAV. - **Fix:** the refusal now records "not created" only when the descriptor does not already hold a view created on the desktop (`desktop_slot_has_live_view`, `d3d12_capture.inl`). A fresh slot keeps the desired refusal. An occupied slot keeps its record, so Dispatch still writes the first texture. - **Fixture cases:** `texture-store-denied` is the fresh slot, still refused. New `texture-store-occupied` creates the valid UAV at table byte 64 and then asks for slot 19 at the same handle over a `D3D12_RESOURCE_FLAG_NONE` texture. It checks all 1,024 halves and the translated Dispatch. Both are in `startup_compute_dispatch_texture_check.py`. - **Fails before, passes after:** with the guard reverted locally on `5accaeae`, `startup_compute_dispatch_texture_warp` and `_hardware` fail with `occupied slot: half=0 (64 halves differ)`, the same 64 as your run. With the fix they pass. Verification (Windows Server 2025, build 26100, D3D12 WARP, head `5accaeae`): - `x2w_pipe.py win2025 2710 --wt .` : dev + release builds of `d3d12_xs_device_obj d3d12_xs_shim startup_stream_consumer`, PASS. - `x2w_pipe.py win2025 2710 --wt . --force --regex startup_compute_dispatch` : dev 6/6 and release 6/6 passed (heap, plain and texture, WARP and hardware adapter). - CI on the head: Windows build and test, Linux Python checks and gfx1013 fixtures green. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-26 04:04:43 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T03:49:30Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T03:55:12.820718Z 5accaea Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182055243 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2710#issuecomment-7182055243). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T03:49:30Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"5accaeaeec69b9756196caa303ca33779c683d28","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-26T03:55:12.820718Z">2026-11-26T03:55:12.820718Z</relative-time> | `5accaea` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
chatgpt-codex-connector[bot commented 2026-11-26 04:04:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T03:55:10Z.

Code review location: src/startup_stubs/d3d12_xs_device.cpp; line 4370

@@ -4360,6 +4364,10 @@ __declspec(noinline) u64 view_slot(Wrapper* self, u64 a, u64 b, u64 c, u64 d)
             record_view(false);
         } else if constexpr (N == 17) {
             record_view(false);  // Translated constant-buffer views use only the descriptor record.
+        } else if constexpr (N == 19) {
+            // A translated compute Dispatch tells this refusal from a descriptor that holds no view by the record.
+            // A refused creation leaves a descriptor that still holds a live view as it is.
+            if (uav_denied && !desktop_slot_has_live_view(args[D])) record_view(false);

P1 Badge Update the pixel-UAV denial assertion for the new token

When running startup_pixel_uav_warp or its supported hardware counterpart, the existing no-ua case creates a denied UAV in an empty slot, so this branch now writes a token. resolve_pixel_uavs() consequently reaches pixel_uav_view() and logs resource lacks ALLOW_UNORDERED_ACCESS, but tests/startup_pixel_uav_check.py:49 still requires table entry holds no view. Its verdict() rejects the changed diagnostic at lines 163–164, causing these registered tests to fail despite correctly refusing the draw and preserving the texture. Update that control's expected reason alongside this behavior change.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4703710104 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2710#discussion_r4703710104). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T03:55:10Z. **Code review location:** `src/startup_stubs/d3d12_xs_device.cpp`; line 4370 ~~~~diff @@ -4360,6 +4364,10 @@ __declspec(noinline) u64 view_slot(Wrapper* self, u64 a, u64 b, u64 c, u64 d) record_view(false); } else if constexpr (N == 17) { record_view(false); // Translated constant-buffer views use only the descriptor record. + } else if constexpr (N == 19) { + // A translated compute Dispatch tells this refusal from a descriptor that holds no view by the record. + // A refused creation leaves a descriptor that still holds a live view as it is. + if (uav_denied && !desktop_slot_has_live_view(args[D])) record_view(false); ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Update the pixel-UAV denial assertion for the new token** When running `startup_pixel_uav_warp` or its supported hardware counterpart, the existing `no-ua` case creates a denied UAV in an empty slot, so this branch now writes a token. `resolve_pixel_uavs()` consequently reaches `pixel_uav_view()` and logs `resource lacks ALLOW_UNORDERED_ACCESS`, but `tests/startup_pixel_uav_check.py:49` still requires `table entry holds no view`. Its `verdict()` rejects the changed diagnostic at lines 163–164, causing these registered tests to fail despite correctly refusing the draw and preserving the texture. Update that control's expected reason alongside this behavior change. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
chatgpt-codex-connector[bot commented 2026-11-26 04:04:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T03:55:10Z.

Code review location: src/startup_stubs/d3d12_capture.inl; line 116

@@ -107,6 +107,16 @@ std::uint32_t shadow_id(u64 desktop_handle)
     ReleaseSRWLockShared(&note_lock);
     return id;
 }
+// True when the desktop descriptor already holds a view that was created on the desktop.
+bool desktop_slot_has_live_view(u64 desktop_handle)
+{
+    AcquireSRWLockShared(&note_lock);
+    const std::uint32_t* slot = shadow_slot(desktop_handle);
+    const std::uint32_t id = slot ? *slot : 0;
+    const bool live = id && id - 1 < view_records().size() && view_materialized()[id - 1];

P2 Badge Preserve materialized UAV tokens copied through title memory

If the caller copies a valid UAV token into an unused title-memory descriptor slot with memcpy—a supported path described in d3d12_xs_device.cpp:4214–4216—the destination has a materialized token but no desktop shadow entry. This helper therefore returns false, and the new denial path overwrites that valid token with an unmaterialized record. Since dispatch_translated() resolves texture bindings directly from the title bytes (d3d12_compute_dispatch.inl:179–199), a subsequent Dispatch now refuses a copied binding that previously survived the rejected creation. Include the existing title-memory token in the occupied-slot check and cover this case alongside direct view creation.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4703710108 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2710#discussion_r4703710108). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T03:55:10Z. **Code review location:** `src/startup_stubs/d3d12_capture.inl`; line 116 ~~~~diff @@ -107,6 +107,16 @@ std::uint32_t shadow_id(u64 desktop_handle) ReleaseSRWLockShared(&note_lock); return id; } +// True when the desktop descriptor already holds a view that was created on the desktop. +bool desktop_slot_has_live_view(u64 desktop_handle) +{ + AcquireSRWLockShared(&note_lock); + const std::uint32_t* slot = shadow_slot(desktop_handle); + const std::uint32_t id = slot ? *slot : 0; + const bool live = id && id - 1 < view_records().size() && view_materialized()[id - 1]; ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Preserve materialized UAV tokens copied through title memory** If the caller copies a valid UAV token into an unused title-memory descriptor slot with `memcpy`—a supported path described in `d3d12_xs_device.cpp:4214–4216`—the destination has a materialized token but no desktop shadow entry. This helper therefore returns false, and the new denial path overwrites that valid token with an unmaterialized record. Since `dispatch_translated()` resolves texture bindings directly from the title bytes (`d3d12_compute_dispatch.inl:179–199`), a subsequent Dispatch now refuses a copied binding that previously survived the rejected creation. Include the existing title-memory token in the occupied-slot check and cover this case alongside direct view creation. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
tedin7 commented 2026-11-26 05:02:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:14:25Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068462247 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2710#pullrequestreview-6068462247). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:14:25Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-26 05:02:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:14:30Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068462692 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2710#pullrequestreview-6068462692). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:14:30Z. **Review:** COMMENTED --- _No description provided._
RonLogic commented 2026-11-26 05:02:24 +00:00 (Migrated from github.com)

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


Independent Windows Release rerun at 2aa18479991a762f3734f21f01ecaa19c7c4c0bd: 10/10 passed, no skips on WARP 10.0.26100.10068 and RTX 4070 driver 32.0.16.2124 (Windows 11 build 26300.10075). This included the occupied and title-memory-copied UAV token controls, both pixel UAV tests, and both live-retry tests.

On the earlier head e6dfa885, WARP exited 2173 in texture-store-copied. With the updated test setup that copies from a distinct descriptor slot, both WARP and hardware passed on 2aa18479.

cmake --build --preset release --target startup_stream_consumer d3d12_xs_shim
ctest --preset release --no-tests=error -j 1 -R '^startup_(compute_dispatch|compute_live_retry|pixel_uav)' --output-on-failure
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182376872 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2710#issuecomment-7182376872). Originally posted by [RonLogic](https://github.com/RonLogic) on 2026-11-26T04:11:34Z. --- Independent Windows Release rerun at `2aa18479991a762f3734f21f01ecaa19c7c4c0bd`: **10/10 passed, no skips** on WARP 10.0.26100.10068 and RTX 4070 driver 32.0.16.2124 (Windows 11 build 26300.10075). This included the occupied and title-memory-copied UAV token controls, both pixel UAV tests, and both live-retry tests. On the earlier head `e6dfa885`, WARP exited 2173 in `texture-store-copied`. With the updated test setup that copies from a distinct descriptor slot, both WARP and hardware passed on `2aa18479`. ```powershell cmake --build --preset release --target startup_stream_consumer d3d12_xs_shim ctest --preset release --no-tests=error -j 1 -R '^startup_(compute_dispatch|compute_live_retry|pixel_uav)' --output-on-failure ```
tedin7 commented 2026-11-26 05:02:24 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:14:32Z.


@MasterDomino #2710 is ready for review and merge.

  • Head: 2aa18479991a762f3734f21f01ecaa19c7c4c0bd. Both bot threads (pixel-UAV denial reason, copied title-memory token) are fixed, answered and resolved. @RavenCurseBurg's occupied-slot case was fixed earlier in this PR.
  • CI: green on this head (Windows build and test, Linux Python checks, gfx1013 fixtures).
  • Win2025 (Server 2025, build 26100, D3D12 WARP): x2w_pipe.py win2025 2710 --wt . --force --regex 'startup_compute_dispatch|startup_pixel_uav|startup_.*uav' gave dev 13/13 and release 13/13 passed on 2aa18479, with the receipt [PASS] PR #2710@2aa18479.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182421265 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2710#issuecomment-7182421265). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:14:32Z. --- @MasterDomino #2710 is ready for review and merge. - Head: `2aa18479991a762f3734f21f01ecaa19c7c4c0bd`. Both bot threads (pixel-UAV denial reason, copied title-memory token) are fixed, answered and resolved. @RavenCurseBurg's occupied-slot case was fixed earlier in this PR. - CI: green on this head (Windows build and test, Linux Python checks, gfx1013 fixtures). - Win2025 (Server 2025, build 26100, D3D12 WARP): `x2w_pipe.py win2025 2710 --wt . --force --regex 'startup_compute_dispatch|startup_pixel_uav|startup_.*uav'` gave dev 13/13 and release 13/13 passed on `2aa18479`, with the receipt `[PASS] PR #2710@2aa18479`. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 05:02:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:14:25Z.

Code review location: src/startup_stubs/d3d12_xs_device.cpp; line 4370

@@ -4360,6 +4364,10 @@ __declspec(noinline) u64 view_slot(Wrapper* self, u64 a, u64 b, u64 c, u64 d)
             record_view(false);
         } else if constexpr (N == 17) {
             record_view(false);  // Translated constant-buffer views use only the descriptor record.
+        } else if constexpr (N == 19) {
+            // A translated compute Dispatch tells this refusal from a descriptor that holds no view by the record.
+            // A refused creation leaves a descriptor that still holds a live view as it is.
+            if (uav_denied && !desktop_slot_has_live_view(args[D])) record_view(false);

Real, thanks. A denied UAV in an empty slot is now recorded as not created, so the draw names the resource instead of the empty entry. no-ua in tests/startup_pixel_uav_check.py now expects uav 0 refused: resource lacks ALLOW_UNORDERED_ACCESS. Fixed in fe61a505 (head 2aa18479).

Verification (Windows Server 2025, WARP, head 2aa18479):

  • With the old expectation on the old test file, startup_pixel_uav_warp fails. With the new one it passes.
  • x2w_pipe.py win2025 2710 --wt . --force --regex 'startup_compute_dispatch|startup_pixel_uav|startup_.*uav': dev 13/13 and release 13/13 passed (includes startup_pixel_uav_warp and _hardware).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4703817110 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2710#discussion_r4703817110). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:14:25Z. **Code review location:** `src/startup_stubs/d3d12_xs_device.cpp`; line 4370 ~~~~diff @@ -4360,6 +4364,10 @@ __declspec(noinline) u64 view_slot(Wrapper* self, u64 a, u64 b, u64 c, u64 d) record_view(false); } else if constexpr (N == 17) { record_view(false); // Translated constant-buffer views use only the descriptor record. + } else if constexpr (N == 19) { + // A translated compute Dispatch tells this refusal from a descriptor that holds no view by the record. + // A refused creation leaves a descriptor that still holds a live view as it is. + if (uav_denied && !desktop_slot_has_live_view(args[D])) record_view(false); ~~~~ --- Real, thanks. A denied UAV in an empty slot is now recorded as not created, so the draw names the resource instead of the empty entry. `no-ua` in `tests/startup_pixel_uav_check.py` now expects `uav 0 refused: resource lacks ALLOW_UNORDERED_ACCESS`. Fixed in `fe61a505` (head `2aa18479`). Verification (Windows Server 2025, WARP, head `2aa18479`): - With the old expectation on the old test file, `startup_pixel_uav_warp` fails. With the new one it passes. - `x2w_pipe.py win2025 2710 --wt . --force --regex 'startup_compute_dispatch|startup_pixel_uav|startup_.*uav'`: dev 13/13 and release 13/13 passed (includes `startup_pixel_uav_warp` and `_hardware`). AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 05:02:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:14:30Z.

Code review location: src/startup_stubs/d3d12_capture.inl; line 116

@@ -107,6 +107,16 @@ std::uint32_t shadow_id(u64 desktop_handle)
     ReleaseSRWLockShared(&note_lock);
     return id;
 }
+// True when the desktop descriptor already holds a view that was created on the desktop.
+bool desktop_slot_has_live_view(u64 desktop_handle)
+{
+    AcquireSRWLockShared(&note_lock);
+    const std::uint32_t* slot = shadow_slot(desktop_handle);
+    const std::uint32_t id = slot ? *slot : 0;
+    const bool live = id && id - 1 < view_records().size() && view_materialized()[id - 1];

Real, thanks. The occupied check now also reads the descriptor's title-memory token: a materialized token the title copied there with its own memcpy counts as a live view, so the refused creation leaves it alone (descriptor_has_live_view(desktop, title) in d3d12_capture.inl, fe61a505). New fixture case texture-store-copied creates the UAV at slot 0, memcpy's its 32-byte token into the slot the shader binds, then attempts a denied creation there, and checks all 1,024 halves plus the translated Dispatch. It sits next to texture-store-denied and texture-store-occupied in startup_compute_dispatch_texture_check.py. Fixture follow-up in 2aa18479 (head).

Verification (Windows Server 2025, WARP, head 2aa18479):

  • With the title check removed, startup_compute_dispatch_texture_warp fails with copied token: half=0 (64 halves differ). With the fix it passes.
  • x2w_pipe.py win2025 2710 --wt . --force --regex 'startup_compute_dispatch|startup_pixel_uav|startup_.*uav': dev 13/13 and release 13/13 passed. CI on 2aa18479 is green.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4703817474 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2710#discussion_r4703817474). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T04:14:30Z. **Code review location:** `src/startup_stubs/d3d12_capture.inl`; line 116 ~~~~diff @@ -107,6 +107,16 @@ std::uint32_t shadow_id(u64 desktop_handle) ReleaseSRWLockShared(&note_lock); return id; } +// True when the desktop descriptor already holds a view that was created on the desktop. +bool desktop_slot_has_live_view(u64 desktop_handle) +{ + AcquireSRWLockShared(&note_lock); + const std::uint32_t* slot = shadow_slot(desktop_handle); + const std::uint32_t id = slot ? *slot : 0; + const bool live = id && id - 1 < view_records().size() && view_materialized()[id - 1]; ~~~~ --- Real, thanks. The occupied check now also reads the descriptor's title-memory token: a materialized token the title copied there with its own memcpy counts as a live view, so the refused creation leaves it alone (`descriptor_has_live_view(desktop, title)` in `d3d12_capture.inl`, `fe61a505`). New fixture case `texture-store-copied` creates the UAV at slot 0, memcpy's its 32-byte token into the slot the shader binds, then attempts a denied creation there, and checks all 1,024 halves plus the translated Dispatch. It sits next to `texture-store-denied` and `texture-store-occupied` in `startup_compute_dispatch_texture_check.py`. Fixture follow-up in `2aa18479` (head). Verification (Windows Server 2025, WARP, head `2aa18479`): - With the title check removed, `startup_compute_dispatch_texture_warp` fails with `copied token: half=0 (64 halves differ)`. With the fix it passes. - `x2w_pipe.py win2025 2710 --wt . --force --regex 'startup_compute_dispatch|startup_pixel_uav|startup_.*uav'`: dev 13/13 and release 13/13 passed. CI on `2aa18479` is green. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-26 06:01:52 +00:00
MasterDomino commented 2026-11-26 06:01:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T05:35:05Z.

Review: APPROVED


Approving 2aa18479 (13 commits behind main, merges cleanly; main hasn't touched the changed files since the base).

What changed. A denied slot-19 creation now records "not created" only when the descriptor holds no live view. A live view is either the desktop shadow entry or a materialized token the title copied into title memory. Dimension and packed-format skips still leave the earlier record, as #2649 intended.

Every reader of the new state that I found:

  • compute Dispatch now names "an output texture view was not created on the desktop";
  • the pixel UAV path names the missing ALLOW_UNORDERED_ACCESS;
  • ClearUnorderedAccessView* still refuses ("view was skipped at creation").

None of them treats the record as usable. Retire references are untouched, since they apply only to slot 18.

Environment: Windows 11 build 26300; AMD Radeon RX 9070 XT (driver 32.0.32029.2010); WARP 10.0.26100.9818; debug layer on, 0 errors; dev preset.

Runs: ctest --preset dev --no-tests=error -j 1 -R '^startup_(compute_dispatch|compute_live_retry|pixel_uav|view_|resource_retire|resource_desc)|uav': 62 passed, 0 failed, 2 capability skips (startup_view_heap_warp and _hardware: the adapter accepts the descriptors directly).

Negative controls: one-line mutants, each rebuilt and run against the dispatch-texture and pixel-UAV tests on WARP and hardware:

  • dropping the live-view guard fails the occupied case (64 halves differ);
  • dropping the title-memory token check fails the copied-token case (64 halves differ);
  • never recording the refusal fails at startup_compute_dispatch_texture_check.py:101 and in pixel no-ua;
  • recording the view as created survives. That's equivalent today, because every consumer re-checks the resource flag.

Note: in the occupied case the Dispatch writes the earlier texture. That's what the desktop heap still holds, and it matches the behaviour before #2649.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6069039591 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2710#pullrequestreview-6069039591). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-26T05:35:05Z. **Review:** APPROVED --- Approving `2aa18479` (13 commits behind `main`, merges cleanly; `main` hasn't touched the changed files since the base). **What changed.** A denied slot-19 creation now records "not created" only when the descriptor holds no live view. A live view is either the desktop shadow entry or a materialized token the title copied into title memory. Dimension and packed-format skips still leave the earlier record, as #2649 intended. **Every reader of the new state that I found:** - compute Dispatch now names "an output texture view was not created on the desktop"; - the pixel UAV path names the missing `ALLOW_UNORDERED_ACCESS`; - `ClearUnorderedAccessView*` still refuses ("view was skipped at creation"). None of them treats the record as usable. Retire references are untouched, since they apply only to slot 18. Environment: Windows 11 build 26300; AMD Radeon RX 9070 XT (driver 32.0.32029.2010); WARP 10.0.26100.9818; debug layer on, 0 errors; dev preset. **Runs:** `ctest --preset dev --no-tests=error -j 1 -R '^startup_(compute_dispatch|compute_live_retry|pixel_uav|view_|resource_retire|resource_desc)|uav'`: 62 passed, 0 failed, 2 capability skips (`startup_view_heap_warp` and `_hardware`: the adapter accepts the descriptors directly). **Negative controls:** one-line mutants, each rebuilt and run against the dispatch-texture and pixel-UAV tests on WARP and hardware: - dropping the live-view guard fails the occupied case (64 halves differ); - dropping the title-memory token check fails the copied-token case (64 halves differ); - never recording the refusal fails at `startup_compute_dispatch_texture_check.py:101` and in pixel `no-ua`; - recording the view as created survives. That's equivalent today, because every consumer re-checks the resource flag. **Note:** in the occupied case the Dispatch writes the earlier texture. That's what the desktop heap still holds, and it matches the behaviour before #2649. AI-assisted; commands listed were executed locally.
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!2702
No description provided.