GPU: find a list in the DRED breadcrumbs by its name, not only its pointer #669

Manually merged
github merged 3 commits from gh-pr/669/head into gh-pr/669/base 2026-11-26 04:12:18 +00:00
Owner

@⁠iurysf on GitHub · 2026-11-24 06:30 UTC · original
iurysf:dred-breadcrumb-identity → main · +221 −11 · 1 files · 3 commits · merged 2026-11-25 00:16 UTC

With VICTORY_D3D12_DRED=1, every list in the device-removed report shows as None. removal_data compares as_raw() of the host list with the node's pCommandList, and on an RTX 4070 (driver 32.0.16.2101, main d2a4bae) no pointer ever matches, with or without the debug layer: "2/2 None", "24/24 None", ... on every node.

  • With device-removed data on, each host list is named victory host list <n> when it is made. A node is matched by the name the runtime copied (pCommandListDebugNameW or ...A) as well as by pointer.
  • With the debug layer on, the runtime records the name as victory host list <n> (debug layer indirect). So the name is matched exactly or followed by (, never as the prefix of another number (...1580 does not match ...158).
  • The pointer is compared against every interface pointer of our live list (itself, IUnknown, ID3D12Object, ID3D12DeviceChild, ID3D12CommandList). The node's pointer is never dereferenced, because a node can name a list that is long released.
  • If no node names one of our lists, a warning logs the last node's pointer and names, for the next diagnosis.

On the GPU (RTX 4070, main d2a4bae + this PR, no other fixes, so the device still goes):

removed at nodes named stalled node slow list in the log
DEBUG=1 + DRED=1 232 s 23 of 428 (Some(0)…Some(22)) 144/926 Some(21) list 21, 130 commands, 5,524 ms: the same list
DRED=1 only 162 s (page fault) 13 of 489 0/25 Some(12) none (page fault, not a hang)
before this PR, either mode 0 (all None)

The stalled node now names the list that hung and how far it got.

The branch has three commits: the name match, a position-based fallback, and the commit that replaces that fallback with the debug-layer suffix match. The net diff is +221/−11 in host.rs, about half of it tests, so a squash merge reads best.

Tests (WARP, --test-threads=1): the new unit tests cover pointer and name matching, the debug-layer suffix, and the negative cases (...1580, ...7(). Without the suffix branch they fail. cargo test -p victory-gpu: 46 passed, 1 ignored (48 with diagnostics); cargo test -p victory-shader: 69 passed. Clippy shows no new warnings; cargo xtask policy is ok.

One run of each configuration, with the host CPU busy. No game data used. AI-assisted.

**@⁠iurysf** on GitHub · 2026-11-24 06:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/669) `iurysf:dred-breadcrumb-identity` → `main` · +221 −11 · 1 files · 3 commits · merged 2026-11-25 00:16 UTC With `VICTORY_D3D12_DRED=1`, every list in the device-removed report shows as `None`. `removal_data` compares `as_raw()` of the host list with the node's `pCommandList`, and on an RTX 4070 (driver 32.0.16.2101, main `d2a4bae`) no pointer ever matches, with or without the debug layer: `"2/2 None", "24/24 None", ...` on every node. - With device-removed data on, each host list is named `victory host list <n>` when it is made. A node is matched by the name the runtime copied (`pCommandListDebugNameW` or `...A`) as well as by pointer. - With the debug layer on, the runtime records the name as `victory host list <n> (debug layer indirect)`. So the name is matched exactly **or** followed by ` (`, never as the prefix of another number (`...1580` does not match `...158`). - The pointer is compared against every interface pointer of our live list (itself, `IUnknown`, `ID3D12Object`, `ID3D12DeviceChild`, `ID3D12CommandList`). The node's pointer is never dereferenced, because a node can name a list that is long released. - If no node names one of our lists, a warning logs the last node's pointer and names, for the next diagnosis. **On the GPU** (RTX 4070, main `d2a4bae` + this PR, no other fixes, so the device still goes): | | removed at | nodes named | stalled node | slow list in the log | |---|---|---|---|---| | `DEBUG=1` + `DRED=1` | 232 s | 23 of 428 (`Some(0)`…`Some(22)`) | `144/926 Some(21)` | list 21, 130 commands, **5,524 ms**: the same list | | `DRED=1` only | 162 s (page fault) | 13 of 489 | `0/25 Some(12)` | none (page fault, not a hang) | | before this PR, either mode | | 0 (all `None`) | | | The stalled node now names the list that hung and how far it got. The branch has three commits: the name match, a position-based fallback, and the commit that replaces that fallback with the debug-layer suffix match. The net diff is +221/−11 in `host.rs`, about half of it tests, so a squash merge reads best. Tests (WARP, `--test-threads=1`): the new unit tests cover pointer and name matching, the debug-layer suffix, and the negative cases (`...1580`, `...7(`). Without the suffix branch they fail. `cargo test -p victory-gpu`: 46 passed, 1 ignored (48 with diagnostics); `cargo test -p victory-shader`: 69 passed. Clippy shows no new warnings; `cargo xtask policy` is ok. One run of each configuration, with the host CPU busy. No game data used. AI-assisted.
The device-removed report matched a breadcrumb node to a submitted list by
comparing `as_raw()` of the list with the node's `pCommandList`. On an
RTX 4070 no node ever matched, even without the debug layer: every list
was reported as `None`.

With device-removed data on, each host list is now named ("victory host
list <n>") when it is made, and a node is also matched by the name the
runtime copied (`pCommandListDebugNameW`). The pointer is still compared
first, against every interface pointer our live list answers with (its
own, IUnknown, ID3D12Object, ID3D12DeviceChild, ID3D12CommandList). The
node's pointer is only compared, never dereferenced: a node may name a list
that is long released.

With the debug layer on (`VICTORY_D3D12_DEBUG=1`) the nodes still do not
match; that case is left open.

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
With VICTORY_D3D12_DEBUG=1 and VICTORY_D3D12_DRED=1 every breadcrumb node
still came out as `None` (a run on an RTX 4070: 389 of 389): neither the
pointer nor the name set with SetName reached a node of the list we hold,
because the debug layer hands us its own list objects and the runtime
records others. No public interface returns the object underneath
(ID3D12DebugCommandList has none), so nothing about the object can be
compared.

Nodes are linked in the order the lists ran. So, with device-removed data
on, every submission now starts with one more list made of nothing but 17
markers (`Host::sentinel`; no list of the title's work has that many markers
and so few other commands), and when no node matches a list by pointer or
name the report takes the nodes after the last such list as the submission's
lists, in the order `execute` ran them (`positional`; a prelude has no run).
The report says "matched by position after the submission's first list"
when it did, and logs the last node's pointer and names when nothing
matched, for the next iteration.

Also name each list with the two private data keys the runtime reads for a
node's ANSI and wide name (`WKPDID_D3DDebugObjectName` and `...NameW`), in
addition to SetName, and compare both name fields of a node.

Tests: the positional mapping and the sentinel signature on hand-made
nodes, and a submission with the sentinel list on the software adapter
(it shows no breadcrumb nodes, so the report itself is not checked there).

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
A run on an RTX 4070 with the debug layer on showed why a list's name did
not match a node: the runtime appends its own note to the name we gave,
as in "victory host list 158 (debug layer indirect)". The name now matches
exactly or followed by " (", and never as the start of another number
("victory host list 1580"). Both name fields of the node are read, as before.

That makes the sentinel list and the matching by position of the previous
commit unnecessary, so they are removed, together with the extra private
data keys it set: lists are named with SetName again. The warning that
logs the last node's pointer and names when no node matches a list stays.

Tests: the name with the note matches in the wide and the ANSI field, a
longer number and a name without the " (" do not; with the match for the
exact name disabled or loosened to a prefix, the tests fail.

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:12:17 +00:00
github manually merged commit 52d528ba0c into gh-pr/669/base 2026-11-26 04:12:18 +00:00
Author
Owner

@⁠iurysf on GitHub · 2026-11-24 08:01 UTC · original

Update: the debug-layer case is fixed now. With VICTORY_D3D12_DEBUG=1, the runtime records our list name with a (debug layer indirect) suffix, so the name now matches exactly or followed by (. On the RTX 4070 with DEBUG=1 + DRED=1, the stalled node is 144/926 Some(21), and list 21 (130 commands) is the 5,524 ms slow list in the log. The description has the table. Thanks @⁠LAKSHYA-cmd-tech and @⁠catminou4 for the reviews; the new commit 52d528b adds the suffix match and its negative tests.

**@⁠iurysf** on GitHub · 2026-11-24 08:01 UTC · [original](https://github.com/Marvisak/VIctory/pull/669#issuecomment-7125632807) Update: the debug-layer case is fixed now. With `VICTORY_D3D12_DEBUG=1`, the runtime records our list name with a ` (debug layer indirect)` suffix, so the name now matches exactly or followed by ` (`. On the RTX 4070 with `DEBUG=1` + `DRED=1`, the stalled node is `144/926 Some(21)`, and list 21 (130 commands) is the 5,524 ms slow list in the log. The description has the table. Thanks @⁠LAKSHYA-cmd-tech and @⁠catminou4 for the reviews; the new commit `52d528b` adds the suffix match and its negative tests.
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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/Marvisak--VIctory!669
No description provided.