d3d12: descriptor_paging mixes 64-byte native stride authoring with 32-byte INLINE_BYTES lookup on RADV #182

Closed
opened 2026-11-26 06:36:47 +00:00 by github-bot · 0 comments
Owner

@⁠DrArroway on GitHub · 2026-11-25 17:38 UTC · original

Summary

On AMD RADV under Proton Experimental (vkd3d-proton 3.2.0), lanes-selftest-descriptor-reclaim (#172) fails in Phase 1 (sustained turnover) on main (7b22d71):

lanes-selftest FAIL descriptor-reclaim: sustained turnover mismatch at output 0: expected 0x00071bd9, found 0xdeadbeef

Note: this is distinct from PR #178's Phase 5 E_OUTOFMEMORY heap-limit issue — on RX 6900 XT + Mesa RADV, the first sustained turnover dispatch fails even with TUXBOX_DESCRIPTOR_HEAP_LIMIT=1000000. All 64 other gates in tuxbox.py verify pass on the same checkout (64/65).

Environment

  • Commit: 7b22d71
  • GPU: AMD Radeon RX 6900 XT (1002:73bf)
  • Driver: Mesa RADV 26.3.1-arch3.4 (CachyOS Linux)
  • Proton: Proton Experimental (1794497090 experimental-11.0-20261112-x86_64, vkd3d-proton 3.2.0)

Controlled repro matrix

Running lanes.exe --selftest descriptor-reclaim --adapter 1002:73bf on 7b22d71:

Configuration TUXBOX_DESCRIPTOR_HEAP_LIMIT Native CBV_SRV_UAV stride Result
Default (VK_EXT_descriptor_heap enabled) unset 64 FAIL (sustained turnover mismatch at output 0, 0xdeadbeef)
Default (VK_EXT_descriptor_heap enabled) 1000000 64 FAIL (sustained turnover mismatch at output 0, 0xdeadbeef)
VKD3D_DISABLE_EXTENSIONS=VK_EXT_descriptor_heap (VK_EXT_descriptor_buffer) unset / 1000000 64 FAIL (sustained turnover mismatch at output 0, 0xdeadbeef)
VKD3D_DISABLE_EXTENSIONS=VK_EXT_descriptor_heap,VK_EXT_descriptor_buffer 1000000 / unset 32 PASS (lanes-selftest PASS pci=1002:73bf scenario=descriptor-reclaim passed=1)

Root cause in descriptor_paging

On RADV with VK_EXT_descriptor_heap or VK_EXT_descriptor_buffer, vkd3d-proton reports GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV) == 64.

  1. increment_size returns the host stride (64) to the guest, and Arena::create sets self.inline = true because owner.state.device11_queue && stride >= INLINE_BYTES && stride.is_multiple_of(INLINE_BYTES).
  2. Arena::author stores InlineDescriptor records using self.stride (64-byte spacing):
    • In lanes.exe --selftest descriptor-reclaim (examples/lanes/selftest.cpp), cpu_at(slot_base + index) places CBV at +0, SRV at +64, and UAV at +8191 * 64.
  3. Arena::gpu_table walks index using INLINE_BYTES (32-byte spacing) instead of self.stride, while Arena::publish scales table slot offsets by self.stride / INLINE_BYTES (2x).

With TUXBOX_LOG=1, only slot 0 matches and slots 1+ read unauthored zero bytes and get replaced with null Texture2D SRVs, so the compute shader never writes to dst_buf:

TuxBox d3d12_xs: materialized 1 CPU-authored descriptor records (table length 8192, native stride 64)

Using self.stride / INLINE_BYTES was written to support 32-byte Xbox inline descriptor copies on a 64-byte native stride heap (like ProjectScarlett), whereas callers/tests using GetDescriptorHandleIncrementSize() (64) author descriptors at 64-byte spacing. Disabling both VK_EXT_descriptor_heap and VK_EXT_descriptor_buffer drops native stride back to 32, where author() and gpu_table() agree and the test passes.

**@⁠DrArroway** on GitHub · 2026-11-25 17:38 UTC · [original](https://github.com/brcly/TuxBox/issues/182) ### Summary On AMD RADV under Proton Experimental (`vkd3d-proton 3.2.0`), `lanes-selftest-descriptor-reclaim` (#172) fails in Phase 1 (`sustained turnover`) on `main` (`7b22d71`): ```text lanes-selftest FAIL descriptor-reclaim: sustained turnover mismatch at output 0: expected 0x00071bd9, found 0xdeadbeef ``` Note: this is distinct from PR #178's Phase 5 `E_OUTOFMEMORY` heap-limit issue — on RX 6900 XT + Mesa RADV, the first `sustained turnover` dispatch fails even with `TUXBOX_DESCRIPTOR_HEAP_LIMIT=1000000`. All 64 other gates in `tuxbox.py verify` pass on the same checkout (`64/65`). ### Environment - **Commit:** `7b22d71` - **GPU:** AMD Radeon RX 6900 XT (`1002:73bf`) - **Driver:** Mesa RADV `26.3.1-arch3.4` (CachyOS Linux) - **Proton:** Proton Experimental (`1794497090 experimental-11.0-20261112-x86_64`, `vkd3d-proton 3.2.0`) ### Controlled repro matrix Running `lanes.exe --selftest descriptor-reclaim --adapter 1002:73bf` on `7b22d71`: | Configuration | `TUXBOX_DESCRIPTOR_HEAP_LIMIT` | Native `CBV_SRV_UAV` stride | Result | |---|---|---:|---| | Default (`VK_EXT_descriptor_heap` enabled) | unset | `64` | **FAIL** (`sustained turnover mismatch at output 0`, `0xdeadbeef`) | | Default (`VK_EXT_descriptor_heap` enabled) | `1000000` | `64` | **FAIL** (`sustained turnover mismatch at output 0`, `0xdeadbeef`) | | `VKD3D_DISABLE_EXTENSIONS=VK_EXT_descriptor_heap` (`VK_EXT_descriptor_buffer`) | unset / `1000000` | `64` | **FAIL** (`sustained turnover mismatch at output 0`, `0xdeadbeef`) | | `VKD3D_DISABLE_EXTENSIONS=VK_EXT_descriptor_heap,VK_EXT_descriptor_buffer` | `1000000` / unset | `32` | **PASS** (`lanes-selftest PASS pci=1002:73bf scenario=descriptor-reclaim passed=1`) | ### Root cause in `descriptor_paging` On RADV with `VK_EXT_descriptor_heap` or `VK_EXT_descriptor_buffer`, `vkd3d-proton` reports `GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV) == 64`. 1. [`increment_size`](runtime/d3d12/src/device.rs#L326) returns the host stride (`64`) to the guest, and [`Arena::create`](runtime/d3d12/src/device/descriptor_paging.rs#L376) sets `self.inline = true` because `owner.state.device11_queue && stride >= INLINE_BYTES && stride.is_multiple_of(INLINE_BYTES)`. 2. [`Arena::author`](runtime/d3d12/src/device/descriptor_paging.rs#L432) stores `InlineDescriptor` records using `self.stride` (`64`-byte spacing): - In `lanes.exe --selftest descriptor-reclaim` ([`examples/lanes/selftest.cpp`](examples/lanes/selftest.cpp#L831-L910)), `cpu_at(slot_base + index)` places CBV at `+0`, SRV at `+64`, and UAV at `+8191 * 64`. 3. [`Arena::gpu_table`](runtime/d3d12/src/device/descriptor_paging/lookup.rs#L100) walks `index` using `INLINE_BYTES` (`32`-byte spacing) instead of `self.stride`, while [`Arena::publish`](runtime/d3d12/src/device/descriptor_paging.rs#L598-L614) scales table slot offsets by `self.stride / INLINE_BYTES` (`2x`). With `TUXBOX_LOG=1`, only slot 0 matches and slots 1+ read unauthored zero bytes and get replaced with null Texture2D SRVs, so the compute shader never writes to `dst_buf`: ```text TuxBox d3d12_xs: materialized 1 CPU-authored descriptor records (table length 8192, native stride 64) ``` Using `self.stride / INLINE_BYTES` was written to support 32-byte Xbox inline descriptor copies on a 64-byte native stride heap (like `ProjectScarlett`), whereas callers/tests using `GetDescriptorHandleIncrementSize()` (`64`) author descriptors at 64-byte spacing. Disabling both `VK_EXT_descriptor_heap` and `VK_EXT_descriptor_buffer` drops native stride back to `32`, where `author()` and `gpu_table()` agree and the test passes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:36:47 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.