diagnostics: print in-memory bytes per group in the memory map (#756) #1503
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1503
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1503"
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?
@shiman1901 on GitHub · 2026-11-28 20:57 UTC · original
shiman1901:copystat-group-in-memory→main· +152 −26 · 1 files · 1 commits · merged 2026-11-29 08:16 UTCSummary
Prints resident (
in memory) bytes alongside committed bytes for each group on thememory map, other private allocations by sizeline (VICTORY_MEMORY_MAP=1), matching the existing per-kind summary line right above it:AllocationBasefor kinds 5 and 6 inside the existingin_memory()K32QueryWorkingSetExbatches (zero additional syscalls).format_biggest_groups()helper (sorting by descending committed bytes, breaking ties by kind and whole size) and formats each entry as{n} of {size:.2} MB{wc}: {committed} MB ({present} MB in memory).copystat::memory_map_tests) covering0 MB in memoryVRAM blocks, mixed VRAM + RAM staging groups, partially committed 32 MiB arenas, ordering, and limit clamping.Why this helps (from #756)
In
#756, aVICTORY_MEMORY_MAP=1dump showedwrite-combined (buffers shared with the card) 8630 MB (1545 MB in memory)with65 of 64.00 MB write-combined: 4158 MB, which initially looked like a multi-GB host upload leak.Probing D3D12 with
VirtualQuery+K32QueryWorkingSetExon an RTX 3060 (driver621.35, 21 test cases) showed that NVIDIA exposesCreateHeap(D3D12_HEAP_TYPE_DEFAULT, 64 MiB)(exactpool.rs:826-835flags) as64.00 MB PAGE_WRITECOMBINEwithcommitted = 64.00 MBandresident = 0.00 MB— accounting for58 × 64 MB(pool::TEXTURES) +5 × 64 MB(pool::STAGING) in that group.Showing
({present} MB in memory)on each group immediately separates0 MB in memoryVRAM heaps from live hostUPLOAD/ staging buffers in future memory-map logs:Scope & compatibility
#[cfg(all(windows, feature = "diagnostics"))]); zero gameplay, rendering, or allocator behavior change.scripts/,tests/, anddocs/— nothing parses thebiggest groupslog line.crates/victory-gpu/src/copystat.rs(lines 556–791 + tests at EOF); does not conflict with#548(HEAPallocator) or overlap#803/#916/#1182.Verification
Verified on GitHub
windows-latestCI via fork workflow (noting pre-existing Rust 1.98 clippy lints in untouchedshadow.rs:1708andvictory-shader/src/emit/mod.rs:2768):cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings -A clippy::manual_is_multiple_of -A clippy::let_and_return— 0 warnings incopystat.rs(including new tests).cargo test -p victory-gpu --lib --all-features --locked memory_map_tests— 3/3 passed (vram_blocks_show_nothing_in_memory,a_group_says_what_of_it_is_in_memory,biggest_are_first_and_equal_sizes_keep_the_same_order).VirtualQuery/QueryWorkingSetExprobes on RTX 3060 (driver621.35). Written with AI assistance; code and tests reviewed line by line.diagnostics: print in-memory bytes per group in the memory mapto [pr-diagnostics][memory][NVIDIA] diagnostics: print in-memory bytes per group in the memory map (#756)[pr-diagnostics][memory][NVIDIA] diagnostics: print in-memory bytes per group in the memory map (#756)to diagnostics: print in-memory bytes per group in the memory map (#756)