Skip to content

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

Merged
MasterDomino merged 7 commits into
R0Y00:mainfrom
tedin7:fix-compute-texture-uav-denied
Nov 26, 2026
Merged

MasterDomino merged 7 commits into
R0Y00:mainfrom
tedin7:fix-compute-texture-uav-denied

Conversation

@tedin7

@tedin7 tedin7 commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

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 runtime: give unknown-dimension views a default view and skip mismatched ones #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.

…reated

A view the desktop does not create for lack of the unordered access flag left no record since the skipped-view rework, so a translated compute Dispatch saw no view token and refused with another reason than the one startup_compute_dispatch_texture expects. Record it as not created again; skips for a mismatched dimension keep leaving the previous record alone.
@RavenCurseBurg

RavenCurseBurg commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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).

@tedin7

tedin7 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

@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.

@tedin7
tedin7 marked this pull request as ready for review November 26, 2026 03:49
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/startup_stubs/d3d12_xs_device.cpp Resolved
Comment thread src/startup_stubs/d3d12_capture.inl Resolved

Copy link
Copy Markdown
Contributor

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

@tedin7

tedin7 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

@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.

@MasterDomino MasterDomino left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@MasterDomino
MasterDomino merged commit 786970a into R0Y00:main Nov 26, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants