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

Merged
iurysf merged 3 commits from upstream-pr/669 into main 2026-11-25 00:16:54 +00:00
iurysf commented 2026-11-24 06:30:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by iurysf on 2026-11-24T06:30:39Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6576075665 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/669). Originally posted by [iurysf](https://github.com/iurysf) on 2026-11-24T06:30:39Z. --- 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.
LAKSHYA-cmd-tech commented 2026-11-24 06:54:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T06:38:39Z.

Review: APPROVED


LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. All 46 tests in ictory-gpu passed cleanly, including the three new tests (_breadcrumb_node_is_found_by_pointer_or_by_name, _list_knows_every_pointer_it_answers_with, and is_node_reads_the_name_the_runtime_copied). Matching DRED breadcrumb command lists by both name and interface pointers resolves the None issue caused by debug layer wrapping and interface polymorphism.

<!-- greyfinch-sync:Marvisak/VIctory:review:6034758596 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/669#pullrequestreview-6034758596). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T06:38:39Z. **Review:** APPROVED --- LGTM! Tested on Windows 11 with MSVC Rust 1.98.1. All 46 tests in ictory-gpu passed cleanly, including the three new tests (_breadcrumb_node_is_found_by_pointer_or_by_name, _list_knows_every_pointer_it_answers_with, and is_node_reads_the_name_the_runtime_copied). Matching DRED breadcrumb command lists by both name and interface pointers resolves the None issue caused by debug layer wrapping and interface polymorphism.
catminou4 commented 2026-11-24 07:01:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T06:56:24Z.

Review: COMMENTED


Static review only (victory-gpu is Windows/D3D12; the tests need a D3D12 device, which I don't have on macOS):

  • The three new tests are well-targeted: pure node_is_list/list_name logic, COM identity pointers via QueryInterface on a WARP device, and a hand-built D3D12_AUTO_BREADCRUMB_NODE. The name-fallback matching (name matches even when the pointer is another object) is intentional per the doc comment and covered by a_list_knows_every_pointer_it_answers_with.
  • identities() only queries live objects and compares node pointers by value — correct call given device-removed nodes can name released lists.
  • Naming lists victory host list N only when DRED is enabled keeps normal runs unchanged.

Can't execute the WARP tests here; the logic reads sound.

<!-- greyfinch-sync:Marvisak/VIctory:review:6034939822 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/669#pullrequestreview-6034939822). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T06:56:24Z. **Review:** COMMENTED --- Static review only (victory-gpu is Windows/D3D12; the tests need a D3D12 device, which I don't have on macOS): - The three new tests are well-targeted: pure `node_is_list`/`list_name` logic, COM identity pointers via `QueryInterface` on a WARP device, and a hand-built `D3D12_AUTO_BREADCRUMB_NODE`. The name-fallback matching (name matches even when the pointer is another object) is intentional per the doc comment and covered by `a_list_knows_every_pointer_it_answers_with`. - `identities()` only queries live objects and compares node pointers by value — correct call given device-removed nodes can name released lists. - Naming lists `victory host list N` only when DRED is enabled keeps normal runs unchanged. Can't execute the WARP tests here; the logic reads sound.
iurysf commented 2026-11-24 08:02:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by iurysf on 2026-11-24T08:01:20Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7125632807 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/669#issuecomment-7125632807). Originally posted by [iurysf](https://github.com/iurysf) on 2026-11-24T08:01:20Z. --- 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.
mercuryVM commented 2026-11-24 11:03:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T10:44:48Z.

Review: APPROVED


Tested 52d528b on Windows 11, RTX 5070, MSVC: cargo test -p victory-gpu -- --test-threads=1 46 passed, and with --features diagnostics 48 passed. cargo check -p victory-gpu --features diagnostics --tests is clean. I didn't trigger a device removal here, so I haven't reproduced the "None on every node" report myself.

  • Matching by pCommandListDebugNameW, then pCommandListDebugNameA, as a fallback when no pointer matches is the right order. The tests cover a missing wide name and a longer name with the same prefix (victory host list 1 vs … 10).
  • identities collecting every interface pointer the list answers with is a sensible guess at why the raw pointer never matched (the runtime keeps the pointer of a different interface).
  • Naming happens only with device-removed data on, so normal runs don't pay for it.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6037789274 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/669#pullrequestreview-6037789274). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T10:44:48Z. **Review:** APPROVED --- Tested 52d528b on Windows 11, RTX 5070, MSVC: `cargo test -p victory-gpu -- --test-threads=1` 46 passed, and with `--features diagnostics` 48 passed. `cargo check -p victory-gpu --features diagnostics --tests` is clean. I didn't trigger a device removal here, so I haven't reproduced the "None on every node" report myself. - Matching by `pCommandListDebugNameW`, then `pCommandListDebugNameA`, as a fallback when no pointer matches is the right order. The tests cover a missing wide name and a longer name with the same prefix (`victory host list 1` vs `… 10`). - `identities` collecting every interface pointer the list answers with is a sensible guess at why the raw pointer never matched (the runtime keeps the pointer of a different interface). - Naming happens only with device-removed data on, so normal runs don't pay for it. AI-assisted (Claude Code).
upstream-sync closed this pull request 2026-11-25 01:04:43 +00:00
Sign in to join this conversation.
No reviewers
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!669
No description provided.