Live D3D12 Debug Layer on NVIDIA (0a43566): 1,791x ID 538 (COPY_DEST root SRVs), 706x ID 646 (UAV-in-SRV tables), plus strict-driver state hazards #36

Open
opened 2026-11-26 03:31:28 +00:00 by github-bot · 0 comments
Owner

@⁠owsware on GitHub · 2026-11-25 23:57 UTC · original

Context

Open PR #5 cleans up the synthetic replay test fixture errors (ID 538, ID 1003), but live gameplay under VICTORY_D3D12_DEBUG=1 on commit 0a43566 still emits severity-1 validation errors.

Measured on RTX 5080 (driver 576.80, Windows 11 Build 22631, -Safe + VICTORY_LATE_WAIT_LISTS=32 + VICTORY_SKIP_PIPELINES=none, 154.9 s, 11.3 fps / 88.2 ms/frame, zero crashes):

D3D12 ID Severity Count Summary
721 1 8,160 GetResourceAllocationInfo: 4KB alignment requested on textures with mip0 > 64KB (A8_UNORM 1024x1024/2048x2048, R9G9B9E5_SHAREDEXP 1280x720)
538 1 1,791 SetComputeRootShaderResourceView reading buffer in D3D12_RESOURCE_STATE_COPY_DEST (promoted from COMMON)
646 1 706 SetComputeRootDescriptorTable Parameter [1] Range [0] (D3D12_DESCRIPTOR_RANGE_TYPE_SRV) bound to UAV descriptor
971 2 21 Load*Pipeline cold cache misses
820 2 7 ClearRenderTargetView clear value mismatch
622 1 6 CreateComputeShader: WaveSize 64 > 32 (tracked in separate Wave32 issue)
253 2 3 CreateInputLayout with 0 elements
1013 2 2 CreateDescriptorHeap NumDescriptors 4194304 and 2097152 Tier-3 warnings

(Note: ID 523, ID 527, and ID 1003 did not appear in this live debug run.)

1. Live ID 538 (1,791x) — Compute Root SRV Reading COPY_DEST

Debug output:

D3D12: ID3D12CommandQueue::ExecuteCommandLists: Using SetComputeRootShaderResourceView on Command List (...): Resource state (...: D3D12_RESOURCE_STATE_COPY_DEST) (promoted from COMMON state) of resource (...) is invalid for use as a root shader resource. Expected State Bits (all): D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE|D3D12_RESOURCE_STATE_RAYTRACING_ACCELERATION_STRUCTURE, Assumed Actual State: D3D12_RESOURCE_STATE_COPY_DEST

Code paths where CopyBufferRegion promotes a COMMON buffer to COPY_DEST without always transitioning back to NON_PIXEL_SHADER_RESOURCE before SetComputeRootShaderResourceView:

  • crates/victory-gpu/src/host.rs:4270-4302: CopyBufferRegion(&shadow.buffer, ...) runs, then if own.is_none() && before.is_some() && !ranges.is_empty() transitions COPY_DEST -> NON_PIXEL_SHADER_RESOURCE, skipping transitions in other branches before SetComputeRootShaderResourceView(1, shadow.buffer...).
  • crates/victory-gpu/src/host/send.rs:277-293: CopyBufferRegion(&shadow.buffer, ...) promotes shadow.buffer to COPY_DEST, and only transitions to NON_PIXEL_SHADER_RESOURCE when hashed && (!copy.runs.is_empty() || copy.pairs.1 > 0).
  • crates/victory-gpu/src/indirect.rs:511-546: record_clamp_as assumes src / count stay in COMMON/GENERIC_READ, which breaks if a copy earlier on the same list promoted the buffer to COPY_DEST.

2. Live ID 646 (706x) — UAV Descriptor in Compute SRV Range

Debug output spans both direct guest descriptor slots (424490, 604470) and dynamic table slots (735198, 767041, 818502, 906461):

D3D12: CGraphicsCommandList::SetComputeRootDescriptorTable: Specified GPU Descriptor Handle (... at 604470 offsetInDescriptorsFromDescriptorHeapStart) of type UAV, for Root Signature (...)'s Descriptor Table (at Parameter Index [1])'s Descriptor Range (at Range Index [0] of type D3D12_DESCRIPTOR_RANGE_TYPE_SRV) have mismatching types.

Mixed guest descriptor ranges mirrored via HostHeap::mirror or cloned via State::tables (draw.rs:3385, host.make_at) can contain UAV views (unordered = true) inside a root signature range typed strictly as D3D12_DESCRIPTOR_RANGE_TYPE_SRV.

3. Additional Strict-Driver / Multi-Pass Hazards Noted

While auditing 0a43566 against NVIDIA D3D12 behavior:

  • Depth clear vs queued depth-plane resolve (crates/victory-gpu/src/list.rs:1418): clear_dsv calls list.twin_use(record.resource, false, true) right before ClearDepthStencilView without resolving shader-written depth planes into the depth resource beforehand. If a queued depth resolve runs at list close, it can overwrite a partial ClearDepthStencilView, causing subsequent equal-depth passes to reject cleared pixels.
  • R9G9B9E5_SHAREDEXP castability on R32_UINT (ID 28): Strict D3D12 drivers trigger DXGI_ERROR_INVALID_CALL device removal if an R9G9B9E5_SHAREDEXP SRV is created over an R32_UINT UAV resource without verifying OPTIONS12 castable format list support or using a separate typed alias texture + bit-preserving CopyResource.
  • Integer RT blending (R8_UINT): Open PR #20 clears BlendEnable for integer render targets only on its RDNA1 mesh-to-compute fallback path; strict drivers also require BlendEnable = false per integer RTV on the main graphics/mesh pipeline path (pipeline/host.rs).
  • Global UAV barrier fallback (ID 523): Ensure UAV resource barriers referencing textures without D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS fall back to a global (pResource = NULL) UAV barrier so list close cannot fail E_INVALIDARG.
  • Sparse alias virtual tail pressure: Full-tail sparse aliases reserve up to ~1 TiB of virtual VA (DXGI_ERROR_DRIVER_INTERNAL_ERROR risk on high-alias workloads); bounding sparse alias reservations to element-aligned view windows ([FirstElement..end]) reduces virtual VA footprint dramatically (~52 GiB vs ~997 GiB observed in earlier NVIDIA runs).
**@⁠owsware** on GitHub · 2026-11-25 23:57 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/issues/36) ## Context Open PR #5 cleans up the synthetic `replay` test fixture errors (`ID 538`, `ID 1003`), **but live gameplay under `VICTORY_D3D12_DEBUG=1` on commit `0a43566` still emits severity-1 validation errors**. Measured on RTX 5080 (driver `576.80`, Windows 11 Build `22631`, `-Safe` + `VICTORY_LATE_WAIT_LISTS=32` + `VICTORY_SKIP_PIPELINES=none`, `154.9 s`, `11.3 fps` / `88.2 ms/frame`, zero crashes): | D3D12 ID | Severity | Count | Summary | | :--- | ---: | ---: | :--- | | `721` | `1` | `8,160` | `GetResourceAllocationInfo`: `4KB` alignment requested on textures with mip0 > `64KB` (`A8_UNORM` `1024x1024`/`2048x2048`, `R9G9B9E5_SHAREDEXP` `1280x720`) | | `538` | `1` | `1,791` | `SetComputeRootShaderResourceView` reading buffer in `D3D12_RESOURCE_STATE_COPY_DEST (promoted from COMMON)` | | `646` | `1` | `706` | `SetComputeRootDescriptorTable` Parameter `[1]` Range `[0]` (`D3D12_DESCRIPTOR_RANGE_TYPE_SRV`) bound to `UAV` descriptor | | `971` | `2` | `21` | `Load*Pipeline` cold cache misses | | `820` | `2` | `7` | `ClearRenderTargetView` clear value mismatch | | `622` | `1` | `6` | `CreateComputeShader`: `WaveSize 64 > 32` (tracked in separate Wave32 issue) | | `253` | `2` | `3` | `CreateInputLayout` with `0` elements | | `1013` | `2` | `2` | `CreateDescriptorHeap` `NumDescriptors` `4194304` and `2097152` Tier-3 warnings | *(Note: `ID 523`, `ID 527`, and `ID 1003` did **not** appear in this live debug run.)* ## 1. Live `ID 538` (`1,791x`) — Compute Root SRV Reading `COPY_DEST` Debug output: ```text D3D12: ID3D12CommandQueue::ExecuteCommandLists: Using SetComputeRootShaderResourceView on Command List (...): Resource state (...: D3D12_RESOURCE_STATE_COPY_DEST) (promoted from COMMON state) of resource (...) is invalid for use as a root shader resource. Expected State Bits (all): D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE|D3D12_RESOURCE_STATE_RAYTRACING_ACCELERATION_STRUCTURE, Assumed Actual State: D3D12_RESOURCE_STATE_COPY_DEST ``` Code paths where `CopyBufferRegion` promotes a `COMMON` buffer to `COPY_DEST` without always transitioning back to `NON_PIXEL_SHADER_RESOURCE` before `SetComputeRootShaderResourceView`: - `crates/victory-gpu/src/host.rs:4270-4302`: `CopyBufferRegion(&shadow.buffer, ...)` runs, then `if own.is_none() && before.is_some() && !ranges.is_empty()` transitions `COPY_DEST -> NON_PIXEL_SHADER_RESOURCE`, skipping transitions in other branches before `SetComputeRootShaderResourceView(1, shadow.buffer...)`. - `crates/victory-gpu/src/host/send.rs:277-293`: `CopyBufferRegion(&shadow.buffer, ...)` promotes `shadow.buffer` to `COPY_DEST`, and only transitions to `NON_PIXEL_SHADER_RESOURCE` when `hashed && (!copy.runs.is_empty() || copy.pairs.1 > 0)`. - `crates/victory-gpu/src/indirect.rs:511-546`: `record_clamp_as` assumes `src` / `count` stay in `COMMON`/`GENERIC_READ`, which breaks if a copy earlier on the same list promoted the buffer to `COPY_DEST`. ## 2. Live `ID 646` (`706x`) — `UAV` Descriptor in Compute `SRV` Range Debug output spans **both** direct guest descriptor slots (`424490`, `604470`) and dynamic table slots (`735198`, `767041`, `818502`, `906461`): ```text D3D12: CGraphicsCommandList::SetComputeRootDescriptorTable: Specified GPU Descriptor Handle (... at 604470 offsetInDescriptorsFromDescriptorHeapStart) of type UAV, for Root Signature (...)'s Descriptor Table (at Parameter Index [1])'s Descriptor Range (at Range Index [0] of type D3D12_DESCRIPTOR_RANGE_TYPE_SRV) have mismatching types. ``` Mixed guest descriptor ranges mirrored via `HostHeap::mirror` or cloned via `State::tables` (`draw.rs:3385`, `host.make_at`) can contain `UAV` views (`unordered = true`) inside a root signature range typed strictly as `D3D12_DESCRIPTOR_RANGE_TYPE_SRV`. ## 3. Additional Strict-Driver / Multi-Pass Hazards Noted While auditing `0a43566` against NVIDIA D3D12 behavior: - **Depth clear vs queued depth-plane resolve (`crates/victory-gpu/src/list.rs:1418`)**: `clear_dsv` calls `list.twin_use(record.resource, false, true)` right before `ClearDepthStencilView` without resolving shader-written depth planes into the depth resource beforehand. If a queued depth resolve runs at list close, it can overwrite a partial `ClearDepthStencilView`, causing subsequent equal-depth passes to reject cleared pixels. - **`R9G9B9E5_SHAREDEXP` castability on `R32_UINT` (`ID 28`)**: Strict D3D12 drivers trigger `DXGI_ERROR_INVALID_CALL` device removal if an `R9G9B9E5_SHAREDEXP` SRV is created over an `R32_UINT` UAV resource without verifying `OPTIONS12` castable format list support or using a separate typed alias texture + bit-preserving `CopyResource`. - **Integer RT blending (`R8_UINT`)**: Open PR #20 clears `BlendEnable` for integer render targets only on its RDNA1 mesh-to-compute fallback path; strict drivers also require `BlendEnable = false` per integer RTV on the main graphics/mesh pipeline path (`pipeline/host.rs`). - **Global UAV barrier fallback (`ID 523`)**: Ensure `UAV` resource barriers referencing textures without `D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS` fall back to a global (`pResource = NULL`) UAV barrier so list close cannot fail `E_INVALIDARG`. - **Sparse alias virtual tail pressure**: Full-tail sparse aliases reserve up to `~1 TiB` of virtual VA (`DXGI_ERROR_DRIVER_INTERNAL_ERROR` risk on high-alias workloads); bounding sparse alias reservations to element-aligned view windows (`[FirstElement..end]`) reduces virtual VA footprint dramatically (~`52 GiB` vs ~`997 GiB` observed in earlier NVIDIA runs).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:31:28 +00:00
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/avatarmanz--VIctory-7900XTX#36
No description provided.