D3D12.X: the list's ClearUnorderedAccessViewUint / Float get the PC's handles of the view #2329

Closed
github-bot wants to merge 1 commit from gh-pr/2329/head into gh-pr/2329/base
Owner

@⁠imnicho on GitHub · 2026-11-25 14:46 UTC · original
imnicho:clear-uav-handles → main · +220 −0 · 2 files · 1 commits · closed without merging

A title's ClearUnorderedAccessViewUint / Float (list #53 / #54) went to the PC with the two handles as the title gave them. Those are addresses of slots in a console view heap (console_heap), which the PC took for descriptor handles: a retail title's first such clear in its world hung the GPU. Now the list translates them, as the older console list (console_list) already does. Part of #675.

What is in it

  • crates/xcl/src/hle/d3d12x/list_x.rs: clear_uav_uint_x / clear_uav_float_x for #53 / #54. clear_uav_handles looks the two handles up as console slots and gives the PC the UAV's GPU handle (in the title's own shader-visible heap, or in the shared heap when the view heap is hosted there - then ensure_view_heap binds it if the title named no heap) and the UAV's CPU handle in the title's own PC heap. Handles that are no console slots go on as they are. A slot with no shader-visible UAV (a heap that is not shader visible, a sampler slot, a slot paired with a PC handle) is not cleared, with a warning for the first four. The rectangles go on unchanged.
  • crates/xcl/src/hle/d3d12x/real.rs: the two entries in the command list's slots.
  • Tests: the_command_list_hooks_clear_unordered_access_view (the two slots are XCL's - it fails without the entries); clear_uav_handles_are_those_of_the_pc_heap_behind_the_slots (the handles of a slot, of two slots, PC handles, a heap that is not shader visible, samplers); clear_unordered_access_view_takes_the_slots_of_a_console_heap on the GPU (an R32_UINT and an R32_FLOAT texture with their UAVs in a console heap's slots, both clears with the slots' addresses, the textures read back).
  • 220 lines added, none changed; 169 of them are the tests.

Tested

  • hardware: Intel Core i7-7700K (4 cores / 8 threads), 16 GB RAM, NVIDIA GeForce RTX 5080 16 GB (driver 610.47, 32-lane waves), Windows 10 22H2 (19045), DXC 1.9.2602.17, rustc 1.100.0 stable-x86_64-pc-windows-msvc; debug for the tests, release for the title.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 on 9606785: 1268 passed, 0 failed, 46 ignored. SKIPPED (28 notices): the wave64 cases of gpu::recomp::lower::tests (4 tests), gpu::recomp::lower_dxil::tests (14 cases) and dispatch_chain_native_wave64_builds_whole, 3 per-lane cases the per-lane form refuses, gpu_wave32_program_in_wave64_hardware and gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (its switch is off), pso_measurement_compiles_an_exact_synthetic_record (Windows Developer Mode is off), uploads_start_from_each_subresources_state and test_title_draws_with_a_root_signature_under_the_debug_layer (no D3D12 debug layer on this PC).
  • The three new tests pass; the GPU one ran (not skipped) on this card.
  • game checked: the newer retail title of the README (my own copy), XCL_NETWORK=0, scripted pad, on a local tree that is not this head: #2057 at 4df1e6e + main at 0f13d2a + #2067, #684, #266, #1515, #495, #1405, #751, #2092, #1803, #1887, #541, #2050, the change of #2306 for #2057's uploads and local diagnostics; XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1, the Series S profile (device_type = "lockhart"), where the hang came in every run:
run this change the device is lost counted from 4 s after the world's set-up the driver's "stopped responding"
1 no 18 s after the set-up 1 frame, 5 124 draws yes
2 no 19 s 0 frames, 4 140 draws yes
3 no 14 s 0 frames, 0 draws yes
4 (XCL_GPU_PROFILE=1 XCL_DRED=1) no 51 s 733 frames, 6 896 draws yes
5 (the same) no 14 s 0 frames, 0 draws yes
6 yes 38 s 45 frames, 105 532 draws no
7 yes 28 s 35 frames, 87 664 draws no
8 yes 160 s 6 frames, 23 039 draws yes, 147 s into the world
  • Without the change XCL_DRED=1 names the same place in two runs: a list of 139 operations with 45 done, the next one ClearUnorderedAccessView (the first clear of the list; before it 17 barriers, 10 WriteBufferImmediate, 5 ResolveQueryData, 3 Dispatch, 3 ExecuteIndirect, 2 draws, 2 buffer copies and 2 texture copies), and the system log has the driver's "stopped responding" (event 4101) for each of the five runs.
  • With it the title makes two clears there, of a 20 MB buffer and of an 80x45 R32_FLOAT texture, each with a GPU handle and a CPU handle from two console heaps, and goes on (three runs of three).
  • The device is still lost in every run, later and in other ways: in runs 6 and 7 without a hang (no event in the system log, no GPU wait timed out, XCL_DRED=1 names no list; local video memory 13.7 - 13.9 GB of a 15.0 GB budget), in run 8 with one that starts 10 s after a compute pipeline of 1.0 MB of DXIL came out of the driver (70 s in it), which is not this change's subject.

Regression run

main:

xcl-smoke v1
commit: 06c9f5505f63f10c5ec49ef932d75b2c28177324
gpu: NVIDIA GeForce RTX 5080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1255 (PresentX 1256)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14084 MB

PR (this PR's head commit):

xcl-smoke v1
commit: 9606785c5e7bd97c5a2c01fd9e1462dd2f90da3b
gpu: NVIDIA GeForce RTX 5080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1338 (PresentX 1338)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14071 MB

A second round of the same two binaries: main 1169 frames, PR 1154. These 60 s end in the title's menus, before its first ClearUnorderedAccessView: the pair shows nothing else changed, not the fix.

Not tested

  • The title on this head itself: the runs are on the local tree named, with the same hooks (there with a log line for the first calls, and ensure_view_heap called for every translated clear, not only for a view in the shared heap).
  • A clear with rectangles (the title passes none) and a clear whose slots are not in the shared heap, in a title (the GPU test has that case; in the title's runs the view heap is in the shared heap).
  • AMD and Intel GPUs, native 64-lane waves, Linux / Wine; other titles.

AI use

  • Claude Code with Claude Fable 5.2: found the cause from the device-removal trace, wrote the change and its tests, ran the suite and the title runs on the machine named, and wrote this description.

🤖 Generated with Claude Code

**@⁠imnicho** on GitHub · 2026-11-25 14:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/2329) `imnicho:clear-uav-handles` → `main` · +220 −0 · 2 files · 1 commits · closed without merging A title's `ClearUnorderedAccessViewUint` / `Float` (list #53 / #54) went to the PC with the two handles as the title gave them. Those are addresses of slots in a console view heap (`console_heap`), which the PC took for descriptor handles: a retail title's first such clear in its world hung the GPU. Now the list translates them, as the older console list (`console_list`) already does. Part of #675. **What is in it** - `crates/xcl/src/hle/d3d12x/list_x.rs`: `clear_uav_uint_x` / `clear_uav_float_x` for #53 / #54. `clear_uav_handles` looks the two handles up as console slots and gives the PC the UAV's GPU handle (in the title's own shader-visible heap, or in the shared heap when the view heap is hosted there - then `ensure_view_heap` binds it if the title named no heap) and the UAV's CPU handle in the title's own PC heap. Handles that are no console slots go on as they are. A slot with no shader-visible UAV (a heap that is not shader visible, a sampler slot, a slot paired with a PC handle) is not cleared, with a warning for the first four. The rectangles go on unchanged. - `crates/xcl/src/hle/d3d12x/real.rs`: the two entries in the command list's slots. - Tests: `the_command_list_hooks_clear_unordered_access_view` (the two slots are XCL's - it fails without the entries); `clear_uav_handles_are_those_of_the_pc_heap_behind_the_slots` (the handles of a slot, of two slots, PC handles, a heap that is not shader visible, samplers); `clear_unordered_access_view_takes_the_slots_of_a_console_heap` on the GPU (an R32_UINT and an R32_FLOAT texture with their UAVs in a console heap's slots, both clears with the slots' addresses, the textures read back). - 220 lines added, none changed; 169 of them are the tests. **Tested** - hardware: Intel Core i7-7700K (4 cores / 8 threads), 16 GB RAM, NVIDIA GeForce RTX 5080 16 GB (driver 610.47, 32-lane waves), Windows 10 22H2 (19045), DXC 1.9.2602.17, rustc 1.100.0 `stable-x86_64-pc-windows-msvc`; debug for the tests, release for the title. - `cargo build --workspace && cargo test --workspace -- --test-threads=4` on `9606785`: 1268 passed, 0 failed, 46 ignored. SKIPPED (28 notices): the wave64 cases of `gpu::recomp::lower::tests` (4 tests), `gpu::recomp::lower_dxil::tests` (14 cases) and `dispatch_chain_native_wave64_builds_whole`, 3 per-lane cases the per-lane form refuses, `gpu_wave32_program_in_wave64_hardware` and `gpu_geometry_wave32_prefix_count_over_a_mask` (no wave64), `heap_window_out_of_memory_falls_back_to_the_switch_form` (its switch is off), `pso_measurement_compiles_an_exact_synthetic_record` (Windows Developer Mode is off), `uploads_start_from_each_subresources_state` and `test_title_draws_with_a_root_signature_under_the_debug_layer` (no D3D12 debug layer on this PC). - The three new tests pass; the GPU one ran (not skipped) on this card. - game checked: the newer retail title of the README (my own copy), `XCL_NETWORK=0`, scripted pad, on a local tree that is not this head: #2057 at `4df1e6e` + `main` at `0f13d2a` + #2067, #684, #266, #1515, #495, #1405, #751, #2092, #1803, #1887, #541, #2050, the change of #2306 for #2057's uploads and local diagnostics; `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1`, the Series S profile (`device_type = "lockhart"`), where the hang came in every run: | run | this change | the device is lost | counted from 4 s after the world's set-up | the driver's "stopped responding" | |---|---|---|---|---| | 1 | no | 18 s after the set-up | 1 frame, 5 124 draws | yes | | 2 | no | 19 s | 0 frames, 4 140 draws | yes | | 3 | no | 14 s | 0 frames, 0 draws | yes | | 4 (`XCL_GPU_PROFILE=1 XCL_DRED=1`) | no | 51 s | 733 frames, 6 896 draws | yes | | 5 (the same) | no | 14 s | 0 frames, 0 draws | yes | | 6 | yes | 38 s | 45 frames, 105 532 draws | no | | 7 | yes | 28 s | 35 frames, 87 664 draws | no | | 8 | yes | 160 s | 6 frames, 23 039 draws | yes, 147 s into the world | - Without the change `XCL_DRED=1` names the same place in two runs: a list of 139 operations with 45 done, the next one `ClearUnorderedAccessView` (the first clear of the list; before it 17 barriers, 10 WriteBufferImmediate, 5 ResolveQueryData, 3 Dispatch, 3 ExecuteIndirect, 2 draws, 2 buffer copies and 2 texture copies), and the system log has the driver's "stopped responding" (event 4101) for each of the five runs. - With it the title makes two clears there, of a 20 MB buffer and of an 80x45 `R32_FLOAT` texture, each with a GPU handle and a CPU handle from two console heaps, and goes on (three runs of three). - **The device is still lost in every run, later and in other ways:** in runs 6 and 7 without a hang (no event in the system log, no GPU wait timed out, `XCL_DRED=1` names no list; local video memory 13.7 - 13.9 GB of a 15.0 GB budget), in run 8 with one that starts 10 s after a compute pipeline of 1.0 MB of DXIL came out of the driver (70 s in it), which is not this change's subject. **Regression run** main: ``` xcl-smoke v1 commit: 06c9f5505f63f10c5ec49ef932d75b2c28177324 gpu: NVIDIA GeForce RTX 5080 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1255 (PresentX 1256) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14084 MB ``` PR (this PR's head commit): ``` xcl-smoke v1 commit: 9606785c5e7bd97c5a2c01fd9e1462dd2f90da3b gpu: NVIDIA GeForce RTX 5080 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1338 (PresentX 1338) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14071 MB ``` A second round of the same two binaries: `main` 1169 frames, PR 1154. These 60 s end in the title's menus, before its first ClearUnorderedAccessView: the pair shows nothing else changed, not the fix. **Not tested** - The title on this head itself: the runs are on the local tree named, with the same hooks (there with a log line for the first calls, and `ensure_view_heap` called for every translated clear, not only for a view in the shared heap). - A clear with rectangles (the title passes none) and a clear whose slots are not in the shared heap, in a title (the GPU test has that case; in the title's runs the view heap is in the shared heap). - AMD and Intel GPUs, native 64-lane waves, Linux / Wine; other titles. **AI use** - Claude Code with Claude Fable 5.2: found the cause from the device-removal trace, wrote the change and its tests, ran the suite and the title runs on the machine named, and wrote this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The two calls (list #53 / #54) went to the PC with the handles as the title gave
them. Those are addresses of slots in a console view heap, which the PC took
for descriptor handles: a retail title's first such clear in its world hung the
GPU (the driver stopped responding; the device-removal trace names a list of
139 operations with 45 done and the clear next).

The list now looks the two handles up as console slots and gives the PC the
UAV's GPU handle in the heap that is bound and its CPU handle, as the older
console list already does. Handles that are no console slots go on as they are.

Part of #675.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:27:43 +00:00
github-bot closed this pull request 2026-11-26 05:27:43 +00:00
Author
Owner

@⁠SlopTart on GitHub · 2026-11-25 14:50 UTC · original

Wine/vkd3d-proton lane: verified, clean.

Tested: head 9606785c merged onto current origin/main (auto-merge, clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).

  • gpu_ suite (--release --locked, --test-threads=2): 141 passed / 4 failed / 1 ignored. Three failures are the rig's known baseline (fuzz seed 1003 of #2115, gpu_nonfused_mad_and_mac_prevent_fma_contraction, gpu_depth_buffer_created_for_unordered_access_is_placed); the fourth, gpu_geometry_wave32_prefix_count_over_a_mask, is this rig's known flaky family (main reproduces it too; solo reruns on this very branch 2/2 green). No delta from this change.

The handle-translation fix itself is on the console-list clear path, which the data-free suite lane cannot exercise; it only shows that nothing else breaks with it in.

Not tested: the retail-title clear path that hangs without this fix (no title data on this lane, counts only).

AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.

**@⁠SlopTart** on GitHub · 2026-11-25 14:50 UTC · [original](https://github.com/xcl-dev/xcl/pull/2329#issuecomment-7165900346) **Wine/vkd3d-proton lane: verified, clean.** **Tested**: head `9606785c` merged onto current `origin/main` (auto-merge, clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target `x86_64-pc-windows-gnu` run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29). - `gpu_` suite (`--release --locked`, `--test-threads=2`): 141 passed / 4 failed / 1 ignored. Three failures are the rig's known baseline (fuzz seed 1003 of #2115, `gpu_nonfused_mad_and_mac_prevent_fma_contraction`, `gpu_depth_buffer_created_for_unordered_access_is_placed`); the fourth, `gpu_geometry_wave32_prefix_count_over_a_mask`, is this rig's known flaky family (main reproduces it too; solo reruns on this very branch 2/2 green). No delta from this change. The handle-translation fix itself is on the console-list clear path, which the data-free suite lane cannot exercise; it only shows that nothing else breaks with it in. **Not tested**: the retail-title clear path that hangs without this fix (no title data on this lane, counts only). **AI use**: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
Author
Owner

@⁠nnonno91 on GitHub · 2026-11-25 14:53 UTC · original

Independent Radeon iGPU and RTX 5090 readback through the title-facing slots on 9606785c5e7bd97c5a2c01fd9e1462dd2f90da3b.

Tested

  • Windows 11 25H2 build 26200.9974, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, unoptimized profile. AMD Radeon(TM) Graphics driver 32.0.21042.62 and RTX 5090 driver 32.0.16.1742.
  • On the unchanged head, cargo test --locked -p xcl --lib <filter> -- --nocapture --test-threads=1 with filters clear_uav_handles_are_those and the_command_list_hooks_clear gave 1 passed, 0 failed each.
  • For the GPU readback I temporarily adapted clear_unordered_access_view_takes_the_slots_of_a_console_heap to select and print the named adapter, and call #53/#54 through the wrapped list from a registered synthetic title caller. A first attempt from the unregistered test harness took the PC call path, so I registered the caller as in the existing title-list layout test before collecting the results below.
  • With the same Cargo command and the GPU fixture filter, both XCL_ADAPTER=AMD Radeon and XCL_ADAPTER=NVIDIA GeForce RTX 5090 gave 1 passed, 0 failed. Both title slots returned and all 4,096 texels of each R32_UINT and R32_FLOAT texture matched the respective clear value on both GPUs. No ignores or skips in the reported passing runs. The temporary changes were restored.

Not tested

The parent, a retail title, the shared-heap GPU path, and the full workspace suite.

AI use

OpenAI Codex (GPT-6.2 Sol) adapted the test fixture, ran the checks and wrote this report.

**@⁠nnonno91** on GitHub · 2026-11-25 14:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/2329#issuecomment-7165971056) Independent Radeon iGPU and RTX 5090 readback through the title-facing slots on `9606785c5e7bd97c5a2c01fd9e1462dd2f90da3b`. **Tested** - Windows 11 25H2 build 26200.9974, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, unoptimized profile. AMD Radeon(TM) Graphics driver 32.0.21042.62 and RTX 5090 driver 32.0.16.1742. - On the unchanged head, `cargo test --locked -p xcl --lib <filter> -- --nocapture --test-threads=1` with filters `clear_uav_handles_are_those` and `the_command_list_hooks_clear` gave 1 passed, 0 failed each. - For the GPU readback I temporarily adapted `clear_unordered_access_view_takes_the_slots_of_a_console_heap` to select and print the named adapter, and call #53/#54 through the wrapped list from a registered synthetic title caller. A first attempt from the unregistered test harness took the PC call path, so I registered the caller as in the existing title-list layout test before collecting the results below. - With the same Cargo command and the GPU fixture filter, both `XCL_ADAPTER=AMD Radeon` and `XCL_ADAPTER=NVIDIA GeForce RTX 5090` gave 1 passed, 0 failed. Both title slots returned and all 4,096 texels of each R32_UINT and R32_FLOAT texture matched the respective clear value on both GPUs. No ignores or skips in the reported passing runs. The temporary changes were restored. **Not tested** The parent, a retail title, the shared-heap GPU path, and the full workspace suite. **AI use** OpenAI Codex (GPT-6.2 Sol) adapted the test fixture, ran the checks and wrote this report.
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-25 14:58 UTC · original

Independent RX 6800M check of exact PR head 9606785c5e7bd97c5a2c01fd9e1462dd2f90da3b.

Environment: Windows 11 build 26200; Ryzen 9 5980HX; discrete AMD Radeon RX 6800M driver 30.0.13002.13003 alongside integrated Radeon graphics; Rust 1.99.0 MSVC; DXC/DXIL 1.9.2609.5. Isolated debug Cargo target.

Clean-head tests: The command-list hook and GPU clear_unordered_access_view tests passed 2/0/0, and clear_uav_handles_are_those_of_the_pc_heap_behind_the_slots passed 1/0/0, with no skips. The checked-in GPU fixture creates the default D3D12 device without printing its adapter, so its clean-head pass alone is not attributable to the RX 6800M.

Selected-RX GPU readback: I changed only the GPU fixture's device selection locally to use gpu::adapter::Selector::from_env_or("auto") and candidates, then ran clear_unordered_access_view_takes_the_slots_of_a_console_heap with XCL_ADAPTER=6800M. It printed ClearUnorderedAccessView test adapter: AMD Radeon RX 6800M and passed 1/0/0, no skip. The fixture clears R32_UINT and R32_FLOAT UAV textures through console-heap slot addresses and checks the resulting GPU values. I removed the selector edit and verified the exact-head worktree is clean.

Limits: Focused synthetic tests only. I did not run the full workspace suite, a paired owned-title smoke, or the retail world's first clear on this head. A separate title smoke attempt for another PR had stopped under the available-commit memory guard. This check does not establish that later device loss in the author's title runs is resolved.

AI use: OpenAI Codex (GPT-6; exact variant unavailable in this session) ran the Windows tests, made and restored the test-only selector, and drafted this report. No game data was used.

**@⁠luckyteagirl** on GitHub · 2026-11-25 14:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/2329#issuecomment-7166110643) Independent RX 6800M check of exact PR head `9606785c5e7bd97c5a2c01fd9e1462dd2f90da3b`. **Environment:** Windows 11 build 26200; Ryzen 9 5980HX; discrete AMD Radeon RX 6800M driver `30.0.13002.13003` alongside integrated Radeon graphics; Rust 1.99.0 MSVC; DXC/DXIL 1.9.2609.5. Isolated debug Cargo target. **Clean-head tests:** The command-list hook and GPU `clear_unordered_access_view` tests passed **2/0/0**, and `clear_uav_handles_are_those_of_the_pc_heap_behind_the_slots` passed **1/0/0**, with no skips. The checked-in GPU fixture creates the default D3D12 device without printing its adapter, so its clean-head pass alone is not attributable to the RX 6800M. **Selected-RX GPU readback:** I changed only the GPU fixture's device selection locally to use `gpu::adapter::Selector::from_env_or("auto")` and `candidates`, then ran `clear_unordered_access_view_takes_the_slots_of_a_console_heap` with `XCL_ADAPTER=6800M`. It printed `ClearUnorderedAccessView test adapter: AMD Radeon RX 6800M` and passed **1/0/0**, no skip. The fixture clears R32_UINT and R32_FLOAT UAV textures through console-heap slot addresses and checks the resulting GPU values. I removed the selector edit and verified the exact-head worktree is clean. **Limits:** Focused synthetic tests only. I did not run the full workspace suite, a paired owned-title smoke, or the retail world's first clear on this head. A separate title smoke attempt for another PR had stopped under the available-commit memory guard. This check does not establish that later device loss in the author's title runs is resolved. **AI use:** OpenAI Codex (GPT-6; exact variant unavailable in this session) ran the Windows tests, made and restored the test-only selector, and drafted this report. No game data was used.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-25 14:50 UTC · original · edited 2026-11-25 15:12 UTC

Independent Windows check of 9606785. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC and DXC 1.8.2502.11.

The clean head passed cargo build --offline --locked --workspace -j 6. cargo test --offline --locked --workspace --no-fail-fast -j 6 -- --test-threads=4 --nocapture finished with 1,268 passed, 0 failed, 46 ignored, including 26 runtime skips. The stock console-slot GPU clear test passed.

I also extended the fixture, without changing runtime code, to use separate shader-visible GPU and non-shader-visible CPU heaps as required by D3D12’s clear API. For both R32_UINT and R32_FLOAT, readback confirmed 288 texels updated and 3,808 retained their original values. Both standard and GPU-based validation passed with zero skipped tests, debug-layer warnings or errors, and a healthy device. The focused command was cargo test --offline --locked -p xcl --lib -j 6 clear_unordered_access_view_takes_the_slots_of_a_console_heap -- --test-threads=1 --nocapture.

I also ran a separate shared-heap case for D80 on the same head. With heap windows enabled and no descriptor heap initially bound, the console clear bound the shared heap and filled all 4,096 texels in each of the R32_UINT and R32_FLOAT textures with the expected value. The focused test passed with zero skips or D3D12 debug-layer warnings or errors. The device remained healthy.

Synthetic inputs only. No retail world-load run on this machine.

AI-assisted. Codex (GPT-6, exact variant unavailable) extended the temporary fixture, ran the tests and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-25 14:50 UTC · [original](https://github.com/xcl-dev/xcl/pull/2329#issuecomment-7165897427) · edited 2026-11-25 15:12 UTC Independent Windows check of [9606785](https://github.com/xcl-dev/xcl/commit/9606785c5e7bd97c5a2c01fd9e1462dd2f90da3b). Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC and DXC 1.8.2502.11. The clean head passed `cargo build --offline --locked --workspace -j 6`. `cargo test --offline --locked --workspace --no-fail-fast -j 6 -- --test-threads=4 --nocapture` finished with **1,268 passed, 0 failed, 46 ignored**, including 26 runtime skips. The stock console-slot GPU clear test passed. I also extended the fixture, without changing runtime code, to use separate shader-visible GPU and non-shader-visible CPU heaps as required by [D3D12’s clear API](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-clearunorderedaccessviewfloat). For both R32_UINT and R32_FLOAT, readback confirmed **288 texels updated and 3,808 retained their original values**. Both standard and GPU-based validation passed with zero skipped tests, debug-layer warnings or errors, and a healthy device. The focused command was `cargo test --offline --locked -p xcl --lib -j 6 clear_unordered_access_view_takes_the_slots_of_a_console_heap -- --test-threads=1 --nocapture`. I also ran a separate shared-heap case for [D80](https://git.gtahub.st/github/xcl-dev--xcl/issues/1607) on the same head. With heap windows enabled and no descriptor heap initially bound, the console clear bound the shared heap and filled all 4,096 texels in each of the R32_UINT and R32_FLOAT textures with the expected value. The focused test passed with zero skips or D3D12 debug-layer warnings or errors. The device remained healthy. Synthetic inputs only. No retail world-load run on this machine. AI-assisted. Codex (GPT-6, exact variant unavailable) extended the temporary fixture, ran the tests and drafted this report.
Author
Owner

@⁠throny on GitHub · 2026-11-25 15:33 UTC · original

Two contributors checked independently and found that #1291 solves the same problem (for #675) in a different way: #1607, group D80. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.

This is a hint from the community triage in #1607, not a maintainer decision.

AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.

**@⁠throny** on GitHub · 2026-11-25 15:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/2329#issuecomment-7167025437) <!-- xcl-1607-hint:D80 --> Two contributors checked independently and found that #1291 solves the same problem (for #675) in a different way: #1607, group D80. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Author
Owner

@⁠bmjask on GitHub · 2026-11-25 16:01 UTC · original

High — The clear can pass D3D12 a CPU descriptor from a shader-visible heap. clear_uav_handles checks the GPU slot’s visibility, then forwards c.pc_uav from the CPU slot’s backing heap without checking that heap’s visibility. The committed GPU test exercises exactly this case by passing the same slot from one shader-visible heap as both arguments. D3D12 explicitly requires the CPU descriptor to live in a non-shader-visible heap. A reviewer’s temporary two-heap test passed with validation enabled, which supports the normal two-heap path. Before merge, use a CPU-only descriptor for any supported same-slot clear and commit the two-heap regression test. Implementation and fixture · D3D12 handle requirements

Medium — The committed GPU test bypasses the shared-heap branch used by the game. It binds a private heap and calls clear_uav_uint_x and clear_uav_float_x directly. A separate test checks the slot numbers. An independent reviewer successfully exercised the title-facing slots on AMD and NVIDIA, but explicitly excluded the shared heap. The retail runs used a modified tree that called ensure_view_heap unconditionally. I’d add one readback test that calls slots 53 and 54 through the wrapped list, uses a shared GPU heap and a separate CPU heap, and starts with no explicitly bound view heap. That would catch a regression where the handle arithmetic is correct but the command list lacks the heap containing the descriptor.

**@⁠bmjask** on GitHub · 2026-11-25 16:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/2329#issuecomment-7167531613) High — The clear can pass D3D12 a CPU descriptor from a shader-visible heap. clear_uav_handles checks the GPU slot’s visibility, then forwards c.pc_uav from the CPU slot’s backing heap without checking that heap’s visibility. The committed GPU test exercises exactly this case by passing the same slot from one shader-visible heap as both arguments. D3D12 explicitly requires the CPU descriptor to live in a non-shader-visible heap. A reviewer’s temporary two-heap test passed with validation enabled, which supports the normal two-heap path. Before merge, use a CPU-only descriptor for any supported same-slot clear and commit the two-heap regression test. [Implementation and fixture](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2329/files) · [D3D12 handle requirements](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-clearunorderedaccessviewuint) Medium — The committed GPU test bypasses the shared-heap branch used by the game. It binds a private heap and calls clear_uav_uint_x and clear_uav_float_x directly. A separate test checks the slot numbers. An independent reviewer successfully exercised the title-facing slots on AMD and NVIDIA, but explicitly excluded the shared heap. The retail runs used a modified tree that called ensure_view_heap unconditionally. I’d add one readback test that calls slots 53 and 54 through the wrapped list, uses a shared GPU heap and a separate CPU heap, and starts with no explicitly bound view heap. That would catch a regression where the handle arithmetic is correct but the command list lacks the heap containing the descriptor.
Author
Owner

@⁠imnicho on GitHub · 2026-11-25 16:12 UTC · original

Closing this in favour of #1291, which fixes the same thing the same way and was opened a day earlier (I missed it in my search; the triage hint in #1607, group D80, and @⁠jessenic on #505 pointed it out). My retail-title measurements from this PR are now on #1291: #1291

Thank you @⁠thehollowedone, @⁠SlopTart, @⁠nnonno91 and @⁠luckyteagirl for the test reports here. They exercised the same handle translation, so I have mentioned them on #1291, where they do not count for its head.

The one thing this PR had that #1291 does not is the ensure_view_heap call before a clear whose GPU handle is in the shared heap; I have noted it there for its author to judge.

AI use: Claude Code with Claude Fable 5.2 wrote this.

**@⁠imnicho** on GitHub · 2026-11-25 16:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/2329#issuecomment-7167689155) Closing this in favour of #1291, which fixes the same thing the same way and was opened a day earlier (I missed it in my search; the triage hint in #1607, group D80, and @⁠jessenic on #505 pointed it out). My retail-title measurements from this PR are now on #1291: https://git.gtahub.st/github/xcl-dev--xcl/pulls/1291 Thank you @⁠thehollowedone, @⁠SlopTart, @⁠nnonno91 and @⁠luckyteagirl for the test reports here. They exercised the same handle translation, so I have mentioned them on #1291, where they do not count for its head. The one thing this PR had that #1291 does not is the `ensure_view_heap` call before a clear whose GPU handle is in the shared heap; I have noted it there for its author to judge. AI use: Claude Code with Claude Fable 5.2 wrote this.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 18:04 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 18:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/2329#issuecomment-7170405062) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.