GPU tests: a memory bench that drives the layer through the title's interface (no game) #473
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/473"
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 avatarmanz/VIctory-7900XTX. Originally posted by simbaui4life on 2026-11-27T16:17:10Z.
A memory bench for
victory-gpu. It drives the layer through the title-facing interface with synthetic frames, without the game, and reads what each memory class holds. One commit on014d52d. Test-only: the production changes are test hooks.Why: memory changes are hard to judge without the game, and
docs/findings.mdreports 40–46 GB private with no single leak (#234). This gives a game-less, repeatable footprint check, so a memory change can be measured before and after on any PC with a GPU.What it drives (
crates/victory-gpu/src/host/membench.rs)queue::create,fence::create,list::create_allocator/create_list, andresource::test_bufferbuffers. Title memory comes from a write-watchedVirtualAllocallocator installed withresource::use_allocator.place_copy, so scratch, host copies and card copies are used.list::with_state+shadow::find/refreshcreate and read 4 MiB windows.release_held,frame::test_advance).Tests (ignored; each in a process of its own, because the bench installs the title allocator process-wide)
memory_bench_steady_state: 60 warm-up frames and 240 measured. It prints a table per class (host lists, scratch, host copies, windows, snapshots, fetch buffers, staging, blocks, made buffers, private bytes) and asserts that nothing grows.memory_bench_pressure_lets_idle_go: a spike, then idle with 18 GB free (kept), then "1 GiB free" injected (let go). It lists what pressure does not reach.VICTORY_MEMBENCH_STRICT=1asserts that too.cargo test -p victory-gpu --lib memory_bench_steady_state -- --ignored --nocapture. AddVICTORY_RELAY=2 VICTORY_RELAY_COPY=1for the relay pathsscripts/play.ps1uses.Test hooks (all
cfg(test))list::idle()reports the pool's count and bytes.host::FREE_RAM_SAIDoverridesavailable_physical_ram().shadow::memory/windowsandtexture::memory/let_goare nowcfg(any(test, feature = "diagnostics")).Numbers (RTX 4070 Ti, driver 621.01, debug build)
VICTORY_RELAY=2)Does it catch faults? Each of these was put in on purpose, and the steady-state test failed every time:
What it shows (none of these grows across frames; they are plateaus that never come down)
simbaui4life:fix/scratch-at-landing.IDLE_MOST.1) never applies, because pooled lists hand back their scratch. Their allocator memory, about 2 MB per pooled list here, is unbounded up to 512 lists. On NVIDIA a separate probe measured 0.4–0.5 MiB per idle allocator.VICTORY_RESIDENCY), the list pool or the fetch buffers.Tested (RTX 4070 Ti)
cargo test -p victory-gpu: 394 passed, 0 failed (37 ignored, the two bench tests among them).-D warningsadds nothing. main already fails clippy inlist.rs,watch.rs,host/panel.rsandhost/place.rs, and in the diagnostics buildtexture.rsStaging::size(#362).Not tested: other GPUs; anything the bench cannot reach (see above).
No game data in the commits.
🤖 Generated with Claude Code
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.