WARP: a constant buffer read through the title's null SRV at heap slot 0 removes the device (CBV handle over an SRV descriptor) #1594

Open
opened 2026-11-24 19:39:09 +00:00 by ThomasSAMP · 3 comments
ThomasSAMP commented 2026-11-24 19:39:09 +00:00 (Migrated from github.com)
Contributor

Imported from Marvisak/VIctory. Originally posted by ThomasSAMP on 2026-11-24T19:39:09Z.


Split out of #653 (comment, point 2), as suggested there.

What happens

On WARP, with #568 and #334 applied (they remove #653's first removal), world loading ends with 0x887A0005 after a submission of one list of compute dispatches. GPU-based validation (VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_GBV=1) reports one message just before:

GPU-BASED VALIDATION: Dispatch, Descriptor type doesn't match shader register type:
Descriptor Heap Index: [0], Descriptor Type in Heap: D3D12_DESCRIPTOR_RANGE_TYPE_SRV,
Register Type: D3D12_DESCRIPTOR_RANGE_TYPE_CBV, Shader Stage: COMPUTE,
Pipeline State: '[compute 0e45e59e93b736e4]'

Why

In the DXIL that ffe310e emits for that program:

  1. it loads a dword from a raw buffer (rawBufferLoad through a heap ByteAddressBuffer);
  2. it uses that dword as a descriptor heap index (createHandleFromHeap(i32 %idx)), annotated as a constant buffer ({13, 65536});
  3. it reads it with cbufferLoadLegacy, unconditionally. A compare of the index with 0 (icmp ne) is computed, but nothing branches on it before the load.

At run time the index is 0. Heap slot 0 holds the title's null SRV: the device-removed report shows [heap 0: Shader(0, Some([42, 2, 5768, ...])) -> null], a view of no resource.

  • On the console the program does the same, and it's harmless: a constant-buffer read through a null descriptor reads zeros.
  • On D3D12, a CBV handle over an SRV descriptor is undefined behaviour.
    • WARP removes the device.
    • The RX 9070 XT gets past it in the same stack: it runs 8 minutes, into the world, before the #1317 hang. AMD probably reads the descriptor as a buffer, like the console. Other drivers may not.

#568 doesn't cover this: it fills table slots the title left empty with a typed null, but slot 0 here was written by the title, as an SRV.

Possible directions (not tried)

  • Translator. Read a constant buffer whose descriptor comes from a computed heap index as a raw buffer load (ByteAddressBuffer) instead of a CBuffer handle. That would match the SRV kind the title's heap mostly holds. It still mismatches if a slot holds a typed or structured view.
  • Translator. Guard the read on the index being non-zero. That only fits if slot 0 is the title's null descriptor by convention, which this one case doesn't prove.
  • Runtime. For a slot holding a view of no resource, choose the null descriptor's type from how shaders read it. That only works if no other shader reads the same slot as another kind, and here slot 0 is also read as an SRV.

Setup

Windows 11 Pro (build 26300), AMD Radeon RX 9070 XT (driver 32.0.32029.2010) and WARP, diagnostics build of ffe310e + #568 (cd6d559) + #334 (c99e429), own retail 1.0.2.1, Series X mode. Seen once with the debug layer alone (removal after 5 min 55) and once with GBV (removal after about 7 min, with the message above).

AI-assisted (Claude Code, Claude Opus 5.5); no game data (a shader hash and DXIL op names only).

<!-- greyfinch-sync:Marvisak/VIctory:issue:6589895592 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/1595). Originally posted by [ThomasSAMP](https://github.com/ThomasSAMP) on 2026-11-24T19:39:09Z. --- Split out of #653 ([comment](https://github.com/Marvisak/VIctory/issues/653#issuecomment-7142099910), point 2), as suggested there. ## What happens On WARP, with #568 and #334 applied (they remove #653's first removal), world loading ends with `0x887A0005` after a submission of one list of compute dispatches. GPU-based validation (`VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_GBV=1`) reports one message just before: ``` GPU-BASED VALIDATION: Dispatch, Descriptor type doesn't match shader register type: Descriptor Heap Index: [0], Descriptor Type in Heap: D3D12_DESCRIPTOR_RANGE_TYPE_SRV, Register Type: D3D12_DESCRIPTOR_RANGE_TYPE_CBV, Shader Stage: COMPUTE, Pipeline State: '[compute 0e45e59e93b736e4]' ``` ## Why In the DXIL that `ffe310e` emits for that program: 1. it loads a dword from a raw buffer (`rawBufferLoad` through a heap `ByteAddressBuffer`); 2. it uses that dword as a descriptor heap index (`createHandleFromHeap(i32 %idx)`), annotated as a constant buffer (`{13, 65536}`); 3. it reads it with `cbufferLoadLegacy`, unconditionally. A compare of the index with 0 (`icmp ne`) is computed, but nothing branches on it before the load. At run time the index is 0. Heap slot 0 holds the title's null SRV: the device-removed report shows `[heap 0: Shader(0, Some([42, 2, 5768, ...])) -> null]`, a view of no resource. - **On the console** the program does the same, and it's harmless: a constant-buffer read through a null descriptor reads zeros. - **On D3D12**, a CBV handle over an SRV descriptor is undefined behaviour. - WARP removes the device. - The RX 9070 XT gets past it in the same stack: it runs 8 minutes, into the world, before the #1317 hang. AMD probably reads the descriptor as a buffer, like the console. Other drivers may not. #568 doesn't cover this: it fills table slots the title left empty with a typed null, but slot 0 here was written by the title, as an SRV. ## Possible directions (not tried) - **Translator.** Read a constant buffer whose descriptor comes from a computed heap index as a raw buffer load (`ByteAddressBuffer`) instead of a `CBuffer` handle. That would match the SRV kind the title's heap mostly holds. It still mismatches if a slot holds a typed or structured view. - **Translator.** Guard the read on the index being non-zero. That only fits if slot 0 is the title's null descriptor by convention, which this one case doesn't prove. - **Runtime.** For a slot holding a view of no resource, choose the null descriptor's type from how shaders read it. That only works if no other shader reads the same slot as another kind, and here slot 0 is also read as an SRV. ## Setup Windows 11 Pro (build 26300), AMD Radeon RX 9070 XT (driver 32.0.32029.2010) and WARP, diagnostics build of `ffe310e` + #568 (`cd6d559`) + #334 (`c99e429`), own retail 1.0.2.1, Series X mode. Seen once with the debug layer alone (removal after 5 min 55) and once with GBV (removal after about 7 min, with the message above). AI-assisted (Claude Code, Claude Opus 5.5); no game data (a shader hash and DXIL op names only).
BastienRodz commented 2026-11-24 20:03:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by BastienRodz on 2026-11-24T19:40:01Z.


From #568's side: right, this is outside it, and #568 can't be stretched to cover it. Its typed nulls rely on two things a computed heap index doesn't have:

  • an annotation recorded at translation time, which a dynamically indexed load doesn't get (#568's shortcut: note);
  • a table to remake in fresh dynamic slots when one slot is read as two kinds. A createHandleFromHeap with a computed index reads the heap directly, so there is no table to swap.

Slot 0 here is read both as an SRV and as a CBV, so no single descriptor in that slot can be valid for both readers. That leaves your translator directions: the read itself has to stop going through a CBV handle (or not happen) when the index points at a non-CBV slot.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7142419309 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/1595#issuecomment-7142419309). Originally posted by [BastienRodz](https://github.com/BastienRodz) on 2026-11-24T19:40:01Z. --- From #568's side: right, this is outside it, and #568 can't be stretched to cover it. Its typed nulls rely on two things a computed heap index doesn't have: - an annotation recorded at translation time, which a dynamically indexed load doesn't get (#568's `shortcut:` note); - a table to remake in fresh dynamic slots when one slot is read as two kinds. A `createHandleFromHeap` with a computed index reads the heap directly, so there is no table to swap. Slot 0 here is read both as an SRV and as a CBV, so no single descriptor in that slot can be valid for both readers. That leaves your translator directions: the read itself has to stop going through a CBV handle (or not happen) when the index points at a non-CBV slot.
Marvisak commented 2026-11-25 13:02:58 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T12:47:36Z.


Automated triage for the maintainers.

The path is still in main (940d32f): in crates/victory-shader/src/emit/lower.rs, Lower::smem, a scalar buffer load is read as a raw buffer only for heap-direct constants, table entries listed as CBVs, SRVs and root UAVs; any other descriptor (such as a table slot with no used-resource entry, as here) falls through to a constant-buffer handle (13, 0x1_0000) read with cbufferLoadLegacy, unguarded. When that slot holds the title's null SRV, D3D12 sees a CBV handle over an SRV descriptor, which WARP turns into a device removal.

Open PR #2068 addresses this (unlisted table constant loads lowered as guarded raw SRVs).


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7162864611 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/1595#issuecomment-7162864611). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T12:47:36Z. --- <!-- victory-issue-triage v1 verdict=confirmed seen=2026-11-24T19:40:01Z at=2026-11-25T12:47:29Z --> Automated triage for the maintainers. The path is still in `main` (`940d32f`): in `crates/victory-shader/src/emit/lower.rs`, `Lower::smem`, a scalar buffer load is read as a raw buffer only for heap-direct constants, table entries listed as CBVs, SRVs and root UAVs; any other descriptor (such as a table slot with no used-resource entry, as here) falls through to a constant-buffer handle `(13, 0x1_0000)` read with `cbufferLoadLegacy`, unguarded. When that slot holds the title's null SRV, D3D12 sees a CBV handle over an SRV descriptor, which WARP turns into a device removal. Open PR #2068 addresses this (unlisted table constant loads lowered as guarded raw SRVs). --- _Generated by [Claude Code](https://claude.ai/code)_
ColorMeBoom commented 2026-11-27 06:06:50 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by ColorMeBoom on 2026-11-27T06:06:50Z.


This looks fixed on main, so the issue may be ready to close.

  • main (63bcca4) no longer reads constant data through a computed heap index with a CBV handle. In Lower::smem (crates/victory-shader/src/emit/lower.rs), constant data read through the resource heap itself (heap_constants, from is_heap_direct) and constant data in a table go through raw_view and rawBufferLoad, with no cbufferLoadLegacy over the slot. That's the first direction suggested above, and it matches the SRV kind the title's heap holds there.
  • That came in with c75fdba3 (views the shaders pick from the heap). d71c3889 added bounded root views and a guard against texture descriptors read as buffers. Both are on main.
  • #2068, the open PR for the remaining case, was closed on the same grounds: the case it adds (a table descriptor no used-resource entry covers) doesn't occur in the title ("0 traced parameters not listed" on a whole-set run).

I haven't rerun the original WARP world-load case, which needs the title. This is from reading main and the linked triage.

AI use: Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7211228091 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/1595#issuecomment-7211228091). Originally posted by [ColorMeBoom](https://github.com/ColorMeBoom) on 2026-11-27T06:06:50Z. --- This looks fixed on `main`, so the issue may be ready to close. - `main` (`63bcca4`) no longer reads constant data through a computed heap index with a CBV handle. In `Lower::smem` (`crates/victory-shader/src/emit/lower.rs`), constant data read through the resource heap itself (`heap_constants`, from `is_heap_direct`) and constant data in a table go through `raw_view` and `rawBufferLoad`, with no `cbufferLoadLegacy` over the slot. That's the first direction suggested above, and it matches the SRV kind the title's heap holds there. - That came in with c75fdba3 (views the shaders pick from the heap). d71c3889 added bounded root views and a guard against texture descriptors read as buffers. Both are on `main`. - #2068, the open PR for the remaining case, was closed on the same grounds: the case it adds (a table descriptor no used-resource entry covers) doesn't occur in the title ("0 traced parameters not listed" on a whole-set run). I haven't rerun the original WARP world-load case, which needs the title. This is from reading `main` and the linked triage. AI use: Claude Code (Claude Opus 5.5).
Sign in to join this conversation.
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
Marvisak/VIctory#1594
No description provided.