Memory switches for 32 GB PCs (all off by default): textures-only residency waits, texture cache line, staging in BAR, physical-only pressure, windows' BAR line #394
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!394
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-394"
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?
@JFIREonFIRE on GitHub · 2026-11-26 23:40 UTC · original
JFIREonFIRE:jf/memory-switches→a-publier· +165 −18 · 4 files · 1 commits · openWhat and why
Five switches for PCs with 32 GB of RAM and a system-managed page file, where the commit limit runs out before the RAM does (#333, #297, #298). Each is off by default; unset, behaviour is unchanged.
VICTORY_WAIT_RESIDENT=texturesCREATE_NOT_RESIDENTand waited for (MakeResident+mapped()); plain buffers are made resident and not waited for. As described in #346.VICTORY_TEXTURE_KEEP_PERCENT=<p>vram_keep's three lines down together (unset: 85 / 93, trimming to 80 / 84, as before; 40 to 85). Every MB the card keeps is also a MB of commit (#333).VICTORY_STAGING_BAR=1pool.rs) inD3D12_HEAP_TYPE_GPU_UPLOADmemory viamapped_card_bufferwhile the card is under 85 % of its budget; else the PC's memory, as before.VICTORY_PRESSURE_PHYSICAL=1VICTORY_RESIDENCY=1: pressure by free physical memory alone (on at 1.5 GiB, off at 2.5 GiB), emergency commit floor 256 MiB instead of 1.5 GiB. With a system-managed page file the commit lines turned pressure on once per run and never off.VICTORY_WINDOWS_BAR_PERCENT=<p>What is in it
crates/victory-gpu/src/host.rs:wait_resident_buffers,not_resident_buffer/resident_buffer/mapped_bufferat the four buffer allocation sites;keep_percent/keep_lineinvram_keep.crates/victory-gpu/src/pool.rs:staging_barfor the staging blocks.crates/victory-gpu/src/residency.rs:physical_only,next_pressure_physical, the floor incritical_commit.crates/victory-gpu/src/shadow.rs:windows_bar_percent/bar_lineinwindow_mapped_for.the_keep_line_is_85_unless_set_lower,the_default_keep_lines_are_as_before,buffers_wait_unless_only_textures_do,physical_pressure_turns_on_at_one_and_a_half_and_off_at_two_and_a_half_gib,windows_go_to_the_card_below_eighty_percent_unless_set.Tested
cargo clippy --workspace --all-targets --all-features --locked -- -D warningsand without--all-features: clean.cargo test --locked -p victory-gpu --lib -- --test-threads=1: 401 passed, 0 failed, 34 ignored.a-publierruns at 2–3 fps on this card, #333), Series S profile, with port 1 on. 4-minute runs, working set from the log's memory line:WAIT_RESIDENT=texturesTEXTURE_KEEP_PERCENT=75STAGING_BARalone: texture staging in the PC's memory 2.8 GB peak → 0.5 GB; working set 18.1 → 16.7 GB avg.PRESSURE_PHYSICAL: pressure never stuck on. Over 11 minutes, all of them together plusVICTORY_SEND_BAR=1: working set 16.3 GB avg / 20.5 peak against 20.2 / 24.5 for the same tree as shipped, median 86 ms against 87, but a higher mean (151 vs 138 ms) from a few longer stalls in the heaviest scene; which switch costs that is not yet known, so treat them as separate.Not tested
STAGING_BARended in a device removal (nvlddmkm event 153, no breadcrumbs); an 8-minute repeat withVICTORY_D3D12_DRED=lightand every later run were clean.AI-assisted: written and measured with Claude Code (Claude Opus 5.5). No game files.
@JFIREonFIRE on GitHub · 2026-11-26 23:52 UTC · original
11-minute A/B on the same RTX 3090 / 32 GB (cool_fox-based tree, port 1, Series S), to find which switch caused the longer stalls mentioned above:
SEND_BARWAIT_RESIDENT=textures,STAGING_BAR,PRESSURE_PHYSICAL,WINDOWS_BAR_PERCENT=92,TEXTURE_KEEP_PERCENT=75,VICTORY_SEND_BAR=1WAIT_RESIDENT=textures,STAGING_BAR,PRESSURE_PHYSICAL,WINDOWS_BAR_PERCENT=92So the stalls come from
TEXTURE_KEEP_PERCENT=75(re-uploads over a longer run) and/orVICTORY_SEND_BAR=1(not part of this PR); the other four are a gain on their own here.TEXTURE_KEEP_PERCENTstays useful as a commit lever on PCs where commit is the limit, but not as a default.AI-assisted (Claude Code).
@MamaLeVrai on GitHub · 2026-11-27 01:23 UTC · original
Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At
ec71380:cargo test --release -p victory-gpu --lib401 passed, 0 failed, 34 ignored.AI-assisted (Claude Code); no game data.
@Gabriel-Ramaldes on GitHub · 2026-11-27 12:28 UTC · original
In-game test on AMD RDNA 4 with 32 GB, on this branch itself (
ec71380=a-publier4eb6cfd+ this PR), filling the two "Not tested" items.Setup:
cargo build --locked --profile diag -p victory --features diagnostics.cargo test --locked -p victory-gpu --lib -- --test-threads=1: 401 passed, 0 failed, 34 ignored.scripts\play.ps1's settings (no-Safe, Series X) plus one switch.ms/frameover world lines (≥ 2,000 draws), first quarter dropped.memory:line.WAIT_RESIDENT=texturesTEXTURE_KEEP_PERCENT=75STAGING_BAR=1WINDOWS_BAR_PERCENT=92What it shows on this PC:
STAGING_BARincluded (no DRED report, nothing in crashes.log).TEXTURE_KEEP_PERCENT=75cuts the most: −1.0 to −2.0 GB, with host textures 8.0 → 6.9 GB in the lastmemory:line.WAIT_RESIDENT,STAGING_BARand all of them together are within this scene's run-to-run noise (~10 %).TEXTURE_KEEP_PERCENT=75is the only one slower in both runs (median 131 / 121 against 116 / 117). It is consistent with textures trimmed and uploaded again, but two runs are not proof.STAGING_BARhas little to move here: texture staging in the PC's memory stays at ~52 MB alive ona-publierin this scene, against 2.8 GB peak on your cool_fox tree. Its gain likely depends on the tree.PRESSURE_PHYSICAL, sinceplay.ps1does not setVICTORY_RESIDENCY=1.AI-assisted (Claude Code); no game files.
@adrianmjim on GitHub · 2026-11-27 14:14 UTC · original
In-game numbers for one of the five switches,
VICTORY_TEXTURE_KEEP_PERCENT, on an RX 7900 XT (RDNA 3, 20 GB), driver 32.0.32029.2010, Ryzen 7 5800X, 32 GB RAM, system-managed page file, Windows 11 26300. The RX 9070 XT comment above has 75 on another scene; this adds 60 and the course over time. I ran only this switch because it is the only one aimed at what grows here: on4eb6cfd, texture blocks are a third of private memory at 235 s (10.1-10.3 of 31.0-31.7 GB) and 66-72 % of its growth from 11 s to 235 s (8 base passes).What I ran:
ec71380, againsta-publier4eb6cfd, bothdiagwith diagnostics. Unattended passes of the opening sequence: 240 s from the first frame of 500 draws or more, Series S,scripts\play.ps1settings, frame capture on, DRED light.memory:,memory in blocksandmemory of textureslines (every 5 s), at the line nearest 235 s. First let-go: the first such line that shows one. Frames from the capture's frame numbers. Stall: time from a present to the title's first list call (5 s frame account line), its excess over 20 ms per frame, summed over the window's frames.What it shows:
Frames and stalls: I cannot tell. Both 60 passes started badly, with about 18 s of stall each in the first 60 s. So did one of the 8 base passes (18 s; the other seven 0-12 s) and two passes of other PRs' builds in the block (17-19 s). One of those let nothing go in the whole pass and ended at 2,037 frames and 33.7 s of stall. 20.5 of the first 60 pass's 33.1 s fall at 60-114 s, before its first let-go. While use is under the line the switch changes nothing (
vram_keep). At 150-185 s, where 60 lets go 2 GB in two steps, stall is 5.2 / 6.8 s against 0.4-6.5 on base. That is the stretch to watch. The 75 pass is base-like (one pass).Not tested: the other four. Two do nothing with
play.ps1's settings:VICTORY_PRESSURE_PHYSICALacts throughrefreshandcritical_commit, which return at once withoutVICTORY_RESIDENCY=1, andVICTORY_WINDOWS_BAR_PERCENTis read only whenVICTORY_WINDOWS_BAR_MBis set. I did not runWAIT_RESIDENT=texturesorSTAGING_BAR.Limits: one card, one driver, one 4-minute route that is not time-locked; n = 2 and 1.
diagbuild, a PNG saved every 8th frame, the PC at its commit limit in every pass (28-32 GB private on 32 GB). I did not runec71380with the switch unset and assume it equals base. Nothing here covers longer play, where copies made again would count for more.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.