feat(hle,gpu): report live title-own memory and bound CPU snapshot pool under pressure #303
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: launcher
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
run report
security: hold
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs gpu test
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Androtim--MiniVI!303
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-303"
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?
@Androtim on GitHub · 2026-12-02 02:41 UTC · original
Androtim:feat/xmem-title-used-and-snapshot-pressure→main· +395 −48 · 2 files · 1 commits · merged 2026-12-02 02:49 UTCSummary
Reports live title-own memory usage in
XMemGetWorkingSetStatisticsand keeps the CPU write-watch snapshot pool bounded under host memory pressure, reducing peak system RAM working set and private commit without hurting frame rate or visuals.Refs #276
Changes
crates/victory-hle/src/modules/xmem.rsPagefileUsagereporting inXMemGetWorkingSetStatisticswith default-on live title-own accounting (TITLE_PAGES + LIVE + TITLE_HEAP, capped at process commit), with aVICTORY_XMEM_TITLE_USED=0kill-switch to fall back to process commit.LiveRanges/LiveCommitandfree_trackedto track distinct committed host-page spans acrossXMemVirtualAlloc,VirtualFree, and 32-bitXMemFreeDefault, plus live physical page (TITLE_PAGES) and host heap (TITLE_HEAP) atomics.the title asks how much memory it useslog withprocess_mb,pages_mb,live_mb, andheap_mb.crates/victory-gpu/src/shadow.rssnapshot_pressure_budgetandexcess_snapshotsand wiredgive_backto enforceresidency::pressured()(4/16 MiB) andresidency::critical_commit()(0/0) caps instead of refillingPOOLup to 128–512 MiB between 1 s pressure sweeps.Verification
cargo +1.98.1-x86_64-pc-windows-gnu xtask policy:320 files ok--locked):victory-hlemodules::xmem::tests:33 passed, 0 failed(1 ignoredbenchmark)victory-gpushadow::hash_pool_tests(snapshot,excess_snapshots):3 passed, 0 failedclippy --workspace --all-targets --locked -- -D warnings(default +--features diagnostics): passed--releasebuild (--bin MiniVI --locked) +objdump -p: standard Windows DLLs onlyPaired Plain
--release90s A/B Benchmarks (RTX 4060 Ti 8 GB / 32 GB RAM, vsorigin/main0a9eca4)1440p (
-PlayParity -Res 1440, 90s in-world):origin/main(0a9eca4)10.55 / 10.80 fps10.60 / 11.25 fps+0.45 fpssteadydedicated_mb(2nd-half med / max)5,980 / 6,195 MB5,943 / 6,037 MB-158 MBmaxshared_mb(2nd-half med / final)5,742 / 6,023 MB5,663 / 5,827 MB-196 MBfinalworking_set_mb(2nd-half med / max)20,454 / 20,688 MB19,634 / 20,053 MB-820 MBmed (-635 MBmax)private_commit_mb(2nd-half med / max)21,861 / 22,237 MB21,402 / 21,855 MB-459 MBmed (-382 MBmax)free_ram_mb(2nd-half med)1,114 MB2,158 MB+1,044 MBhost memory pressure15293477+12 s004K (
-PlayParity -Res 4k, 90s in-world):origin/main(0a9eca4)5.90 fps6.00 fps+0.10 fps31.75 / 19.75 ms30.10 / 16.60 ms-1.65 / -3.15 msshared_mb(2nd-half med / max)6,075 / 6,174 MB5,989 / 6,029 MB-145 MBmaxprivate_commit_mb(2nd-half med / max)22,397 / 22,686 MB22,359 / 22,443 MB-243 MBmaxfree_ram_mb(2nd-half med)903 MB1,130 MB+227 MBmapped()stall rate (longest)18.9 ms/s(37.5 ms)1.87 ms/s(12.8 ms)-90%stall rate00Diagnostics Visual Check (
--features diagnostics, 1440p, 90s):pngs=24, lit=12/24, luma=93.36, near_black=0.06%, edge_energy=7.8, magenta=0.0%, crashes=0, bakes=8, failed=0, showed_another_view=0.frame-2561.png,frame-2577.png,frame-2593.png): clean geometry, sky, textures, lighting, and HUD.@Androtim on GitHub · 2026-12-02 02:49 UTC · original
Audited full diff (
610ed1e8,+395 -48acrosscrates/victory-hle/src/modules/xmem.rsandcrates/victory-gpu/src/shadow.rs), both 90s plain---releaseA/B pairs (1440p and 4K), 5 smemory telemetrylogs, and--features diagnosticsvisual PNGs:LiveRanges/LiveCommittracking +TITLE_PAGES/TITLE_HEAPatomics inxmem.rs(VICTORY_XMEM_TITLE_USED=0safety kill-switch only), and pressure-awaresnapshot_pressure_budget/excess_snapshotsinshadow.rs::give_backpreventing snapshot pool refills between pressure sweeps. Zero new opt-in switches; 36 targeted unit tests + dual clippy +asset policy: 320 files ok.--release90s A/B vsmain(0a9eca4):10.55 -> 10.60 fps(steady10.80 -> 11.25 fps),-158 MBpeak VRAM (over=0 MB,room_false=0.0%),final_waiting4,762 -> 2,735(-42.6%),working_set_mb -820 MBmed,private_commit_mb -459 MBmed,free_ram_mb +1,044 MBmed,shared_mb -196 MBfinal,0crashes,untranslated 4 -> 4.--release90s A/B vsmain(0a9eca4):5.90 -> 6.00 fps,preparing 33.7 -> 31.5 ms,copyback 19.2 -> 16.5 ms,final_waiting 12,556 -> 12,152,mapped() 18.9 -> 1.87 ms/s(-90%),private_commit_mb -243 MBmax,shared_mb -145 MBmax,over=0 MB,0crashes,untranslated 6 -> 6.--features diagnosticsPNG inspection: Inspectedframe-2585.pngandframe-2593.pngdirectly — crisp outdoor lighting, clean geometry/textures,luma=93.36,near_black=0.06%,edge_energy=7.8,magenta=0.0%,showed_another_view=0.#300/#302, CI green (46796991108). Merging now.