Diagnostics: loading lines under the frame rate, crash minidumps, the PSO budget watch and a memory-by-kind line #3074

Closed
github-bot wants to merge 6 commits from github-bot/gh-3074 into main AGit
Owner

@⁠Adriwin06 on GitHub · 2026-11-29 19:53 UTC · original
Adriwin06:diagnostics → main · +556 −24 · 17 files · 6 commits · closed without merging

What it changes

4 small changes of the same kind, one commit each, so each can be reviewed, reverted or left out on its own:

Frame-rate line: what is loading, under the frame rate (DirectStorage MB/s, reads waiting, textures due, uploads)

Under the frame rate the corner line now shows, while something is
loading or streaming, the DirectStorage read rate, the reads waiting,
the texture slots due and the uploads on the copy queue. victory-hle's
DirectStorage workers add the bytes they read and store the waiting
count in two atomics (crate::loading), the frame-rate meter takes a
snapshot on its 1 s tick, and the overlay only reads the snapshot, so
nothing is locked or computed per frame and the box repaints at most
once a second, as for the frame rate. A line is left out while its
number is zero.

The frame-rate line is drawn as rows (one per line), and its box
(line_box) is at most the picture and the back buffer, so a long line
cannot make the corner copy's box run past its picture.

Tests: menu's the_frame_rate_box_stays_inside_its_picture, loading's tests.

Ported from Kemerd/VIctory-NVIDIA-RT@a309f8e (D Everett Hinton),
GPL-3.0-or-later.

Crash reports: crash-.log and a small minidump in the game's folder

When the title crashes, the report also leaves, the first time in a
run, crash-.log (a copy of the run's log ending with the report,
named after the run's play-.log) and crash-.dmp, a small
minidump (MiniDumpNormal with thread info and unloaded modules: stacks
and module list, no heap), in the game's folder. The report names the
crashing thread (matching the minidump), names title images by the
file name the title ships them with rather than our copy's
(name_image), and keeps the last 64 lines of the title's debug output
instead of 8, enough to see past a crash reporter's own messages.

Ported from Kemerd/VIctory-NVIDIA-RT@5fbd960 (D Everett Hinton),
GPL-3.0-or-later.

Pipelines: VICTORY_PSO_BUDGET_WATCH=1 logs a VRAM budget drop right after a pipeline is made

A diagnostic, off by default (best with VICTORY_PIPELINE_WORKERS=1).
After each host graphics, mesh or compute pipeline is created, the
card's DXGI budget is read again, and a drop of 64 MB or more since the
last pipeline is logged as a warning with the pipeline's shaders, to
find the pipelines whose creation costs video memory.

Ported from DoubleGhosty/cool_fox@9a32683 (zeeboguy), GPL-3.0-or-later.

GPU memory: every 5 s, what of ours holds the card's memory, by kind

Release builds included. Every 5 s a line now breaks our use of the
card's memory down: textures the title fills (count and MB, the texture
blocks and their free part), their levels given on demand, textures the
host renders to or writes, card copies of title buffers and their
before twins, and the textures let go as idle since the start.

Ported from DoubleGhosty/cool_fox@0053fb8 (fabian-wolf09), GPL-3.0-or-later.

How it was tested

  • GPU and profile: RTX 4070 SUPER, Ryzen 7 5800X. Not measured in the title on these commits by themselves: they come from a fork of mine that carries them with the rest of this set, and the title ran there. What is below is the unit tests on this branch.
  • Before: n/a (no in-title measurement on this branch)
  • After: n/a
  • cargo test passed for the crates it touches:
    • loading-lines: no: 19 passed, 1 failed: host::menu::tests::a_change_is_saved_at_once_however_the_game_was_started (cargo test -p victory-gpu --lib -- loading:: host::menu::); the one failure is the menu tests' race on VICTORY_MENU_FILE, which fails on main too (fixed in #3061)
    • crash-minidumps: yes, cargo test -p victory-loader: 79 passed
    • pso-budget-watch: yes, cargo test -p victory-gpu --lib -- pipeline::: 70 passed
    • memory-by-kind: yes, cargo test -p victory-gpu --lib -- pool:: shadow::: 99 passed
  • cargo clippy --workspace --all-targets --locked: no finding that main does not already have (main has 34 of its own, which is why the Clippy step of CI is red on main itself).
  • cargo xtask policy: no new finding (main fails it on crates/victory-loader/src/heap_sites/frame_users.rs).
  • With all eleven of my pull requests merged together: cargo clippy also with --all-features adds no finding, and cargo test --workspace --locked fails only tests main also fails on this machine: the five shader tests that fail on main here too (WARP's SM 6.2 and the validator) (barycentric_tests::first_half_values_render_on_hardware_and_warp, hw_tests::split_lds_wave32_read_after_read_barrier_coalescing_and_parity, intersect_tests::flat_global_stores_and_atomics_fence_uavs_at_group_barriers_across_waves, rect::tests::rectangles_are_drawn_whole, rect::tests::the_rectangle_stage_is_a_geometry_shader) and xtask's repository_passes_policy (frame_users.rs). 2208 passed, including five that fail on main (three BCPack oracle tests, the menu save race, the shader key test).

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related:
    • loading-lines: None found for loading lines under the frame rate.
    • crash-minidumps: #2802 (open) keeps only the newest crash files (VICTORY_KEEP_CRASHES); it would apply to these files too. None found for minidumps.
    • pso-budget-watch: None found for VICTORY_PSO_BUDGET_WATCH.
    • memory-by-kind: None found for a memory-by-kind line.

🤖 Generated with Claude Code

**@⁠Adriwin06** on GitHub · 2026-11-29 19:53 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3074) `Adriwin06:diagnostics` → `main` · +556 −24 · 17 files · 6 commits · closed without merging ## What it changes 4 small changes of the same kind, one commit each, so each can be reviewed, reverted or left out on its own: ### Frame-rate line: what is loading, under the frame rate (DirectStorage MB/s, reads waiting, textures due, uploads) Under the frame rate the corner line now shows, while something is loading or streaming, the DirectStorage read rate, the reads waiting, the texture slots due and the uploads on the copy queue. victory-hle's DirectStorage workers add the bytes they read and store the waiting count in two atomics (crate::loading), the frame-rate meter takes a snapshot on its 1 s tick, and the overlay only reads the snapshot, so nothing is locked or computed per frame and the box repaints at most once a second, as for the frame rate. A line is left out while its number is zero. The frame-rate line is drawn as rows (one per line), and its box (line_box) is at most the picture and the back buffer, so a long line cannot make the corner copy's box run past its picture. Tests: menu's the_frame_rate_box_stays_inside_its_picture, loading's tests. Ported from Kemerd/VIctory-NVIDIA-RT@a309f8e (D Everett Hinton), GPL-3.0-or-later. ### Crash reports: crash-<run>.log and a small minidump in the game's folder When the title crashes, the report also leaves, the first time in a run, crash-<run>.log (a copy of the run's log ending with the report, named after the run's play-<run>.log) and crash-<run>.dmp, a small minidump (MiniDumpNormal with thread info and unloaded modules: stacks and module list, no heap), in the game's folder. The report names the crashing thread (matching the minidump), names title images by the file name the title ships them with rather than our copy's (name_image), and keeps the last 64 lines of the title's debug output instead of 8, enough to see past a crash reporter's own messages. Ported from Kemerd/VIctory-NVIDIA-RT@5fbd960 (D Everett Hinton), GPL-3.0-or-later. ### Pipelines: VICTORY_PSO_BUDGET_WATCH=1 logs a VRAM budget drop right after a pipeline is made A diagnostic, off by default (best with VICTORY_PIPELINE_WORKERS=1). After each host graphics, mesh or compute pipeline is created, the card's DXGI budget is read again, and a drop of 64 MB or more since the last pipeline is logged as a warning with the pipeline's shaders, to find the pipelines whose creation costs video memory. Ported from DoubleGhosty/cool_fox@9a32683 (zeeboguy), GPL-3.0-or-later. ### GPU memory: every 5 s, what of ours holds the card's memory, by kind Release builds included. Every 5 s a line now breaks our use of the card's memory down: textures the title fills (count and MB, the texture blocks and their free part), their levels given on demand, textures the host renders to or writes, card copies of title buffers and their before twins, and the textures let go as idle since the start. Ported from DoubleGhosty/cool_fox@0053fb8 (fabian-wolf09), GPL-3.0-or-later. ## How it was tested - GPU and profile: RTX 4070 SUPER, Ryzen 7 5800X. Not measured in the title on these commits by themselves: they come from a fork of mine that carries them with the rest of this set, and the title ran there. What is below is the unit tests on this branch. - Before: n/a (no in-title measurement on this branch) - After: n/a - `cargo test` passed for the crates it touches: - loading-lines: no: 19 passed, 1 failed: host::menu::tests::a_change_is_saved_at_once_however_the_game_was_started (`cargo test -p victory-gpu --lib -- loading:: host::menu::`); the one failure is the menu tests' race on VICTORY_MENU_FILE, which fails on main too (fixed in #3061) - crash-minidumps: yes, `cargo test -p victory-loader`: 79 passed - pso-budget-watch: yes, `cargo test -p victory-gpu --lib -- pipeline::`: 70 passed - memory-by-kind: yes, `cargo test -p victory-gpu --lib -- pool:: shadow::`: 99 passed - `cargo clippy --workspace --all-targets --locked`: no finding that main does not already have (main has 34 of its own, which is why the Clippy step of CI is red on main itself). - `cargo xtask policy`: no new finding (main fails it on crates/victory-loader/src/heap_sites/frame_users.rs). - With all eleven of my pull requests merged together: `cargo clippy` also with `--all-features` adds no finding, and `cargo test --workspace --locked` fails only tests main also fails on this machine: the five shader tests that fail on main here too (WARP's SM 6.2 and the validator) (barycentric_tests::first_half_values_render_on_hardware_and_warp, hw_tests::split_lds_wave32_read_after_read_barrier_coalescing_and_parity, intersect_tests::flat_global_stores_and_atomics_fence_uavs_at_group_barriers_across_waves, rect::tests::rectangles_are_drawn_whole, rect::tests::the_rectangle_stage_is_a_geometry_shader) and xtask's repository_passes_policy (frame_users.rs). 2208 passed, including five that fail on main (three BCPack oracle tests, the menu save race, the shader key test). ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: - loading-lines: None found for loading lines under the frame rate. - crash-minidumps: #2802 (open) keeps only the newest crash files (VICTORY_KEEP_CRASHES); it would apply to these files too. None found for minidumps. - pso-budget-watch: None found for VICTORY_PSO_BUDGET_WATCH. - memory-by-kind: None found for a memory-by-kind line. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Under the frame rate the corner line now shows, while something is
loading or streaming, the DirectStorage read rate, the reads waiting,
the texture slots due and the uploads on the copy queue. victory-hle's
DirectStorage workers add the bytes they read and store the waiting
count in two atomics (crate::loading), the frame-rate meter takes a
snapshot on its 1 s tick, and the overlay only reads the snapshot, so
nothing is locked or computed per frame and the box repaints at most
once a second, as for the frame rate. A line is left out while its
number is zero.

The frame-rate line is drawn as rows (one per line), and its box
(line_box) is at most the picture and the back buffer, so a long line
cannot make the corner copy's box run past its picture.

Tests: menu's the_frame_rate_box_stays_inside_its_picture, loading's tests.

Ported from Kemerd/VIctory-NVIDIA-RT@a309f8e (D Everett Hinton),
GPL-3.0-or-later.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
When the title crashes, the report also leaves, the first time in a
run, crash-<run>.log (a copy of the run's log ending with the report,
named after the run's play-<run>.log) and crash-<run>.dmp, a small
minidump (MiniDumpNormal with thread info and unloaded modules: stacks
and module list, no heap), in the game's folder. The report names the
crashing thread (matching the minidump), names title images by the
file name the title ships them with rather than our copy's
(name_image), and keeps the last 64 lines of the title's debug output
instead of 8, enough to see past a crash reporter's own messages.

Ported from Kemerd/VIctory-NVIDIA-RT@5fbd960 (D Everett Hinton),
GPL-3.0-or-later.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A diagnostic, off by default (best with VICTORY_PIPELINE_WORKERS=1).
After each host graphics, mesh or compute pipeline is created, the
card's DXGI budget is read again, and a drop of 64 MB or more since the
last pipeline is logged as a warning with the pipeline's shaders, to
find the pipelines whose creation costs video memory.

Ported from DoubleGhosty/cool_fox@9a32683 (zeeboguy), GPL-3.0-or-later.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Release builds included. Every 5 s a line now breaks our use of the
card's memory down: textures the title fills (count and MB, the texture
blocks and their free part), their levels given on demand, textures the
host renders to or writes, card copies of title buffers and their
before twins, and the textures let go as idle since the start.

Ported from DoubleGhosty/cool_fox@0053fb8 (fabian-wolf09), GPL-3.0-or-later.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 19:59:51 +00:00
@ -69,3 +104,3 @@
{}", title_output());
eprint!("{text}");
append_to_log(&text);
leave_crash_files(&text, std::ptr::null());
Author
Owner

@⁠Copilot on GitHub · 2026-11-29 19:59 UTC · original

log_crash also handles recoverable refusals from xmem::commit_refused and report_allocator_refusal, which return control to the title. Such a refusal now consumes LEFT_FILES, so a later fatal exception cannot replace the saved pair with its actual exception context. Keep recoverable reports append-only and distinguish terminal failures explicitly, preserving artifact creation for the terminal GPU-failure caller.

**@⁠Copilot** on GitHub · 2026-11-29 19:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3074#discussion_r4732934444) `log_crash` also handles recoverable refusals from `xmem::commit_refused` and `report_allocator_refusal`, which return control to the title. Such a refusal now consumes `LEFT_FILES`, so a later fatal exception cannot replace the saved pair with its actual exception context. Keep recoverable reports append-only and distinguish terminal failures explicitly, preserving artifact creation for the terminal GPU-failure caller.
@ -97,0 +156,4 @@
// `crash-<time>-<process>`), so the two are matched at a glance.
let stem = run_log
.and_then(|l| l.file_stem())
.map(|s| s.to_string_lossy().replacen("play-", "crash-", 1))
Author
Owner

@⁠Copilot on GitHub · 2026-11-29 19:59 UTC · original

With a custom VICTORY_LOG_FILE such as session.log beside victory.exe, this replacement leaves the stem unchanged, making log_copy the source log itself rather than a separate crash snapshot. A fixed custom basename also reuses the same artifact names across runs. Generate a distinct crash-prefixed, per-run stem when play- is absent.

**@⁠Copilot** on GitHub · 2026-11-29 19:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3074#discussion_r4732934456) With a custom `VICTORY_LOG_FILE` such as `session.log` beside victory.exe, this replacement leaves the stem unchanged, making `log_copy` the source log itself rather than a separate crash snapshot. A fixed custom basename also reuses the same artifact names across runs. Generate a distinct crash-prefixed, per-run stem when `play-` is absent.
@ -14079,0 +14092,4 @@
"the card's memory by kind: {} MB in use of a budget of {} MB; textures the title fills {} alive {} MB \
(in blocks {} MB, {} MB of the blocks free), their levels given on demand {} MB; textures the host renders \
to or writes {} alive {} MB; card copies of title buffers {} MB and their before twins {} MB; since the \
start {} textures the title fills let go as idle ({} MB)",
Author
Owner

@⁠Copilot on GitHub · 2026-11-29 19:59 UTC · original

shadow::card_bytes() includes the shared-memory fallback from window_card_for (shadow.rs:756–768), so this card-memory label counts system-memory buffer copies as local video memory when local allocation fails. Track local and shared storage separately, or explicitly label this aggregate as buffer storage that can include shared memory.

**@⁠Copilot** on GitHub · 2026-11-29 19:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3074#discussion_r4732934477) `shadow::card_bytes()` includes the shared-memory fallback from `window_card_for` (`shadow.rs:756–768`), so this card-memory label counts system-memory buffer copies as local video memory when local allocation fails. Track local and shared storage separately, or explicitly label this aggregate as buffer storage that can include shared memory.
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-29 19:59 UTC · original · reviewed

Recoverable reports can suppress later fatal crash diagnostics, while custom log filenames can make crash snapshots alias the source log and reuse artifact names across runs.

5 open issues
What changed in this PR

Adds runtime diagnostics for title loading, crash investigation, pipeline creation, and GPU memory use.

Changes:

  • Shows sampled loading counters beneath the frame rate, with bounded overlay dimensions.
  • Saves crash-log copies and minidumps, identifies crashing threads, and reports original title-image names.
  • Adds opt-in pipeline budget warnings and periodic GPU memory breakdowns.
File Description
crates/​victory-loader/​src/​windows.rs Registers original title DLL names for crash reports.
crates/​victory-loader/​src/​lib.rs Exports image-name registration.
crates/​victory-loader/​src/​crash.rs Adds crash artifacts, thread identification, and longer debug-output history.
crates/​victory-loader/​Cargo.toml Enables Windows filesystem APIs needed for minidumps.
crates/​victory-hle/​src/​modules/​dstorage.rs Publishes read-byte and waiting-request counters.
crates/​victory-gpu/​src/​texture/​ahead.rs Exposes the outstanding-upload count.
crates/​victory-gpu/​src/​shadow.rs Exposes buffer-copy memory totals.
crates/​victory-gpu/​src/​pool.rs Reports allocated texture-block bytes.
crates/​victory-gpu/​src/​pipeline/​host.rs Adds optional budget-drop warnings after pipeline creation.
crates/​victory-gpu/​src/​loading.rs Samples and formats loading counters, with rendering tests.
crates/​victory-gpu/​src/​lib.rs Exposes the Windows loading-diagnostics module.
crates/​victory-gpu/​src/​host/​menu.rs Draws multiline loading indicators and bounds the overlay copy.
crates/​victory-gpu/​src/​host.rs Samples loading activity and logs memory by category.
apps/​victory/​src/​run.rs Registers the main title executable’s original name.

Review effort: Balanced

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-29 19:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3074#pullrequestreview-6104544884) · **reviewed** <!-- ccr-overview-v2 --> ### 🟡 Changes recommended Recoverable reports can suppress later fatal crash diagnostics, while custom log filenames can make crash snapshots alias the source log and reuse artifact names across runs. <details open> <summary><strong>5 open issues</strong></summary> - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.png" alt="High severity" width="62" height="18" align="texttop"></picture> [Recoverable refusals can block later fatal crash context](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/3074) · New - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.png" alt="High severity" width="62" height="18" align="texttop"></picture> [Custom log names can overwrite the source or reuse crash artifacts](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/3074) · New - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> [Card-memory label counts shared buffers as local video memory](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/3074) · New - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> [Minidump and log writes bypass repository-path validation](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/3074) · New - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> [Crash log copy can race with the background logger](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/3074) · New </details> <details> <summary><strong>What changed in this PR</strong></summary> Adds runtime diagnostics for title loading, crash investigation, pipeline creation, and GPU memory use. **Changes:** - Shows sampled loading counters beneath the frame rate, with bounded overlay dimensions. - Saves crash-log copies and minidumps, identifies crashing threads, and reports original title-image names. - Adds opt-in pipeline budget warnings and periodic GPU memory breakdowns. | File | Description | | ---- | ----------- | | `crates/​victory-loader/​src/​windows.rs` | Registers original title DLL names for crash reports. | | `crates/​victory-loader/​src/​lib.rs` | Exports image-name registration. | | `crates/​victory-loader/​src/​crash.rs` | Adds crash artifacts, thread identification, and longer debug-output history. | | `crates/​victory-loader/​Cargo.toml` | Enables Windows filesystem APIs needed for minidumps. | | `crates/​victory-hle/​src/​modules/​dstorage.rs` | Publishes read-byte and waiting-request counters. | | `crates/​victory-gpu/​src/​texture/​ahead.rs` | Exposes the outstanding-upload count. | | `crates/​victory-gpu/​src/​shadow.rs` | Exposes buffer-copy memory totals. | | `crates/​victory-gpu/​src/​pool.rs` | Reports allocated texture-block bytes. | | `crates/​victory-gpu/​src/​pipeline/​host.rs` | Adds optional budget-drop warnings after pipeline creation. | | `crates/​victory-gpu/​src/​loading.rs` | Samples and formats loading counters, with rendering tests. | | `crates/​victory-gpu/​src/​lib.rs` | Exposes the Windows loading-diagnostics module. | | `crates/​victory-gpu/​src/​host/​menu.rs` | Draws multiline loading indicators and bounds the overlay copy. | | `crates/​victory-gpu/​src/​host.rs` | Samples loading activity and logs memory by category. | | `apps/​victory/​src/​run.rs` | Registers the main title executable’s original name. | </details> <sub>Review effort: Balanced</sub>
@ -97,0 +158,4 @@
.and_then(|l| l.file_stem())
.map(|s| s.to_string_lossy().replacen("play-", "crash-", 1))
.unwrap_or_else(|| format!("crash-{}", std::process::id()));
let (log_copy, dump) = (dir.join(format!("{stem}.log")), dir.join(format!("{stem}.dmp")));
Author
Owner

@⁠Copilot on GitHub · 2026-11-29 19:59 UTC · original

ROOT is the launcher's folder, not necessarily the title's, so running target/release/victory.exe writes the new minidump containing title stack memory inside the checkout. These paths bypass victory_core::ensure_outside_repo, required for derived-data writers by docs/asset-policy.md:51–52. Validate both destinations before writing and refuse artifact creation inside the repository; an outside-repository data directory can serve as an alternative destination.

**@⁠Copilot** on GitHub · 2026-11-29 19:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3074#discussion_r4732934487) `ROOT` is the launcher's folder, not necessarily the title's, so running `target/release/victory.exe` writes the new minidump containing title stack memory inside the checkout. These paths bypass `victory_core::ensure_outside_repo`, required for derived-data writers by `docs/asset-policy.md:51–52`. Validate both destinations before writing and refuse artifact creation inside the repository; an outside-repository data directory can serve as an alternative destination.
@ -97,0 +168,4 @@
append_to_log(&format!("{text}{note}"));
// The copy is taken after the report went in, so it ends with it.
let copied = match run_log {
Some(log) => std::fs::copy(log, &log_copy).map(|_| ()),
Author
Owner

@⁠Copilot on GitHub · 2026-11-29 19:59 UTC · original

The default logger writes through the background victory-log queue (victory-core/src/logging.rs:93–116,143–151), but this appends the report directly and immediately copies the file without coordinating with that writer. Pending pre-crash events can therefore be missing from the saved log, or be appended after the report during the copy, contradicting the promised log ending with the report. Add a bounded, crash-safe logging snapshot/drain mechanism and append the report to the saved copy after taking that snapshot.

**@⁠Copilot** on GitHub · 2026-11-29 19:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3074#discussion_r4732934500) The default logger writes through the background `victory-log` queue (`victory-core/src/logging.rs:93–116,143–151`), but this appends the report directly and immediately copies the file without coordinating with that writer. Pending pre-crash events can therefore be missing from the saved log, or be appended after the report during the copy, contradicting the promised log ending with the report. Add a bounded, crash-safe logging snapshot/drain mechanism and append the report to the saved copy after taking that snapshot.
Four things the review of the crash files found:

- log_crash also reports memory the host refused (xmem's commit and
  allocator refusals), after which the title goes on; it took the run's
  one pair of crash files, so a fault that came later could not leave its
  own exception. log_crash is append-only again, and log_fatal, for the
  host GPU failure and a trapped unimplemented import, leaves the files.
- A custom VICTORY_LOG_FILE (session.log) kept its stem, so the "copy"
  was the log itself and every run's files had one name. A log not named
  play-... now gives crash-<name>-<unix time>-<process> (crash_stem).
- The folder of victory.exe may be inside this checkout (target\release),
  and the minidump holds the title's stacks. The folder is now chosen at
  start, the exe's or else the crash log's, whichever is outside the
  repository (victory_core::ensure_outside_repo); with neither, no files.
- The log goes through the victory-log writing thread, so lines it still
  held were missing from the copy, or came after the report. The crash
  path now waits for it, at most 500 ms and never on the writing thread
  itself (logging::drain, counting lines queued and written), copies the
  log, and appends the report to the copy, which ends with it.

Test: crash::tests::crash_files_never_take_the_logs_own_name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
shadow::card_bytes() counts the buffer copies window_card_for made in
the PC's shared memory when the card had no room for them, so the memory
line's "card copies of title buffers" could include system memory. The
line now says so beside the figure.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ -74,0 +126,4 @@
let text = format!("{text}
{}", title_output());
eprint!("{text}");
leave_crash_files(&text, std::ptr::null());
Author
Owner

@⁠Adriwin06 on GitHub · 2026-11-30 01:02 UTC · original

Good catch, fixed in 8d26a0df: log_crash is append-only again (the xmem commit and allocator refusals use it, and the title goes on after them). A new log_fatal, used for the host GPU failure and a trapped unimplemented import, leaves the crash files, so a later fatal exception still gets the pair.

**@⁠Adriwin06** on GitHub · 2026-11-30 01:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3074#discussion_r4734055730) Good catch, fixed in 8d26a0df: `log_crash` is append-only again (the xmem commit and allocator refusals use it, and the title goes on after them). A new `log_fatal`, used for the host GPU failure and a trapped unimplemented import, leaves the crash files, so a later fatal exception still gets the pair.
Author
Owner

@⁠Adriwin06 on GitHub · 2026-11-30 01:02 UTC · original

Fixed in 8d26a0df: a run log whose name has no play- (a custom VICTORY_LOG_FILE) now gives crash-<name>-<unix time>-<process>, so the copy is never the log itself and runs do not share names (crash_stem). Test: crash::tests::crash_files_never_take_the_logs_own_name.

**@⁠Adriwin06** on GitHub · 2026-11-30 01:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3074#discussion_r4734055840) Fixed in 8d26a0df: a run log whose name has no `play-` (a custom `VICTORY_LOG_FILE`) now gives `crash-<name>-<unix time>-<process>`, so the copy is never the log itself and runs do not share names (`crash_stem`). Test: `crash::tests::crash_files_never_take_the_logs_own_name`.
@ -14079,0 +14093,4 @@
(in blocks {} MB, {} MB of the blocks free), their levels given on demand {} MB; textures the host renders \
to or writes {} alive {} MB; card copies of title buffers {} MB (in the PC's shared memory too, where the card had \
no room for one) and their before twins {} MB; since the \
start {} textures the title fills let go as idle ({} MB)",
Author
Owner

@⁠Adriwin06 on GitHub · 2026-11-30 01:02 UTC · original

Fixed in ed139627 by labelling it: the line now says those buffer copies may lie in the PC's shared memory where the card had no room for one. Counting local and shared copies apart would need release-side bookkeeping in shadow, which this diagnostics line does not justify.

**@⁠Adriwin06** on GitHub · 2026-11-30 01:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3074#discussion_r4734055982) Fixed in ed139627 by labelling it: the line now says those buffer copies may lie in the PC's shared memory where the card had no room for one. Counting local and shared copies apart would need release-side bookkeeping in `shadow`, which this diagnostics line does not justify.
@ -97,0 +179,4 @@
.map_or(0, |d| d.as_secs()),
std::process::id(),
);
let (log_copy, dump) = (dir.join(format!("{stem}.log")), dir.join(format!("{stem}.dmp")));
Author
Owner

@⁠Adriwin06 on GitHub · 2026-11-30 01:02 UTC · original

Fixed in 8d26a0df: the folder is chosen at startup as victory.exe's folder, or else the crash log's, whichever passes victory_core::ensure_outside_repo. If neither does, no crash files are left (the report still goes to the logs), so a target\release run never writes a minidump into the checkout.

**@⁠Adriwin06** on GitHub · 2026-11-30 01:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3074#discussion_r4734056095) Fixed in 8d26a0df: the folder is chosen at startup as victory.exe's folder, or else the crash log's, whichever passes `victory_core::ensure_outside_repo`. If neither does, no crash files are left (the report still goes to the logs), so a `target\release` run never writes a minidump into the checkout.
Author
Owner

@⁠Adriwin06 on GitHub · 2026-11-30 01:02 UTC · original

Fixed in 8d26a0df: victory_core::logging now counts lines queued and lines written, and logging::drain(limit) waits for the writer to catch up. It is bounded (500 ms here) and returns at once on the victory-log thread itself. The crash path drains, copies the run log, then appends the report to the copy, so the copy ends with it whatever is logged afterwards. When the drain times out, the copy notes that its last lines may be missing.

**@⁠Adriwin06** on GitHub · 2026-11-30 01:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3074#discussion_r4734056212) Fixed in 8d26a0df: `victory_core::logging` now counts lines queued and lines written, and `logging::drain(limit)` waits for the writer to catch up. It is bounded (500 ms here) and returns at once on the `victory-log` thread itself. The crash path drains, copies the run log, then appends the report to the copy, so the copy ends with it whatever is logged afterwards. When the drain times out, the copy notes that its last lines may be missing.
Author
Owner

@⁠frametrace on GitHub · 2026-12-01 05:19 UTC · original

Supporting evidence for the logging::drain part: a host GPU failure can lose its own line from the play log.

The code path: host_gpu_failed calls log_crash, which writes crashes.log directly, and then TerminateProcess. Lines still queued for the writer thread, the failure's own line among them, never reach the play log.

What I saw: RTX 5090, Windows 11, driver 616.92. Builds from source of v2026.11.30.03 and earlier, new-game prologue. Most runs used hardware RT, which still hits the "did not close" copy failure (#2914; addressed by open PR #3043).

  • Without a wait, 5 of 14 failing runs lost the failure line from the play log. It was still in crashes.log.
    • Release builds: 1 of 5 lost it (a device-removed failure).
    • Builds with the debug layer on (VICTORY_D3D12_DEBUG=1): 4 of 9 lost it. Those runs log 50,000–140,000 debug-layer error messages, and three of the four that lost it logged about 130,000 or more. The queue is deepest exactly when the log matters most.
  • With a wait: a similar local change of mine, where log_crash waits for the writer, bounded at 500 ms, didn't lose the line in 2 of 2 failing runs. Those were release builds, where losses were rare anyway, so this shows little on its own.

I tested my own change, not this PR's code, and I've dropped it in favour of this one. One question for the design: is 500 ms enough when the debug layer floods the queue? Once this is rebased, I can run it on that failing setup with the debug layer on, to check that the bound holds.

**@⁠frametrace** on GitHub · 2026-12-01 05:19 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3074#issuecomment-7301648285) **Supporting evidence for the `logging::drain` part: a host GPU failure can lose its own line from the play log.** **The code path:** `host_gpu_failed` calls `log_crash`, which writes `crashes.log` directly, and then `TerminateProcess`. Lines still queued for the writer thread, the failure's own line among them, never reach the play log. **What I saw:** RTX 5090, Windows 11, driver 616.92. Builds from source of v2026.11.30.03 and earlier, new-game prologue. Most runs used hardware RT, which still hits the "did not close" copy failure (#2914; addressed by open PR #3043). - **Without a wait, 5 of 14 failing runs lost the failure line from the play log.** It was still in `crashes.log`. - **Release builds:** 1 of 5 lost it (a device-removed failure). - **Builds with the debug layer on** (`VICTORY_D3D12_DEBUG=1`): 4 of 9 lost it. Those runs log 50,000–140,000 debug-layer error messages, and three of the four that lost it logged about 130,000 or more. The queue is deepest exactly when the log matters most. - **With a wait:** a similar local change of mine, where `log_crash` waits for the writer, bounded at 500 ms, didn't lose the line in 2 of 2 failing runs. Those were release builds, where losses were rare anyway, so this shows little on its own. I tested my own change, not this PR's code, and I've dropped it in favour of this one. **One question for the design:** is 500 ms enough when the debug layer floods the queue? Once this is rebased, I can run it on that failing setup with the debug layer on, to check that the bound holds.
github-bot closed this pull request 2026-12-01 18:59:12 +00:00

Pull request closed

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