startup: record a UAV of a resource without unordered access as not created #2702
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2710"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T03:02:02Z.
Part of #1723
What this unblocks:
startup_compute_dispatch_texture_warpand_hardware(added by #2532), which fail on main attests/startup_compute_dispatch_texture_check.py:101.Cause
In the
texture-store-deniedcase the title creates an unordered access view of a texture that lacksALLOW_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 throughrefuse_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 inrefuse_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: newtexture-store-occupiedandtexture-store-copiedcases; the first or copied view stays and the Dispatch still writes the texture (GPU readback).Verification
Linux:
git diff --check origin/main..HEAD: cleanpython3 tests/bidi_controls_check.py,python3 tests/docs_links_check.py: okWin2025 on head
e6dfa885(dev and release, default slot pool):5accaeae): with the live-view check removed, bothstartup_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.
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
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".
Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-26T03:27:07Z.
I built
2484b5aband 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.texture-store. Immediately attempt slot 19 again at exactly that handle, with the same view description and a different texture created withD3D12_RESOURCE_FLAG_NONE. Then dispatch the original translated shader and read the first texture.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 from5bc3211c, whose entiresrc/tree matches this PR's parentd1cf6688.2484b5abthe same second creation is skipped, then Dispatch refuses withan 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).
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 commit737762fa, plus a merge of main).record_view(false), which replaced the descriptor record even when the desktop heap still held the earlier UAV.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.texture-store-deniedis the fresh slot, still refused. Newtexture-store-occupiedcreates the valid UAV at table byte 64 and then asks for slot 19 at the same handle over aD3D12_RESOURCE_FLAG_NONEtexture. It checks all 1,024 halves and the translated Dispatch. Both are instartup_compute_dispatch_texture_check.py.5accaeae,startup_compute_dispatch_texture_warpand_hardwarefail withoccupied 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 ofd3d12_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).AI-assisted; commands listed were executed locally.
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.
5accaeaℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
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 4370When running
startup_pixel_uav_warpor its supported hardware counterpart, the existingno-uacase creates a denied UAV in an empty slot, so this branch now writes a token.resolve_pixel_uavs()consequently reachespixel_uav_view()and logsresource lacks ALLOW_UNORDERED_ACCESS, buttests/startup_pixel_uav_check.py:49still requirestable entry holds no view. Itsverdict()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 👍 / 👎.
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 116If the caller copies a valid UAV token into an unused title-memory descriptor slot with
memcpy—a supported path described ind3d12_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. Sincedispatch_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 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:14:25Z.
Review: COMMENTED
No description provided.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:14:30Z.
Review: COMMENTED
No description provided.
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 intexture-store-copied. With the updated test setup that copies from a distinct descriptor slot, both WARP and hardware passed on2aa18479.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:14:32Z.
@MasterDomino #2710 is ready for review and merge.
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.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 on2aa18479, with the receipt[PASS] PR #2710@2aa18479.AI-assisted; commands listed were executed locally.
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 4370Real, 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-uaintests/startup_pixel_uav_check.pynow expectsuav 0 refused: resource lacks ALLOW_UNORDERED_ACCESS. Fixed infe61a505(head2aa18479).Verification (Windows Server 2025, WARP, head
2aa18479):startup_pixel_uav_warpfails. 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 (includesstartup_pixel_uav_warpand_hardware).AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T04:14:30Z.
Code review location:
src/startup_stubs/d3d12_capture.inl; line 116Real, 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)ind3d12_capture.inl,fe61a505). New fixture casetexture-store-copiedcreates 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 totexture-store-deniedandtexture-store-occupiedinstartup_compute_dispatch_texture_check.py. Fixture follow-up in2aa18479(head).Verification (Windows Server 2025, WARP, head
2aa18479):startup_compute_dispatch_texture_warpfails withcopied 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 on2aa18479is green.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T05:35:05Z.
Review: APPROVED
Approving
2aa18479(13 commits behindmain, merges cleanly;mainhasn'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:
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_warpand_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:
startup_compute_dispatch_texture_check.py:101and in pixelno-ua;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.