D3D12.X: depth buffers that shaders write get a twin for their UAVs (#970) #1056

Closed
IvyNotFound wants to merge 2 commits from upstream-pr/1063 into main
IvyNotFound commented 2026-11-24 11:09:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by IvyNotFound on 2026-11-24T11:09:06Z.


Stacked on #1027; only the top commit (21aa52c) belongs here. Part of #970: the second step planned there, off by default.

A console depth buffer that shaders write too has no ALLOW_UNORDERED_ACCESS on the PC, and its UAVs were null views, so what the title's shaders wrote there was lost. With XCL_DEPTH_UAV_TWINS=1, such a depth buffer of one plane (R16 / R32 typeless) gets a twin: a texture of the same format and size with unordered access and no depth, kept as the depth buffer's private data (released with it). Its UAVs are views of the twin, and at the title's enhanced barriers (#146) into the UNORDERED_ACCESS layout the depth buffer is copied to the twin, at those out of it the twin back. Without the variable nothing changes.

XCL applies none of the title's enhanced barriers, so on the PC such a depth buffer stays in the state it was made in: the copies' transitions start from that state (kept at CreatePlacedResourceX, DEPTH_WRITE when not known). Depth + stencil formats keep null views: the PC has no UAV format for them.

What is in it

  • crates/xcl/src/hle/d3d12x/depth_twin.rs (new): enabled, twin_desc, twin_for_uav / twin_of (private data), note_created / forget, twin_uav_desc (a typed view for a UAV made without a description), sync (transitions + CopyResource either way; no transition of the depth buffer when it is in the copy's state already). Tests: a_d16_or_d32_depth_buffer_gets_a_twin_with_unordered_access, a_depth_buffer_in_the_copys_state_is_not_moved_to_it, a_uav_without_a_description_is_a_typed_view_of_the_twin, a_released_depth_buffers_state_is_forgotten; GPU test gpu_a_uav_write_to_a_depth_buffer_goes_through_its_twin (a D16 depth buffer's clear reaches the twin at the barrier into UAV, a write through the twin's UAV reaches the depth buffer at the barrier out of it; fails without the twin).
  • crates/xcl/src/hle/d3d12x/real.rs: dev_create_uav_x makes the view on the twin instead of a null view (typed when the title gave no description); res_release forgets the state of a released depth buffer.
  • crates/xcl/src/hle/d3d12x/list_x.rs: note_depth_uav_barrier_groups returns the copies a #146 call needs (twin_copy); uav_barrier_x runs them after its global UAV barrier. The barrier log says whether the UAVs are null views or views of the twin.
  • crates/xcl/src/hle/d3d12x/console_list.rs: the same for console-recorded lists, recorded in the stream (TWIN_COPY_MARKER) and run at replay.
  • crates/xcl/src/hle/d3d12x/device_x.rs: create_placed_resource_x keeps the state such a depth buffer is made in.

Tested

  • NVIDIA GeForce RTX 5080 16 GB, driver 621.24 (32.0.16.2124); AMD Ryzen 7 7800X3D; Windows 11 25H2 (26200.9974); rustc 1.100.0 MSVC; DXC 1.9.2602.17; tests in debug, runs in release
  • cargo test --workspace --no-fail-fast -- --test-threads=4 at 21aa52c (rebased onto main b7aa9f3) with XCL_SAMPLE_RPF, _DLLS, _TTPF, _BVH4, _BK2, _AWC set: 777 passed, 0 failed, 41 ignored; SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware. Before the rebases, at 0322514, one run had the #718 flake (720 passed, 3 failed).
  • The retail title of #505, scripts/smoke.ps1, XCL_PRESS_A_AT=15:
    • the regression runs below (60 s, variable unset; main b7aa9f3 and this head 21aa52c, after the rebase);
    • 85 s with XCL_DEPTH_UAV_TWINS=1 at 0322514 (before the rebase, same code): 256+ D16 shadow maps get twins at ~9 s (the 4 depth + stencil views stay null); the enhanced barriers into and out of UNORDERED_ACCESS from ~66 s copied depth → twin and back 1024+ times; no device removal, the run ends by itself (exit 0x0, 1320 frames); peak commit 32058 MB (main's 60 s run: 27340 MB, its 300 s run: 30308 MB).
    • 300 s with XCL_DEPTH_UAV_TWINS=1 at 3ef1119 (before the review fixes): the same twins and copies, no device removal, it ends in the title's "GPU Loc Sig" abort at 95.5 s as main does.

Regression run

main:

xcl-smoke v1
commit: b7aa9f3bd212088e0d927439284dc5ed325ce3c7
gpu: NVIDIA GeForce RTX 5080
title: game
seconds: 60
exit: 0x0
frames shown: 1375 (PresentX 1375)
presents per 2 s (last 3): 36 53 51
device removals: 0
crashes: 0
peak commit: 26063 MB

this PR:

xcl-smoke v1
commit: 21aa52ccdd4ad1190b5f982855f4de2ef0771ff6
gpu: NVIDIA GeForce RTX 5080
title: game
seconds: 60
exit: 0x0
frames shown: 1371 (PresentX 1371)
presents per 2 s (last 3): 32 41 48
device removals: 0
crashes: 0
peak commit: 26176 MB

Not tested

  • whether the shadows look right: on this machine the title does not get past world loading (#505), so no frame with shadows was checked
  • the D3D12 debug layer; AMD and other NVIDIA GPUs; Series S mode
  • depth buffers made by other paths than CreatePlacedResourceX: their copies assume DEPTH_WRITE, the state #1353 now gives them there
  • the legacy transitions to / from UNORDERED_ACCESS (#26): counted by #1027, not copied – the title of #505 does not use them for these resources

AI use

  • Claude Code, Claude Opus 5.5: wrote the code, the tests and this description, and ran the tests and the runs above.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5470992740 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1063). Originally posted by [IvyNotFound](https://github.com/IvyNotFound) on 2026-11-24T11:09:06Z. --- Stacked on #1027; only the top commit (`21aa52c`) belongs here. Part of #970: the second step planned there, off by default. A console depth buffer that shaders write too has no `ALLOW_UNORDERED_ACCESS` on the PC, and its UAVs were null views, so what the title's shaders wrote there was lost. With `XCL_DEPTH_UAV_TWINS=1`, such a depth buffer of one plane (R16 / R32 typeless) gets a twin: a texture of the same format and size with unordered access and no depth, kept as the depth buffer's private data (released with it). Its UAVs are views of the twin, and at the title's enhanced barriers (#146) into the `UNORDERED_ACCESS` layout the depth buffer is copied to the twin, at those out of it the twin back. Without the variable nothing changes. XCL applies none of the title's enhanced barriers, so on the PC such a depth buffer stays in the state it was made in: the copies' transitions start from that state (kept at `CreatePlacedResourceX`, DEPTH_WRITE when not known). Depth + stencil formats keep null views: the PC has no UAV format for them. **What is in it** - `crates/xcl/src/hle/d3d12x/depth_twin.rs` (new): `enabled`, `twin_desc`, `twin_for_uav` / `twin_of` (private data), `note_created` / `forget`, `twin_uav_desc` (a typed view for a UAV made without a description), `sync` (transitions + CopyResource either way; no transition of the depth buffer when it is in the copy's state already). Tests: `a_d16_or_d32_depth_buffer_gets_a_twin_with_unordered_access`, `a_depth_buffer_in_the_copys_state_is_not_moved_to_it`, `a_uav_without_a_description_is_a_typed_view_of_the_twin`, `a_released_depth_buffers_state_is_forgotten`; GPU test `gpu_a_uav_write_to_a_depth_buffer_goes_through_its_twin` (a D16 depth buffer's clear reaches the twin at the barrier into UAV, a write through the twin's UAV reaches the depth buffer at the barrier out of it; fails without the twin). - `crates/xcl/src/hle/d3d12x/real.rs`: `dev_create_uav_x` makes the view on the twin instead of a null view (typed when the title gave no description); `res_release` forgets the state of a released depth buffer. - `crates/xcl/src/hle/d3d12x/list_x.rs`: `note_depth_uav_barrier_groups` returns the copies a #146 call needs (`twin_copy`); `uav_barrier_x` runs them after its global UAV barrier. The barrier log says whether the UAVs are null views or views of the twin. - `crates/xcl/src/hle/d3d12x/console_list.rs`: the same for console-recorded lists, recorded in the stream (`TWIN_COPY_MARKER`) and run at replay. - `crates/xcl/src/hle/d3d12x/device_x.rs`: `create_placed_resource_x` keeps the state such a depth buffer is made in. **Tested** - NVIDIA GeForce RTX 5080 16 GB, driver 621.24 (32.0.16.2124); AMD Ryzen 7 7800X3D; Windows 11 25H2 (26200.9974); rustc 1.100.0 MSVC; DXC 1.9.2602.17; tests in debug, runs in release - `cargo test --workspace --no-fail-fast -- --test-threads=4` at `21aa52c` (rebased onto `main` `b7aa9f3`) with `XCL_SAMPLE_RPF`, `_DLLS`, `_TTPF`, `_BVH4`, `_BK2`, `_AWC` set: **777 passed, 0 failed, 41 ignored**; `SKIPPED` (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. Before the rebases, at `0322514`, one run had the #718 flake (720 passed, 3 failed). - The retail title of #505, `scripts/smoke.ps1`, `XCL_PRESS_A_AT=15`: - the regression runs below (60 s, variable unset; `main` `b7aa9f3` and this head `21aa52c`, after the rebase); - 85 s with `XCL_DEPTH_UAV_TWINS=1` at `0322514` (before the rebase, same code): 256+ D16 shadow maps get twins at ~9 s (the 4 depth + stencil views stay null); the enhanced barriers into and out of `UNORDERED_ACCESS` from ~66 s copied depth → twin and back 1024+ times; no device removal, the run ends by itself (exit 0x0, 1320 frames); peak commit 32058 MB (`main`'s 60 s run: 27340 MB, its 300 s run: 30308 MB). - 300 s with `XCL_DEPTH_UAV_TWINS=1` at `3ef1119` (before the review fixes): the same twins and copies, no device removal, it ends in the title's "GPU Loc Sig" abort at 95.5 s as `main` does. **Regression run** main: ``` xcl-smoke v1 commit: b7aa9f3bd212088e0d927439284dc5ed325ce3c7 gpu: NVIDIA GeForce RTX 5080 title: game seconds: 60 exit: 0x0 frames shown: 1375 (PresentX 1375) presents per 2 s (last 3): 36 53 51 device removals: 0 crashes: 0 peak commit: 26063 MB ``` this PR: ``` xcl-smoke v1 commit: 21aa52ccdd4ad1190b5f982855f4de2ef0771ff6 gpu: NVIDIA GeForce RTX 5080 title: game seconds: 60 exit: 0x0 frames shown: 1371 (PresentX 1371) presents per 2 s (last 3): 32 41 48 device removals: 0 crashes: 0 peak commit: 26176 MB ``` **Not tested** - whether the shadows look right: on this machine the title does not get past world loading (#505), so no frame with shadows was checked - the D3D12 debug layer; AMD and other NVIDIA GPUs; Series S mode - depth buffers made by other paths than `CreatePlacedResourceX`: their copies assume DEPTH_WRITE, the state #1353 now gives them there - the legacy transitions to / from `UNORDERED_ACCESS` (#26): counted by #1027, not copied – the title of #505 does not use them for these resources **AI use** - Claude Code, Claude Opus 5.5: wrote the code, the tests and this description, and ran the tests and the runs above. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
certified-retart commented 2026-11-24 12:05:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by certified-retart on 2026-11-24T11:21:27Z.


Independent review and local GPU test of commit 3ef1119 (per CONTRIBUTING.md, reviewing/testing this PR rather than opening a duplicate for #970).

Confirmed code findings

  1. MADE_IN never removes released resources (depth_twin.rs / real.rs): note_created(res, state) inserts into the global MADE_IN map, but real::res_release never forgets res on final release. If a later depth buffer reuses the same COM pointer address (e.g. created via another path or in a different initial state), state_of(res) returns the stale state from the freed resource. Adding a depth_twin::forget(this as usize) call in real::res_release (when n == 0) fixes both the leak and pointer-reuse staleness.
  2. Same-state transition in depth_twin::sync when made == depth_copy: barrier(&[transition(depth, made, depth_copy), ...]) and the matching restore barrier emit a StateBefore == StateAfter transition if a depth+UAV texture was created in COPY_SOURCE (entering UAV) or COPY_DEST (leaving UAV), which D3D12 validation rejects. Omitting the depth transition when made == depth_copy avoids it.
  3. pDesc == NULL on typeless twins (real.rs dev_create_uav_x): f(this, twin.as_raw(), std::ptr::null_mut(), desc, at) forwards a null desc directly to the twin. Because pc_resource_desc converts typed depth formats (D16_UNORM / D32_FLOAT) to typeless (R16_TYPELESS / R32_TYPELESS), D3D12 rejects CreateUnorderedAccessView with pDesc == NULL on the twin unless a typed view desc is synthesized via pc_shader_view_format.
  4. (Minor) note_created is currently only hooked in device_x::create_placed_resource_x, so any depth+UAV resource created via dev_create_committed_resource_x or dev_create_placed_resource_x with a non-DEPTH_WRITE initial state falls back to DEPTH_WRITE.

Tested

  • Hardware: NVIDIA GeForce RTX 5070 (driver 32.0.16.1074), Ryzen 7 9800X3D, Windows 10 Pro 19045, rustc 1.100.0 (debug)
  • cargo test -p xcl --lib depth_twin -- --nocapture: 2 passed, 0 failed, 0 ignored (gpu_a_uav_write_to_a_depth_buffer_goes_through_its_twin ran on RTX 5070 and passed)
  • cargo test -p xcl --lib a_depth_buffer_without_unordered_access -- --nocapture: 1 passed, 0 failed, 0 ignored
  • cargo test -p xcl --lib an_enhanced_barrier_into_or_out_of_unordered_access -- --nocapture: 1 passed, 0 failed, 0 ignored

Not tested

  • Retail game smoke run (no game files on this machine), AMD GPU (gpu_a_uav_write_to_a_depth_buffer_goes_through_its_twin uses D3D12CreateDevice(None, ...)), D3D12 debug layer (not installed on this host).

AI use

  • Antigravity (gemini-4-neon) assisted with diff inspection and drafting this review; every finding above was checked against 3ef1119 and the test commands were run locally on the hardware listed.
<!-- greyfinch-sync:ivall/xcl:comment:7129991489 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1063#issuecomment-7129991489). Originally posted by [certified-retart](https://github.com/certified-retart) on 2026-11-24T11:21:27Z. --- Independent review and local GPU test of commit `3ef1119` (per CONTRIBUTING.md, reviewing/testing this PR rather than opening a duplicate for #970). ### Confirmed code findings 1. **`MADE_IN` never removes released resources (`depth_twin.rs` / `real.rs`):** `note_created(res, state)` inserts into the global `MADE_IN` map, but `real::res_release` never forgets `res` on final release. If a later depth buffer reuses the same COM pointer address (e.g. created via another path or in a different initial state), `state_of(res)` returns the stale state from the freed resource. Adding a `depth_twin::forget(this as usize)` call in `real::res_release` (when `n == 0`) fixes both the leak and pointer-reuse staleness. 2. **Same-state transition in `depth_twin::sync` when `made == depth_copy`:** `barrier(&[transition(depth, made, depth_copy), ...])` and the matching restore barrier emit a `StateBefore == StateAfter` transition if a depth+UAV texture was created in `COPY_SOURCE` (entering UAV) or `COPY_DEST` (leaving UAV), which D3D12 validation rejects. Omitting the depth transition when `made == depth_copy` avoids it. 3. **`pDesc == NULL` on typeless twins (`real.rs` `dev_create_uav_x`):** `f(this, twin.as_raw(), std::ptr::null_mut(), desc, at)` forwards a null `desc` directly to the twin. Because `pc_resource_desc` converts typed depth formats (`D16_UNORM` / `D32_FLOAT`) to typeless (`R16_TYPELESS` / `R32_TYPELESS`), D3D12 rejects `CreateUnorderedAccessView` with `pDesc == NULL` on the twin unless a typed view desc is synthesized via `pc_shader_view_format`. 4. *(Minor)* `note_created` is currently only hooked in `device_x::create_placed_resource_x`, so any depth+UAV resource created via `dev_create_committed_resource_x` or `dev_create_placed_resource_x` with a non-`DEPTH_WRITE` initial state falls back to `DEPTH_WRITE`. **Tested** - Hardware: NVIDIA GeForce RTX 5070 (driver `32.0.16.1074`), Ryzen 7 9800X3D, Windows 10 Pro 19045, `rustc 1.100.0` (debug) - `cargo test -p xcl --lib depth_twin -- --nocapture`: 2 passed, 0 failed, 0 ignored (`gpu_a_uav_write_to_a_depth_buffer_goes_through_its_twin` ran on RTX 5070 and passed) - `cargo test -p xcl --lib a_depth_buffer_without_unordered_access -- --nocapture`: 1 passed, 0 failed, 0 ignored - `cargo test -p xcl --lib an_enhanced_barrier_into_or_out_of_unordered_access -- --nocapture`: 1 passed, 0 failed, 0 ignored **Not tested** - Retail game smoke run (no game files on this machine), AMD GPU (`gpu_a_uav_write_to_a_depth_buffer_goes_through_its_twin` uses `D3D12CreateDevice(None, ...)`), D3D12 debug layer (not installed on this host). **AI use** - Antigravity (gemini-4-neon) assisted with diff inspection and drafting this review; every finding above was checked against `3ef1119` and the test commands were run locally on the hardware listed.
IvyNotFound commented 2026-11-24 12:05:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by IvyNotFound on 2026-11-24T11:47:32Z.


Thanks for the review. Points 1–3 were right; fixed in 0322514 (squashed into the PR's commit):

  1. res_release calls depth_twin::forget on the last release, so a resource made later at the same address does not take the old state (test a_released_depth_buffers_state_is_forgotten).
  2. sync leaves the depth buffer's transition out when it is in the copy's state already (depth_transitions, test a_depth_buffer_in_the_copys_state_is_not_moved_to_it).
  3. A UAV the title makes without a description gets a typed view of the twin, R16_UNORM / R32_FLOAT, an array view for cubes and cascades (twin_uav_desc, test a_uav_without_a_description_is_a_typed_view_of_the_twin).

Point 4 stays as it is in this PR: depth buffers from the other creation paths fall back to DEPTH_WRITE, listed under Not tested; the retail title's come through CreatePlacedResourceX.

At 0322514 on an RTX 5080 (driver 621.24): cargo test -p xcl --lib depth_twin 5 passed, 0 failed; the workspace suite and the runs are in the updated description (85 s with XCL_DEPTH_UAV_TWINS=1: 1024+ copies, no device removal).

AI use: Claude Code (Claude Opus 5.5) checked the findings against the code, wrote the fixes and this reply, and ran the tests.

<!-- greyfinch-sync:ivall/xcl:comment:7130555039 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1063#issuecomment-7130555039). Originally posted by [IvyNotFound](https://github.com/IvyNotFound) on 2026-11-24T11:47:32Z. --- Thanks for the review. Points 1–3 were right; fixed in `0322514` (squashed into the PR's commit): 1. `res_release` calls `depth_twin::forget` on the last release, so a resource made later at the same address does not take the old state (test `a_released_depth_buffers_state_is_forgotten`). 2. `sync` leaves the depth buffer's transition out when it is in the copy's state already (`depth_transitions`, test `a_depth_buffer_in_the_copys_state_is_not_moved_to_it`). 3. A UAV the title makes without a description gets a typed view of the twin, R16_UNORM / R32_FLOAT, an array view for cubes and cascades (`twin_uav_desc`, test `a_uav_without_a_description_is_a_typed_view_of_the_twin`). Point 4 stays as it is in this PR: depth buffers from the other creation paths fall back to DEPTH_WRITE, listed under **Not tested**; the retail title's come through `CreatePlacedResourceX`. At `0322514` on an RTX 5080 (driver 621.24): `cargo test -p xcl --lib depth_twin` 5 passed, 0 failed; the workspace suite and the runs are in the updated description (85 s with `XCL_DEPTH_UAV_TWINS=1`: 1024+ copies, no device removal). AI use: Claude Code (Claude Opus 5.5) checked the findings against the code, wrote the fixes and this reply, and ran the tests.
eizispark commented 2026-11-24 12:05:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by eizispark on 2026-11-24T12:02:38Z.


Hardware test report — commit 0322514

Verified clean merge with main (47efa2e) on 0322514d51c6dcb03e5d2bfca6d75975f837eb6c: pass.

Tested

  • Hardware: AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11, rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profile
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 720 passed, 3 failed, 41 ignored (GPU tests skipped on this adapter: none); the 3 failures under --test-threads=4 were the known concurrent global-state tests (hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels, hle::d3d12x::title_textures::tests::transitions_apply_when_their_list_is_submitted, hle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memory), each passing solo with --exact --test-threads=1 (1 passed, 0 failed)
  • cargo test -p xcl --lib depth_twin -- --nocapture: 5 passed, 0 failed, 0 ignored (0 skipped), including hle::d3d12x::depth_twin::tests::gpu_a_uav_write_to_a_depth_buffer_goes_through_its_twin executed on AMD Radeon RX 9070 XT (D16_UNORM clear → twin UAV write → copy-back round trip), plus hle::d3d12x::list_x::tests::a_depth_buffer_without_unordered_access_is_one_with_null_uavs and an_enhanced_barrier_into_or_out_of_unordered_access_is_a_uav_use (ok)
  • Additional 60 s retail smoke run with XCL_DEPTH_UAV_TWINS=1: exit: 0x0, frames shown: 1662 (PresentX 1662), presents per 2 s (last 3): 60 60 60, device removals: 0, crashes: 0, peak commit: 15028 MB

Regression run
main (47efa2e):

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1677 (PresentX 1677)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14853 MB

PR (0322514):

xcl-smoke v1
commit: 0322514d51c6dcb03e5d2bfca6d75975f837eb6c
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1662 (PresentX 1662)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14856 MB

Not tested

  • 3D world shadow-map rendering past the menus; retail run under XCL_D3D12_DEBUG=1; NVIDIA / Intel GPUs

AI use: Antigravity (Google DeepMind), Gemini (exact version string not exposed in runtime environment) — ran the workspace test suite, depth_twin GPU tests, and 60 s retail smoke checks (default and XCL_DEPTH_UAV_TWINS=1) on the hardware above and formatted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7130882915 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1063#issuecomment-7130882915). Originally posted by [eizispark](https://github.com/eizispark) on 2026-11-24T12:02:38Z. --- ### Hardware test report — commit `0322514` Verified clean merge with `main` (`47efa2e`) on `0322514d51c6dcb03e5d2bfca6d75975f837eb6c`: **pass**. **Tested** - Hardware: AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, release + test profile - `cargo test --workspace --no-fail-fast -- --test-threads=4`: `720 passed, 3 failed, 41 ignored` (GPU tests skipped on this adapter: `none`); the 3 failures under `--test-threads=4` were the known concurrent global-state tests (`hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels`, `hle::d3d12x::title_textures::tests::transitions_apply_when_their_list_is_submitted`, `hle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memory`), each passing solo with `--exact --test-threads=1` (`1 passed, 0 failed`) - `cargo test -p xcl --lib depth_twin -- --nocapture`: `5 passed, 0 failed, 0 ignored` (0 skipped), including `hle::d3d12x::depth_twin::tests::gpu_a_uav_write_to_a_depth_buffer_goes_through_its_twin` executed on AMD Radeon RX 9070 XT (`D16_UNORM` clear → twin UAV write → copy-back round trip), plus `hle::d3d12x::list_x::tests::a_depth_buffer_without_unordered_access_is_one_with_null_uavs` and `an_enhanced_barrier_into_or_out_of_unordered_access_is_a_uav_use` (`ok`) - Additional 60 s retail smoke run with `XCL_DEPTH_UAV_TWINS=1`: `exit: 0x0`, `frames shown: 1662 (PresentX 1662)`, `presents per 2 s (last 3): 60 60 60`, `device removals: 0`, `crashes: 0`, `peak commit: 15028 MB` **Regression run** `main` (`47efa2e`): ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1677 (PresentX 1677) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14853 MB ``` PR (`0322514`): ``` xcl-smoke v1 commit: 0322514d51c6dcb03e5d2bfca6d75975f837eb6c gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1662 (PresentX 1662) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14856 MB ``` **Not tested** - 3D world shadow-map rendering past the menus; retail run under `XCL_D3D12_DEBUG=1`; NVIDIA / Intel GPUs **AI use**: Antigravity (Google DeepMind), Gemini (exact version string not exposed in runtime environment) — ran the workspace test suite, `depth_twin` GPU tests, and 60 s retail smoke checks (default and `XCL_DEPTH_UAV_TWINS=1`) on the hardware above and formatted this report.
juliptree commented 2026-11-24 13:03:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by juliptree on 2026-11-24T12:56:35Z.


Independently tested 0322514d51 on an RTX 5060 Ti with NVIDIA driver 616.92. The existing depth_twin tests passed 5/5 on the clean PR head. With a local test-only D32 extension, all 6 passed with zero skips.

After GPU fence completion, all 2,048 texels read back as 0.25 after the D32_FLOAT depth clear copied to the R32_FLOAT UAV twin, and as 0.75 after the UAV write copied back to the depth texture. I verified the actual D3D12 adapter by LUID.

The debug-layer rerun matched both values, but the debug interface returned 0x887A002D, so debug-layer messages were unavailable. I can share the synthetic D32 fixture if you’d like to include it.
The D32 round-trip fixture is available as a single test-only commit on top of 0322514. Feel free to cherry-pick it into this PR. The committed version passed all six depth_twin tests on the RTX 5060 Ti, with zero skips.

Codex (GPT-6) assisted with testing and reporting.

<!-- greyfinch-sync:ivall/xcl:comment:7132129569 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1063#issuecomment-7132129569). Originally posted by [juliptree](https://github.com/juliptree) on 2026-11-24T12:56:35Z. --- Independently tested 0322514d51c6dcb03e5d2bfca6d75975f837eb6c on an RTX 5060 Ti with NVIDIA driver 616.92. The existing depth_twin tests passed 5/5 on the clean PR head. With a local test-only D32 extension, all 6 passed with zero skips. After GPU fence completion, all 2,048 texels read back as 0.25 after the D32_FLOAT depth clear copied to the R32_FLOAT UAV twin, and as 0.75 after the UAV write copied back to the depth texture. I verified the actual D3D12 adapter by LUID. The debug-layer rerun matched both values, but the debug interface returned 0x887A002D, so debug-layer messages were unavailable. I can share the synthetic D32 fixture if you’d like to include it. The D32 round-trip fixture is available as a [single test-only commit](https://github.com/juliptree/xcl/commit/1ba5d77bc119052ef03993ea3001db26e63eaf9b) on top of 0322514. Feel free to cherry-pick it into this PR. The committed version passed all six depth_twin tests on the RTX 5060 Ti, with zero skips. Codex (GPT-6) assisted with testing and reporting.
JoaoPauluu commented 2026-11-24 15:05:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-24T14:21:41Z.


A regression run under Wine on Linux, on a retail title.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. c1af15d as it is (merge base 47efa2e) and main 47efa2e, no uncommitted changes. Retail title 1.0.2.1, scripts/linux/smoke.sh (#257) for 60 s, no input with XCL_DEPTH_UAV_TWINS=1 for this PR's run. Twelve runs in a row, main first and last, other PRs in between.
  • The PR's run had XCL_DEPTH_UAV_TWINS=1, and GTA VI reaches the change: at 39.18–39.23 s the log shows a depth buffer that shaders write (…, format 53) has a twin for its UAVs, up to (256 so far), for buffers from 128x128x6 to 2048x2048x1. There is no no twin line. The log's WARN (72), not kept in step (4) and ERROR (0) counts are the same as on main, and background_pipelines is the same [228, 0, 57595]. I did not look at the picture: under this setup it is black on main too.

Regression run

main (first run):

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 3060
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1384 (PresentX 1384)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

this PR:

xcl-smoke v1
commit: c1af15d61c9727c6e8691a2a48a4742ce009c3e7
gpu: NVIDIA GeForce RTX 3060
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1389 (PresentX 1389)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

The last main run: 1425 frames, exit: 0x0, no device removal, no crash. Under Wine, peak commit reads 0 MB, so these blocks do not check memory.

Not tested

  • the test suite on this head; native Windows; AMD.

AI use

  • Claude Code (Claude Opus 5.5) built both commits, ran the runs and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
<!-- greyfinch-sync:ivall/xcl:comment:7134248135 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1063#issuecomment-7134248135). Originally posted by [JoaoPauluu](https://github.com/JoaoPauluu) on 2026-11-24T14:21:41Z. --- A regression run under Wine on Linux, on a retail title. **Tested** - RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `c1af15d` as it is (merge base `47efa2e`) and `main` `47efa2e`, no uncommitted changes. Retail title 1.0.2.1, `scripts/linux/smoke.sh` (#257) for 60 s, no input with `XCL_DEPTH_UAV_TWINS=1` for this PR's run. Twelve runs in a row, `main` first and last, other PRs in between. - The PR's run had `XCL_DEPTH_UAV_TWINS=1`, and GTA VI reaches the change: at 39.18–39.23 s the log shows `a depth buffer that shaders write (…, format 53) has a twin for its UAVs`, up to `(256 so far)`, for buffers from 128x128x6 to 2048x2048x1. There is no `no twin` line. The log's WARN (72), `not kept in step` (4) and ERROR (0) counts are the same as on `main`, and `background_pipelines` is the same `[228, 0, 57595]`. I did not look at the picture: under this setup it is black on `main` too. **Regression run** main (first run): ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: NVIDIA GeForce RTX 3060 title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1384 (PresentX 1384) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 0 MB ``` this PR: ``` xcl-smoke v1 commit: c1af15d61c9727c6e8691a2a48a4742ce009c3e7 gpu: NVIDIA GeForce RTX 3060 title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1389 (PresentX 1389) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 0 MB ``` The last `main` run: 1425 frames, `exit: 0x0`, no device removal, no crash. Under Wine, `peak commit` reads 0 MB, so these blocks do not check memory. **Not tested** - the test suite on this head; native Windows; AMD. **AI use** - Claude Code (Claude Opus 5.5) built both commits, ran the runs and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
DavidM1911 commented 2026-11-25 09:08:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T09:05:49Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7157868795 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1063#issuecomment-7157868795). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T09:05:49Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun. Thanks!
github-actions[bot] commented 2026-11-29 07:41:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:41:09Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7252626470 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1063#issuecomment-7252626470). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T07:41:09Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 04:43:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:43:41Z.


Triage (#1607) – head 21aa52c

This is stacked on #1027 (its first commit) and adds depth_twin.rs behind XCL_DEPTH_UAV_TWINS=1. Main has since done the same for #970 in hle/d3d12x/depth_uav.rs (#3203; turned on by default in 4dd049f6, #3290). A depth plane gets an R32/R16 twin with unordered access, its UAVs are views of the twin, and the plane is copied into the twin on the title's transition into UNORDERED_ACCESS and back on the transition out. Main also covers stencil planes and #146 barrier groups, and the module's header credits this PR for the PC creation state.
Merging this would add a second twin mechanism next to main's.
Recommendation: close (superseded by #3290 / #3203).

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7301035795 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1063#issuecomment-7301035795). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:43:41Z. --- **Triage (#1607)** – head 21aa52c This is stacked on #1027 (its first commit) and adds `depth_twin.rs` behind `XCL_DEPTH_UAV_TWINS=1`. Main has since done the same for #970 in `hle/d3d12x/depth_uav.rs` (#3203; turned on by default in 4dd049f6, #3290). A depth plane gets an R32/R16 twin with unordered access, its UAVs are views of the twin, and the plane is copied into the twin on the title's transition into UNORDERED_ACCESS and back on the transition out. Main also covers stencil planes and #146 barrier groups, and the module's header credits this PR for the PC creation state. Merging this would add a second twin mechanism next to main's. Recommendation: close (superseded by #3290 / #3203). AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
throny commented 2026-12-01 12:42:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:42:09Z.


Closing as superseded: this change is already on main (4dd049f6). main depth_uav.rs (#3203, on by default via 4dd049f6) has the R32/R16 depth twins copied around UAV transitions and credits #1063 in its header

Two independent checks found this: Foniass's close list on #1607 and ours against current main. If something here is still missing on main, say so and reopen it, or ask and I will.

AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

<!-- greyfinch-sync:ivall/xcl:comment:7311522568 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1063#issuecomment-7311522568). Originally posted by [throny](https://github.com/throny) on 2026-12-01T12:42:09Z. --- Closing as superseded: this change is already on `main` (4dd049f6). main depth_uav.rs (#3203, on by default via 4dd049f6) has the R32/R16 depth twins copied around UAV transitions and credits #1063 in its header Two independent checks found this: Foniass's close list on #1607 and ours against current `main`. If something here is still missing on `main`, say so and reopen it, or ask and I will. AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

Pull request closed

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
xcl-dev/xcl!1056
No description provided.