perf(victory-gpu): reclaim idle host System RAM via MEM_DECOMMIT and cold pool/DXIL trimming #350
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!350
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-350"
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?
@Vladimir-Human on GitHub · 2026-11-26 11:03 UTC · original
Vladimir-Human:perf/ram-footprint-decommit→main· +3236 −173 · 12 files · 1 commits · openSummary
Ports host system RAM trimming and Windows
MEM_DECOMMITsnapshot reclamation fromfxceless/victory-fork#1286ontoLooperSalty/AnyXboxX, reducing host RAM pressure on 16–32 GB systems while preserving all existingAnyXboxX/ Neptune concurrency and pooling features.Key Changes
third_party/victory/crates/victory-gpu/src/ram_trim.rs,copystat.rs,lib.rs)TrimPolicy(Tight16/Standard32/Large, opt-in aggressive modeVICTORY_RAM_TRIM=1, automatic low/panic memory scaling, cached 250 ms viaTrimPolicy::cached()).verify_safe_for_decommit(queries committedinfo.BaseAddresswith non-resettingGetWriteWatch, rejectingMEM_WRITE_WATCHandMEM_MAPPED/MEM_IMAGEregions so write-watched or mapped title views are never touched).VmBlock/SnapshotBuffer(MEM_RESERVEvirtual-address preservation with 64 KiBMEM_DECOMMIT/MEM_COMMITand coalesced zero-piece scanning) plusram_trim::diagnostics_line()logged incopystat.shadow.rs,watch.rs)Shadow::beforeandshadow::POOLtoSnapshotBufferwith checkedensure_commitacross all 7 access paths (Shadow::writingx3,find_all,copy_back_with,relay_merge,merge_under_writes).warm_limitandpanic_memory(including slot 0) ingive_back_withwhile keepingMEM_RESERVEslots warm for VA reuse without page-fault churn.watch::title_memory_remapped->shadow::title_memory_remapped, retiring single-owner containedLOOSE/EXACTshadows (preservingEXACT.0monotonic tick, scanning wideLOOSE.range(..(end, 0)), bumpingSHAPE(SeqCst) and re-checkingcan_retire) andMEM_DECOMMITting overlapping dead snapshot pages.beforesnapshots on card promotion (card_make_before/copy_back_done), shrinks oversized thread-localTITLEscratch vecs inShadow::copy(), and supports opt-in cold/zero reference trimming under strictpending -> before -> keptlock order (give_backalways outsideShadowlocks).list.rs,host.rs,texture.rs)list::let_go_idle_with+HostList::take_idle_caches(trimmingahead_chunksandindirect_args >= 1 MiBand dropping D3D12 COM buffers strictly outside locks, respectingVICTORY_LIST_POOL_IDLE_Sand updating bothTRIMMED_LISTSandram_trim).host::SPARE::trim,trim_card_work_with(CardWork::fetched_ms),HostList::resetvec capacity shrinking, andtexture::trim_stage_pool_with+let_go_idle_with(timestampedSTAGE_POOL, COM drops strictly outsideSTAGINGandSTAGE_POOLlocks).pipeline.rs,pipeline/host.rs,pipeline/make.rs)ContainerBlob(Raw(Arc<[u8]>)/Compressed { packed, orig_len }via existingzlib-rs), releasingself.containerlock before translation, cache lookup, or disk I/O (with_container).DxilPin(building_dxilrefcount) andtrim_shaders_withacross both graphics and compute shaders, preservingVICTORY_DROP_DXIL=1,DXIL_DROPS/KEPT[3]accounting, and transparent DXIL reload viashader_cache::host_shader.AnyXboxX/ Neptune featuresRwLockonBUFFERS/LOOSE+SHAPE/FOUNDlookup cache (read-only scans intrim_cold_references_atandBUFFERSoverlap checks use.read()),windowup.rstransient windows,VICTORY_WINDOW_REBAR,fold_buffers,VICTORY_LIST_POOL_MOST/_MB/_IDLE_S,VICTORY_STAGE_POOL_MB,VICTORY_DROP_DXIL=1,host::ram_idle_ms, andramline.rscounters.Verification (
CARGO_TARGET_DIR='D:\cargo-targets\anyx-base')cargo run -p xtask -- policy:asset policy: 199 files ok.cargo clippy -p victory-gpu --all-targets -- -A deprecated(default &--features diagnostics): 0 warnings in added/modified lines.ram_trim::tests::stress_decommit_recommit_reuse_no_corruption_and_os_commit_drops):[ram_trim stress round 0..2] private commit before=341.6 MiB, after=85.1 MiB, delta=-256.5 MiB--features diagnostics:[ram_trim stress round 0..2] private commit before=349.2 MiB, after=92.7 MiB, delta=-256.5 MiB--test-threads=1):ram_trim13/13,shadow39/39,pipeline18/18,list4/4,texture16/16 (1 ignored),spare2/2.--features diagnostics:ram_trim13/13,shadow39/39,pipeline21/21,list6/6,texture17/17 (1 ignored).cargo test -p victory-gpu -- --test-threads=1: 198 passed; 3 failed; 3 ignored (the 3 failures are pre-existing on untouchedorigin/main:descriptor::host::tests::spans_say_the_next_start_and_the_lowest_level_viewedandindirect::tests::warp_card_{fetch,patch}_*).git diff --check&git merge-tree --write-tree origin/main HEAD: clean.Credits
Ported from
fxceless/victory-fork#1286.@Skyfrye on GitHub · 2026-11-26 14:43 UTC · original
For information: I tried this PR in an integration build on
mainat2cc6593(after #358 and #377), stacked with #354, #345 and my #278, #279, #292, #307, #360-#362, #381 and #382. It no longer applies tomain. The conflicts are in what the code does, not just neighbouring lines: host.rs (4), pipeline.rs (1: thebuilder_spilledcache against #377's ACCC part), texture.rs (7: the staging pool, which #289 reworked in #358), watch.rs (1). I left it out of that build rather than guess at the merge. A rebase on currentmainwould let it in the next one.🤖 Generated with Claude Code
0470f875a4to69a0a8cc33@Vladimir-Human on GitHub · 2026-11-26 15:16 UTC · original
@Skyfrye Rebased onto
mainat26c11d4(post-#358/#289, #377, and #383) at commit69a0a8c.Conflict harmonization summary:
texture.rs: Preserved #289/#358'sStageEntry/VecDequecross-class LRU eviction,[0..bytes)zeroing,zero_upload_tests, andStagePool::trimfull 0-byte idle drain (ram_idle_ms+ 4 frames); layeredram_trim::TrimPolicytightening additively on top whenpanic_memory || pool_idle_ms < upstream_idle_ms, and keptStagingdrops outsideSTAGINGlock.pipeline.rs: Preserved #377'sACCCfallback (victory_shader::emit::nvidia::enabled()) in bothtranslate()and insideof_builder()'s cachedbuilder_spilled.host.rs&host/scratch_tests.rs: Preserved #358's FIFO-evictingSpare::giveandResultRing(trim_card_work_withcheckswork.taken.used() == 0) alongsideSpare::trim/CardWork::fetched_ms, and preserved #383 (step_index,sync_batched,parallel_refresh).shadow.rs&watch.rs: Preserved #377 (after_writer) and #358 (Card::prints/me,note_carded,FLAGGED,window_same,page_writes_mode) cleanly alongsideSnapshotBufferandtitle_memory_remapped.Verified on
69a0a8c:cargo xtask policy(215 files ok),cargo clippy -p victory-gpu --lib --tests(0 new warnings),VICTORY_D3D12_DEBUG=1ram_trim14/14 andtexture::8/8 (victory-gpu --lib: 252 passed default / 265 passed--features diagnostics, with only the 3 pre-existingmainfailures indescriptor::hostandindirect::warp_card_{fetch,patch}). Ready for your next integration build.github-bot referenced this pull request2026-11-26 18:56:44 +00:00
@Vladimir-Human on GitHub · 2026-11-26 19:19 UTC · original
Noting that #409 (
37d4686) replacedthird_party/victorywith the combinedavatarmanz + cool_foxbase, putting this branch inCONFLICTING.The clean
avatarmanz-lineage version is open atavatarmanz/VIctory-7900XTX#205(andfxceless/victory-fork#1286); happy to re-port onto37d4686+once#409settles if you want it here.github-bot referenced this pull request2026-11-26 20:51:00 +00:00
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.