perf(gpu,hle): port ecosystem dstorage cache, prelude sharing, host buffer keep, one-call parts, and dynamic descriptor chunking #403
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/403"
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 Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T17:37:59Z.
Summary
Ports five high-impact CPU/GPU FPS and memory optimizations from upstream GPL-3.0 forks into MiniVI with strict concurrency invariants, 8 GB VRAM / 16 GB RAM commit-floor guards, clean-room title neutrality, and unit tests for every invariant:
Decoded DirectStorage Chunk LRU Cache (
VICTORY_DSTORAGE_CACHE,VICTORY_DSTORAGE_CACHE_MB)DecodedCacheincrates/victory-hle/src/modules/dstorage.rsadmitting decodedZLIB/BCPACKfile chunks starting on their second identical decode request (avoiding RAM churn on one-shot streaming reads).victory_gpu::tiny_host_ram()(<= 18 GiBhost RAM) and 1536 MiB otherwise (VICTORY_DSTORAGE_CACHE=0orVICTORY_DSTORAGE_CACHE_MB=0disables).file_id), bounded per-shard first-sight history (4096keys/shard), andArc<[u8]>zero-copy hits outside shard locks.CommitSamplerprobesvictory_gpu::commit_left()(GlobalMemoryStatusEx::ullAvailPageFile) on first admission and at least every32 msor4 MiBadmitted (added_sincededuction between polls), strictly enforcing a 3 GiB free commit floor, proactive 25% trim below 2.5 GiB, and full cache drain below 1.5 GiB.bytesupdates (fetch_add/fetch_sub) run strictly under the owning shard lock so concurrenttrim()passes cannot race or underflow byte totals.Shared Prelude Pooling on Reset (
VICTORY_PRELUDE_SHARED)crates/victory-gpu/src/host/prelude.rs,host.rs,copystat.rs: routesrecord_preludepops throughtake_prelude_from_pool()withPRELUDES_TAKEN/preludes_spare()/PRELUDES_GONEinstrumentation andVICTORY_PRELUDE_SHARED=0kill switch alongsideVICTORY_PRELUDE_POOL.Keep Host Buffers Under Budget (
VICTORY_KEEP_HOST_BUFFERS)crates/victory-gpu/src/host/keep.rs,crates/victory-gpu/src/list.rs: off by default (switch::on); when enabled, suppresses periodic 30 s command allocator remakes (allocator_refresh) and idle list age trimming (list::trim_stale_idle/list::recycle) while host RAM (residency::pressured()) and DXGI local + shared video memory budgets remain unconstrained (cached every 100 ms incard_over_budget_lately()). Pressure trimming (trim_on_pressure) remains active.Merge Joined Flight Parts Into One
ExecuteCommandListsCall (VICTORY_PARTS_ONE_CALL)crates/victory-gpu/src/host/parts.rs,host/place.rs,host.rs: off by default (switch::on+ D3D12 Enhanced Barriers support check viaplace::enhanced_barriers); inserts pooled global enhanced-barrier command lists (place::wait_for_all) before interior part cuts across bothHost::send_publishedandHost::submit(late && !publish), rolling back unused barrier lists on partial failure and holdingPooledPreludesalive inSent/Flightuntil GPU fence landing.keepandpartshelpers/tests (alongside prelude pooling) are cleanly placed incrates/victory-gpu/src/host/{keep,parts,prelude}.rssocrates/victory-gpu/src/host.rsstays under the 640 KiBxtask policyfile-size limit (650,272bytes).Per-Thread Dynamic Descriptor Chunking (
VICTORY_DYNAMIC_CHUNK) & Read-Lock-Firstshadow::loosecrates/victory-gpu/src/descriptor/host.rs,apps/victory/src/play.rs,scripts/play-minivi.ps1: addsCHUNKS = 32per-thread(u32, u32)bump buckets onHostHeap(0default at library level,"256"in launcher settings) with exactfree/too_longbookkeeping on chunk tail return and acyclicchunks -> nextdrain_chunk_tails()before any refusal.crates/victory-gpu/src/shadow.rs: checksLOOSE.read()first across all lookup modes (named,tails,fine) vialoose_in, serializes misses withMAKINGoutsideLOOSE.write()(made_window), and locksMAKINGbeforeLOOSE.write()inin_place_let_go.Upstream GPL-3.0 Attribution
ReZOnGithub/VIctory-lapcommit133b952(GPL-3.0):VICTORY_DSTORAGE_CACHE+VICTORY_PRELUDE_SHARED(diagnosticVICTORY_PROBE_RAMomitted; title/path literals replaced with title-neutral equivalents).lobomfz/VIctory-xmemPR #332 (0e8e798, GPL-3.0):VICTORY_KEEP_HOST_BUFFERS.lobomfz/VIctory-xmemPR #330 (294219a,d192205, GPL-3.0):VICTORY_PARTS_ONE_CALL.SandBar-developer/VIctory-SandBarcommitd0132b2(GPL-3.0):VICTORY_DYNAMIC_CHUNK+ read-lock-firstshadow::loose.Verification
Verified locally with
RUSTUP_TOOLCHAIN=1.98.1-x86_64-pc-windows-gnuandC:\msys64\mingw64\bin;C:\msys64\ucrt64\bin;prepended toPATH:cargo xtask policy— passed (asset policy: 355 files ok).cargo test -p xtask --locked—8 passed; 0 failed.cargo clippy --workspace --all-targets -- -D warnings— passed.cargo clippy -p victory-gpu --all-targets --features diagnostics -- -D warnings— passed.cargo test -p victory-gpu -- --test-threads=1—877 passed; 0 failed; 39 ignored(includesdescriptor::host::chunk_tests,host::keep::keep_tests,host::parts::part_call_testsincl. D3D12 hardware + debug layer check,host::prelude::tests,list::bc_copy_tests,shadow::window_tests::loose_in_shares_read_lock_on_hit_and_creates_once_outside_write_lock).cargo test -p victory-hle -- --test-threads=1—254 passed; 0 failed; 3 ignored(1 passedintests/no_dll_planting.rs, includes 5modules::dstorage::tests::decoded_cache_*tests).cargo test -p victory -- --test-threads=1—47 passed; 0 failed(2 passedintests/census.rs).Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T18:03:55Z.
Triage (
df0efa24, CIcheckPASS):+1,896/-210, 13 files), but markedtriage: needs workunder the no-opt-in-toggle policy:VICTORY_KEEP_HOST_BUFFERS(crates/victory-gpu/src/host/keep.rs) andVICTORY_PARTS_ONE_CALL(crates/victory-gpu/src/host/parts.rs) are wired as off-by-default opt-in toggles (crate::switch::on(...)). Only=0kill-switches for default-on replacements are allowed.=0kill-switches (once verified safe and faster under Gate 2 Audit + Gate 3 plain---releaseA/B), or split/drop any sub-feature not yet ready to replace the default path.VICTORY_DSTORAGE_CACHE,VICTORY_PRELUDE_SHARED, andVICTORY_DYNAMIC_CHUNK=256(inplay.rs/play-minivi.ps1) are already default-on and look clean.#282) + Gate 3 plain---releaseA/B (also note overlap inhost.rs,list.rs,descriptor/host.rs,play.rswith#393and#404).Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T19:02:15Z.
Automated triage for the maintainers (not an approval).
Verdict:
needs-rebase· CI (check):passingThis PR no longer merges cleanly into
main.To change the verdict: Rebase onto current
mainand resolve conflicts; CI and triage will run again automatically.Generated with Antigravity CLI (
agy).