Release builds keep the faulting address of a lost device; VICTORY_D3D12_DRED=light gives them the breadcrumbs #3701

Closed
Lyrnc wants to merge 1 commit from upstream-pr/3701 into main
Lyrnc commented 2026-11-30 04:21:28 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Lyrnc on 2026-11-30T04:21:28Z.


Problem

A release build cannot say where a lost device stopped. Every VICTORY_D3D12_DRED switch (dred_on, dred_light, dred_faults in host.rs) was cfg!(feature = "diagnostics") && ..., so a release build never asked the runtime for device-removed data. When a submission then found the device removed, removal_data got DXGI_ERROR_UNSUPPORTED from GetAutoBreadcrumbsOutput and printed no breadcrumbs (0x887A0004). That line is in many device-loss reports (#2644, #2980, #3230 and others). The diagnostics build, the only way to get the data, has often not compiled (#2908, and main's own 41adb551).

The settings are the runtime's own (D3D12GetDebugInterface for ID3D12DeviceRemovedExtendedDataSettings) and need no debug layer, so a release build can have them.

Fix

VICTORY_D3D12_DRED is read once into a Dred mode (dred_of, by build):

Value Release build Diagnostics build
unset faults none (as before)
0 none none
faults the faulting address and the allocations it lies in, by the names we give them same
light also the runtime's breadcrumbs after every command: the command each unfinished list stopped at, what its indirect executions ran, the pipelines it binds same
any other (1) as light (a release build has no texts) also a marker text before every noted command, as =1 did
  • faults is the release default. It has no breadcrumbs, no markers and no texts. The code already called it "costs next to nothing, can stay on while the title is played", and scripts/play.ps1 runs with it. With it, host::name gives our objects their names in a release build too, so the report can name the allocation that was hit.
  • light works in release builds. What the report needs for it is no longer diagnostics-only: the lists' notes for a report made on another thread (LIST_NOTES, now a struct ListNotes and a list_noted helper), the record of each list's indirect executions (host::indirects), the last user data bound (draw::State::user, kept only while breadcrumbs are on), describe_slot(s) and indirects_around. Marker texts stay diagnostics-only.
  • The report says what it has. removal_report(device, runs, mode) (split out of removal_data, and breadcrumbs() out of that) says no device-removed data (VICTORY_D3D12_DRED=0) (in a diagnostics build, that it keeps it with =faults, light or 1), no page-fault data (<error>), or with faults and no fault, no page fault (VICTORY_D3D12_DRED=light names the command a list stopped at), instead of no breadcrumbs (0x887A0004).
  • docs/README-fxceless.md: the switch's row gives the three values and the release default.

Verification

Windows 11, rustc 1.98.1 (the pinned toolchain), Ryzen 7 9800X3D. On c65cbb6d (rebased onto 41adb551), target directory C:\gt-dred, every build log showing victory-gpu built from C:\g-dred\crates\victory-gpu:

  • cargo check -p victory-gpu --locked -j 6: passes. cargo check -p victory-gpu --features diagnostics --locked -j 6: passes. Both have the same 18 victory-gpu warnings as main, none in the lines this touches.
  • cargo test -p victory-gpu --lib --locked -j 6 -- host::: 220 passed, 0 failed, 27 ignored (main 41adb551 with the same filter: 215 passed, 26 ignored). The first run of this filter had 2 failures in tests this does not touch, host::card_steps::tests::places_written_after_sending_are_learned and host::menu::tests::a_change_is_saved_at_once_however_the_game_was_started (global state shared between tests; #3618 is about the menu one). They passed alone and in the second run of the whole filter.
  • The same with --features diagnostics: 227 passed, 0 failed, 27 ignored.
  • The tests of this change:
    • device_removed_data_by_the_switch_and_the_build: the table above, value by value, for both builds.
    • breadcrumbs_name_where_a_list_stopped: two nodes linked as the runtime links them. The one that finished is counted, not named. The one that stopped at an indirect execution is named with its commands between barriers, what that execution ran (found through LIST_NOTES by the list's name, as for a report from another thread) and its pipelines.
    • a_list_is_found_by_the_number_in_its_name: now in release builds too.
    • a_removed_device_has_the_runtimes_breadcrumbs (ignored by default: it removes the process's WARP device). Run alone, cargo test -p victory-gpu --lib removed_device -- --ignored --test-threads=1: 1 passed, in the release build and in the diagnostics build. It asks for the settings with no debug layer, makes a WARP device, runs a list, removes the device (ID3D12Device5::RemoveDevice), and checks that light gives the runtime's breadcrumbs, faults says "no page fault ...", and 0 says it kept none.
  • cargo clippy -p victory-gpu --all-targets --locked -j 6, and the same with --features diagnostics: finish with warnings only. None is on a line this adds (checked against git diff -U0 41adb551 c65cbb6d), and in the four files it touches the warnings are the same, kind by kind, as main's.

NOT tested

  • No game run. No device loss was seen in a release build with this. The WARP test above is the only removed device.
  • The cost of the release default (faults) is not measured. Two things are new in a release build by default: the runtime's page-fault tracking (it records allocations as they are made and freed), and a SetName (a formatted name and an HSTRING) on each object host::name is called for: about 50 places (35 outside host.rs) that make textures, buffers, title-memory copies and pipelines. The triage note asked for an fps A/B with faults and with light before proposing a default: not done. If the A/B shows a cost, release can default to none (one line in dred_of).
  • light in a release build is not measured either. The 37 ms of card time a frame (RTX 2080 Ti) is the existing figure for breadcrumbs, from scripts/play.ps1.
  • Wine/Proton: not checked whether vkd3d-proton gives the settings object. If not, the start says "no device-removed data ... the runtime has no settings for it" and the report says what it has, as above.

Overlap

  • gh pr list --state open --search: "DRED", "breadcrumbs", "device removed", "0x887A0004", "page fault", "D3D12_DRED". No open PR makes device-removed data work in release builds.
  • #3686 (Lyrnc, fix/indirect-null-slot, open): touches the same code (ran_indirect, describe_slots, host::indirects, the user data in draw.rs). It adds a tables argument and a user_tables field, still under #[cfg(feature = "diagnostics")]. git merge-tree of the two: conflicts in 5 hunks in 4 files (descriptor/host.rs 1, draw.rs 3, host.rs 1, host/indirects.rs 1). All are the same kind: this branch removes a cfg(diagnostics) where #3686 changes the signature. Whichever lands second takes the other's signature, drops the cfg, and un-gates user_tables and table_words (and uses dred_breadcrumbs() where #3686 has dred_on() || dred_light()).
  • #3309 (spk-c) touches host.rs: merges cleanly.
  • #2048 (eleboucher, diagnostics build fix) is the same as main's 41adb551.

AI use

Claude Code (Claude Opus 5.5) wrote the change and its tests, ran the checks listed above, and wrote this note. Nothing was run in game.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5558931968 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3701). Originally posted by [Lyrnc](https://github.com/Lyrnc) on 2026-11-30T04:21:28Z. --- ## Problem A release build cannot say where a lost device stopped. Every `VICTORY_D3D12_DRED` switch (`dred_on`, `dred_light`, `dred_faults` in `host.rs`) was `cfg!(feature = "diagnostics") && ...`, so a release build never asked the runtime for device-removed data. When a submission then found the device removed, `removal_data` got `DXGI_ERROR_UNSUPPORTED` from `GetAutoBreadcrumbsOutput` and printed `no breadcrumbs (0x887A0004)`. That line is in many device-loss reports (#2644, #2980, #3230 and others). The diagnostics build, the only way to get the data, has often not compiled (#2908, and main's own 41adb551). The settings are the runtime's own (`D3D12GetDebugInterface` for `ID3D12DeviceRemovedExtendedDataSettings`) and need no debug layer, so a release build can have them. ## Fix `VICTORY_D3D12_DRED` is read once into a `Dred` mode (`dred_of`, by build): | Value | Release build | Diagnostics build | |---|---|---| | unset | `faults` | none (as before) | | `0` | none | none | | `faults` | the faulting address and the allocations it lies in, by the names we give them | same | | `light` | also the runtime's breadcrumbs after every command: the command each unfinished list stopped at, what its indirect executions ran, the pipelines it binds | same | | any other (`1`) | as `light` (a release build has no texts) | also a marker text before every noted command, as `=1` did | - **`faults` is the release default.** It has no breadcrumbs, no markers and no texts. The code already called it "costs next to nothing, can stay on while the title is played", and `scripts/play.ps1` runs with it. With it, `host::name` gives our objects their names in a release build too, so the report can name the allocation that was hit. - **`light` works in release builds.** What the report needs for it is no longer diagnostics-only: the lists' notes for a report made on another thread (`LIST_NOTES`, now a struct `ListNotes` and a `list_noted` helper), the record of each list's indirect executions (`host::indirects`), the last user data bound (`draw::State::user`, kept only while breadcrumbs are on), `describe_slot(s)` and `indirects_around`. Marker texts stay diagnostics-only. - **The report says what it has.** `removal_report(device, runs, mode)` (split out of `removal_data`, and `breadcrumbs()` out of that) says `no device-removed data (VICTORY_D3D12_DRED=0)` (in a diagnostics build, that it keeps it with `=faults`, `light` or `1`), `no page-fault data (<error>)`, or with `faults` and no fault, `no page fault (VICTORY_D3D12_DRED=light names the command a list stopped at)`, instead of `no breadcrumbs (0x887A0004)`. - `docs/README-fxceless.md`: the switch's row gives the three values and the release default. ## Verification Windows 11, rustc 1.98.1 (the pinned toolchain), Ryzen 7 9800X3D. On c65cbb6d (rebased onto 41adb551), target directory `C:\gt-dred`, every build log showing `victory-gpu` built from `C:\g-dred\crates\victory-gpu`: - `cargo check -p victory-gpu --locked -j 6`: passes. `cargo check -p victory-gpu --features diagnostics --locked -j 6`: passes. Both have the same 18 victory-gpu warnings as main, none in the lines this touches. - `cargo test -p victory-gpu --lib --locked -j 6 -- host::`: **220 passed, 0 failed, 27 ignored** (main 41adb551 with the same filter: 215 passed, 26 ignored). The first run of this filter had 2 failures in tests this does not touch, `host::card_steps::tests::places_written_after_sending_are_learned` and `host::menu::tests::a_change_is_saved_at_once_however_the_game_was_started` (global state shared between tests; #3618 is about the menu one). They passed alone and in the second run of the whole filter. - The same with `--features diagnostics`: **227 passed, 0 failed, 27 ignored.** - The tests of this change: - `device_removed_data_by_the_switch_and_the_build`: the table above, value by value, for both builds. - `breadcrumbs_name_where_a_list_stopped`: two nodes linked as the runtime links them. The one that finished is counted, not named. The one that stopped at an indirect execution is named with its commands between barriers, what that execution ran (found through `LIST_NOTES` by the list's name, as for a report from another thread) and its pipelines. - `a_list_is_found_by_the_number_in_its_name`: now in release builds too. - `a_removed_device_has_the_runtimes_breadcrumbs` (ignored by default: it removes the process's WARP device). Run alone, `cargo test -p victory-gpu --lib removed_device -- --ignored --test-threads=1`: **1 passed**, in the release build and in the diagnostics build. It asks for the settings with no debug layer, makes a WARP device, runs a list, removes the device (`ID3D12Device5::RemoveDevice`), and checks that `light` gives the runtime's breadcrumbs, `faults` says "no page fault ...", and `0` says it kept none. - `cargo clippy -p victory-gpu --all-targets --locked -j 6`, and the same with `--features diagnostics`: finish with warnings only. **None is on a line this adds** (checked against `git diff -U0 41adb551 c65cbb6d`), and in the four files it touches the warnings are the same, kind by kind, as main's. ## NOT tested - **No game run.** No device loss was seen in a release build with this. The WARP test above is the only removed device. - **The cost of the release default (`faults`) is not measured.** Two things are new in a release build by default: the runtime's page-fault tracking (it records allocations as they are made and freed), and a `SetName` (a formatted name and an `HSTRING`) on each object `host::name` is called for: about 50 places (35 outside `host.rs`) that make textures, buffers, title-memory copies and pipelines. The triage note asked for an fps A/B with `faults` and with `light` before proposing a default: not done. If the A/B shows a cost, release can default to none (one line in `dred_of`). - `light` in a release build is not measured either. The 37 ms of card time a frame (RTX 2080 Ti) is the existing figure for breadcrumbs, from `scripts/play.ps1`. - Wine/Proton: not checked whether vkd3d-proton gives the settings object. If not, the start says "no device-removed data ... the runtime has no settings for it" and the report says what it has, as above. ## Overlap - `gh pr list --state open --search`: "DRED", "breadcrumbs", "device removed", "0x887A0004", "page fault", "D3D12_DRED". No open PR makes device-removed data work in release builds. - **#3686** (Lyrnc, `fix/indirect-null-slot`, open): touches the same code (`ran_indirect`, `describe_slots`, `host::indirects`, the user data in `draw.rs`). It adds a `tables` argument and a `user_tables` field, still under `#[cfg(feature = "diagnostics")]`. `git merge-tree` of the two: conflicts in 5 hunks in 4 files (`descriptor/host.rs` 1, `draw.rs` 3, `host.rs` 1, `host/indirects.rs` 1). All are the same kind: this branch removes a `cfg(diagnostics)` where #3686 changes the signature. Whichever lands second takes the other's signature, drops the cfg, and un-gates `user_tables` and `table_words` (and uses `dred_breadcrumbs()` where #3686 has `dred_on() || dred_light()`). - #3309 (spk-c) touches `host.rs`: merges cleanly. - #2048 (eleboucher, diagnostics build fix) is the same as main's 41adb551. ## AI use Claude Code (Claude Opus 5.5) wrote the change and its tests, ran the checks listed above, and wrote this note. Nothing was run in game. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
trustno1-coder commented 2026-12-01 18:49:42 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:49:42Z.


Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7321625334 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3701#issuecomment-7321625334). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-12-01T18:49:42Z. --- Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

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
trustno1-coder/VIctory-NVIDIA!3701
No description provided.