Diagnostics: loading lines under the frame rate, crash minidumps, the PSO budget watch and a memory-by-kind line #3074
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3074"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Adriwin06 on 2026-11-29T19:53:02Z.
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
cargo testpassed for the crates it touches: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)cargo test -p victory-loader: 79 passedcargo test -p victory-gpu --lib -- pipeline::: 70 passedcargo test -p victory-gpu --lib -- pool:: shadow::: 99 passedcargo 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).cargo clippyalso with--all-featuresadds no finding, andcargo test --workspace --lockedfails 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
🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Copilot on 2026-11-29T19:59:38Z.
Code review location:
crates/victory-loader/src/crash.rs; line 106log_crashalso handles recoverable refusals fromxmem::commit_refusedandreport_allocator_refusal, which return control to the title. Such a refusal now consumesLEFT_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.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Copilot on 2026-11-29T19:59:38Z.
Code review location:
crates/victory-loader/src/crash.rs; line 159With a custom
VICTORY_LOG_FILEsuch assession.logbeside victory.exe, this replacement leaves the stem unchanged, makinglog_copythe 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 whenplay-is absent.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Copilot on 2026-11-29T19:59:38Z.
Code review location:
crates/victory-gpu/src/host.rs; line 14095shadow::card_bytes()includes the shared-memory fallback fromwindow_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.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Copilot on 2026-11-29T19:59:39Z.
Code review location:
crates/victory-loader/src/crash.rs; line 161ROOTis the launcher's folder, not necessarily the title's, so runningtarget/release/victory.exewrites the new minidump containing title stack memory inside the checkout. These paths bypassvictory_core::ensure_outside_repo, required for derived-data writers bydocs/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.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Copilot on 2026-11-29T19:59:39Z.
Code review location:
crates/victory-loader/src/crash.rs; line 171The default logger writes through the background
victory-logqueue (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.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-29T19:59:39Z.
Review: COMMENTED
🟡 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.
5 open issues
What changed in this PR
Adds runtime diagnostics for title loading, crash investigation, pipeline creation, and GPU memory use.
Changes:
crates/victory-loader/src/windows.rscrates/victory-loader/src/lib.rscrates/victory-loader/src/crash.rscrates/victory-loader/Cargo.tomlcrates/victory-hle/src/modules/dstorage.rscrates/victory-gpu/src/texture/ahead.rscrates/victory-gpu/src/shadow.rscrates/victory-gpu/src/pool.rscrates/victory-gpu/src/pipeline/host.rscrates/victory-gpu/src/loading.rscrates/victory-gpu/src/lib.rscrates/victory-gpu/src/host/menu.rscrates/victory-gpu/src/host.rsapps/victory/src/run.rsReview effort: Balanced
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Adriwin06 on 2026-11-30T01:02:05Z.
Code review location:
crates/victory-loader/src/crash.rs; line 106Good catch, fixed in
8d26a0df:log_crashis append-only again (the xmem commit and allocator refusals use it, and the title goes on after them). A newlog_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.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Adriwin06 on 2026-11-30T01:02:07Z.
Code review location:
crates/victory-loader/src/crash.rs; line 159Fixed in
8d26a0df: a run log whose name has noplay-(a customVICTORY_LOG_FILE) now givescrash-<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.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Adriwin06 on 2026-11-30T01:02:09Z.
Code review location:
crates/victory-gpu/src/host.rs; line 14095Fixed in
ed139627by 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 inshadow, which this diagnostics line does not justify.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Adriwin06 on 2026-11-30T01:02:11Z.
Code review location:
crates/victory-loader/src/crash.rs; line 161Fixed in
8d26a0df: the folder is chosen at startup as victory.exe's folder, or else the crash log's, whichever passesvictory_core::ensure_outside_repo. If neither does, no crash files are left (the report still goes to the logs), so atarget\releaserun never writes a minidump into the checkout.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Adriwin06 on 2026-11-30T01:02:13Z.
Code review location:
crates/victory-loader/src/crash.rs; line 171Fixed in
8d26a0df:victory_core::loggingnow counts lines queued and lines written, andlogging::drain(limit)waits for the writer to catch up. It is bounded (500 ms here) and returns at once on thevictory-logthread 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.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by frametrace on 2026-12-01T05:19:19Z.
Supporting evidence for the
logging::drainpart: a host GPU failure can lose its own line from the play log.The code path:
host_gpu_failedcallslog_crash, which writescrashes.logdirectly, and thenTerminateProcess. 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).
crashes.log.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.log_crashwaits 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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.