Add opt-in GPU breadcrumbs for hosts without DRED #332

Closed
Melanpan wants to merge 607 commits from upstream-pr/332 into main
Melanpan commented 2026-11-27 17:06:41 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by Melanpan on 2026-11-27T17:06:41Z.


✨ Claude-sama made this! ✨ The breadcrumbs from #221, as a diagnostics-only PR with the switch off by default.

What

Under vkd3d-proton D3D12's device-removed data is a stub (SetAutoBreadcrumbsEnablement … stub!), and a card that faults is often never reported lost: the title only stops presenting. VICTORY_GPU_CRUMBS=1 (diagnostics builds; off by default) adds breadcrumbs of our own:

  • Every command a host list notes (HostList::note, so every note_op/note_read site) writes two words into a readback buffer with WriteBufferImmediate, one pair per list: "reached" (MARKER_IN) and "done" (MARKER_OUT, everything before the command finished). close writes "done" for the whole list, and reset drops the list's slot.
  • When no frame is presented for 3 s (and every 10 s after that while none is, four times at most), or the device is removed (log_removal_context), the lists whose "reached" is ahead of their "done" are logged with the commands in between, as the list noted them.
  • With VICTORY_GPU_TIMING=1 each group is sent and waited for alone. The report then names the group sent last and that list's own state, so one command is named even when the card stopped before the list's first noted command.

Nothing changes without the switch: every hook is #[cfg(feature = "diagnostics")] and returns at once unless VICTORY_GPU_CRUMBS=1. The buffer (16,384 slots of 8 bytes) is made on first use.

What it found (RTX 5090, 620.73.04, GE-Proton11-14 + view-tree server, series-s)

VICTORY_GPU_TIMING=1 VICTORY_GPU_CRUMBS=1 VKD3D_CONFIG=fault:

Run Build In flight at the Xid 13
16 e45051a + patch list #8 dispatch 87x1x1 [compute fdd56d97a806bcca], done_before=8 done_known=true reached=9
17 e45051a + patch the same command
19 this branch (on 23ae2e8) a list sent alone that noted no command before the fault (the report before the per-list line existed)
20 this branch (on 23ae2e8) list of 106 commands, #37 draw 3x1 [vertex 88dc833624e2c5ec, pixel a7cfe758751c20aa] into one 128×128 f10 target, done_before=37 done_known=true reached=38. Its tables have SRVs, CBVs and samplers only, no UAV, yet vkd3d-proton reports WriteInvalid

So there is a second faulting path, as @zmelumian972 found by skipping fdd56d97a806bcca. Run 18 showed the first version reporting 0.6 s before its fault (presents had stood for 3 s already) and never again, which is why it now reports again while presents stand.

Tested

  • cargo clippy --target x86_64-pc-windows-msvc -p victory-gpu --all-targets -- -D warnings, with and without --features diagnostics: clean.
  • New unit tests host::crumbs::tests::{the_words_say_where_the_card_is, reports_while_presents_stand} pass (run under GE-Proton's Wine).
  • cargo build --profile diag -p victory --features diagnostics on 151b7db + this commit.
  • Live runs 19 and 20 above were on this code, before the rebase onto 151b7db (the rebase was clean, and the build and tests were rerun after it).
  • Not tested on Windows or AMD.
  • The new file is rustfmt-clean (rustfmt.toml). The host.rs hooks follow the surrounding code.

Refs #221.

🤖 Generated with Claude Code

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5530401787 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/332). Originally posted by [Melanpan](https://github.com/Melanpan) on 2026-11-27T17:06:41Z. --- ✨ **Claude-sama made this!** ✨ The breadcrumbs from #221, as a diagnostics-only PR with the switch off by default. ## What Under vkd3d-proton D3D12's device-removed data is a stub (`SetAutoBreadcrumbsEnablement … stub!`), and a card that faults is often never reported lost: the title only stops presenting. `VICTORY_GPU_CRUMBS=1` (diagnostics builds; off by default) adds breadcrumbs of our own: - Every command a host list notes (`HostList::note`, so every `note_op`/`note_read` site) writes two words into a readback buffer with `WriteBufferImmediate`, one pair per list: "reached" (`MARKER_IN`) and "done" (`MARKER_OUT`, everything before the command finished). `close` writes "done" for the whole list, and `reset` drops the list's slot. - When no frame is presented for 3 s (and every 10 s after that while none is, four times at most), or the device is removed (`log_removal_context`), the lists whose "reached" is ahead of their "done" are logged with the commands in between, as the list noted them. - With `VICTORY_GPU_TIMING=1` each group is sent and waited for alone. The report then names the group sent last and that list's own state, so one command is named even when the card stopped before the list's first noted command. Nothing changes without the switch: every hook is `#[cfg(feature = "diagnostics")]` and returns at once unless `VICTORY_GPU_CRUMBS=1`. The buffer (16,384 slots of 8 bytes) is made on first use. ## What it found (RTX 5090, 620.73.04, GE-Proton11-14 + view-tree server, `series-s`) `VICTORY_GPU_TIMING=1 VICTORY_GPU_CRUMBS=1 VKD3D_CONFIG=fault`: | Run | Build | In flight at the Xid 13 | | --- | --- | --- | | 16 | `e45051a` + patch | list `#8 dispatch 87x1x1 [compute fdd56d97a806bcca]`, `done_before=8 done_known=true reached=9` | | 17 | `e45051a` + patch | the same command | | 19 | this branch (on `23ae2e8`) | a list sent alone that noted no command before the fault (the report before the per-list line existed) | | 20 | this branch (on `23ae2e8`) | list of 106 commands, `#37 draw 3x1 [vertex 88dc833624e2c5ec, pixel a7cfe758751c20aa]` into one 128×128 `f10` target, `done_before=37 done_known=true reached=38`. Its tables have SRVs, CBVs and samplers only, no UAV, yet vkd3d-proton reports `WriteInvalid` | So there is a second faulting path, as @zmelumian972 found by skipping `fdd56d97a806bcca`. Run 18 showed the first version reporting 0.6 s *before* its fault (presents had stood for 3 s already) and never again, which is why it now reports again while presents stand. ## Tested - `cargo clippy --target x86_64-pc-windows-msvc -p victory-gpu --all-targets -- -D warnings`, with and without `--features diagnostics`: clean. - New unit tests `host::crumbs::tests::{the_words_say_where_the_card_is, reports_while_presents_stand}` pass (run under GE-Proton's Wine). - `cargo build --profile diag -p victory --features diagnostics` on `151b7db` + this commit. - Live runs 19 and 20 above were on this code, before the rebase onto `151b7db` (the rebase was clean, and the build and tests were rerun after it). - Not tested on Windows or AMD. - The new file is rustfmt-clean (`rustfmt.toml`). The `host.rs` hooks follow the surrounding code. Refs #221. 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Pull request closed

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
TaynanGT/Vice-Tay!332
No description provided.