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

Closed
github-bot wants to merge 1 commit from github-bot/gh-332 into main AGit
Owner

@⁠Melanpan on GitHub · 2026-11-27 17:06 UTC · original
diag/gpu-breadcrumbs-221 → main · +487 −0 · 3 files · 1 commits · closed without merging

✨ 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

**@⁠Melanpan** on GitHub · 2026-11-27 17:06 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/332) `diag/gpu-breadcrumbs-221` → `main` · +487 −0 · 3 files · 1 commits · closed without merging ✨ **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)
Under vkd3d-proton D3D12's device-removed data is a stub, and a card that
faults is often never reported lost: the title only stops presenting
(#221). With VICTORY_GPU_CRUMBS=1 (diagnostics builds; off by default)
every command a host list notes writes "reached" and "done" markers into a
readback buffer with WriteBufferImmediate. When no frame is presented for
3 s (and every 10 s after that while none is), or the device is removed,
the lists whose "reached" is ahead of their "done" are logged with the
commands in between. With VICTORY_GPU_TIMING=1 the report also names the
group of lists that was sent and waited for alone, and that list's own
state, so one command is named.

On an RTX 5090 under GE-Proton11-14 this named the command in flight at
the Xid 13 of #221 in four runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 17:11:16 +00:00
github-bot closed this pull request 2026-11-27 23:51:57 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.