perf(gpu,loader): adaptive RAM/VRAM memory pools and faster submit preparation #480
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!480
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-480"
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?
@bla1r1 on GitHub · 2026-11-27 05:53 UTC · original
bla1r1:perf/adaptive-memory-and-submit→a-publier· +580 −103 · 10 files · 1 commits · closed without mergingSummary
Improves memory scaling on 8 GB VRAM / 24–32 GB RAM systems (while scaling upward on larger cards) and cuts CPU/copy-queue stalls on the submission path.
Changes
host.rs,list.rs,pool.rs,residency.rs,resource.rs,texture.rs,shadow.rs)default_room_percent_for:78%for<= 9 GiB,85%for<= 12 GiB,90%for> 12 GiB).ram_bandphysical working-set hysteresis thresholds (Watch >= 70%,High >= 80%, recovery<= 60% / 75%) so 24–32 GB hosts do not stay stuck inHighpressure around ~14 GiB.RamBand-aware trimming and budgets forUPLOAD_POOL(128 / 64 / 32 / 0 MiB),SPAREscratch chunks (trim_spare_chunks_to), idleHostListpools (idle_limits/trim_idle),let_go_idle(), and snapshot buffers (snapshot_budget_bytes:768 / 512 / 256 / 64 MiB+trim_snapshots).host.rs,shadow.rs,land.rs)resident()/ synchronousmapped()waits for CPUL0shared_buffer()allocations (D3D12_HEAP_FLAG_NONE) and remove synchronousmapped()stalls on future-list-onlyuav_buffer()s.wide_threads()((n * 3) / 4, clamped2..=6) andland::threads()(n / 2, clamped2..=6).DXGI_STATUS_OCCLUDEDcleanly in frame metering (VICTORY_METER_OCCLUDED).resolution.rs,Cargo.toml)own/fsr) alongside numeric IDs inparse_upscaler(VICTORY_UPSCALER).devanddiagCargo profiles (incremental = true, highercodegen-units, reduced dependency debuginfo) for faster local rebuilds.Verification
cargo test --workspace --locked: all workspace crates andxtaskpolicy/switch tests pass (0 failures).cargo build --locked --profile diag -p victory --features diagnosticsandcargo build --locked --release -p victory: clean builds.i7-9700K,27.9 GB RAM,RX 6600 8 GB, Adrenalin 26.11.2,--console series-s, 5 renderer ports, 135 s release run):mapped()waits reduced from38,400 calls / 39,236 msto600 calls / 245.7 mswith0device resets (DXGI_ERROR_DEVICE_RESET).19,072.8 MB WS/18,692.6 MB Private.29.3–30.1 FPS; heavy opening 3D cutscene runs at0.5–4.7 FPSon this 8C CPU.@MamaLeVrai on GitHub · 2026-11-27 07:01 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
4b4e4c1:victory-gpu401 passed, 0 failed, 34 ignored;victory-loader57 passed.AI-assisted (Claude Code); no game data.
@gw1337x on GitHub · 2026-11-27 08:50 UTC · original
Tested in the title on RDNA 3: RX 7800 XT 16 GB, driver 32.0.32015.7029, Ryzen 7 9800X3D, 32 GB RAM, Windows 11 26200 (Memory Integrity off). Diagnostics builds (
--profile diag --features diagnostics) of4b4e4c1and its base4eb6cfd, same boot.Settings:
scripts/play.ps1settings plusVICTORY_PORT_CONSTANTS/DESCRIPTORS/CBV/GUARD/JOURNAL=1, Series X profile, ray tracing off. Method: 270 s hands-off from a Chapter I boat save; fps is the layer's 1 s figure from the window title, sampled every second, 45-265 s with 1000+ draws ("steady" from 205 s); per-frame figures fromVICTORY_TIMELINEwindows of 30 frames at 200 s and 240 s.4eb6cfd4b4e4c14eb6cfd4b4e4c14b4e4c1code, baseCargo.toml(Runs 1 and 4 were another PR.) Run 7 puts back the base's
Cargo.toml(codegen-units 16, not incremental) to rule out the profile change; the drop stays, so it comes from the code.What showed:
I did not split which of the PR's changes makes the lists be made again; the count and the span point at host-list reuse, but that is not isolated.
@MamaLeVrai on GitHub · 2026-11-27 10:14 UTC · original
Review of
4b4e4c1, with two semantic regressions shown by failing tests (on an RX 6950 XT; the tests are appended to the PR's own files, not committed):shadow.rslet_go_idle, ~3036-3049). Ona-publier, withoutVICTORY_WINDOW_BUDGET_MB(the default),keepstayedu64::MAX, so every eligible idle window went. Now the Watch band keepstotal/8and High keepstotal/16.window_victimsfrees only what is above that, andmin(idle_ms, 10_000)changes nothing when the base is already 10 s or less. Test: a 32 GiB machine with 3 GiB of idle windows.review_watch_frees_at_least_calmfails withcalm frees 12 windows, watch frees 0.resource.rsover_cap_max,default_room_percent_for). A 12 GB card's budget (~10,200 MB) is at most 10 GiB, so it counts as "tight", though the comment targets 6 to 8 GB cards. The mip cap drops to 512 at 82 % use whileroom_percentis 85 %; before, the cap (92 %) sat above the room limit (90 %).review_cap_not_below_room_on_12gb_cardfails withroom 85%: cap already 512 at 84%(left: 512, right: 1024).Also, from reading:
shared_bufferdropsnot_resident(),resident()andmapped(), anduav_bufferdropsmapped(). The comment onmapped()(host.rs ~257-262) saysMakeResidentalone was not enough (runs n08/n11). That is safe only if these buffers' addresses never reach descriptor slots that lists already sent read. I could not confirm that forshared_buffercopies of title memory.residency.rs:20, the same flip as #481's).limited_host_ram()is then true on any machine with 32 GiB or less, which lowers the bury lag from 64 to 16 submissions (that lag was itself a device-loss fix, host.rs ~615-620).host.rs:6158:mem::take(&mut l.deferred().writes)replaces a clone. If a submission runs list A, then B, then A again, the second A contributes no writes, so the late path and the non-late path now disagree.Checked with no issue: the upload pool's reuse and lifetimes, the trim functions' counters, the locks, the
copyingOptionchange.AI-assisted (Claude Code); no game data.
Pull request closed