Repository navigation
Conversation
|
Automated triage for the maintainers. Needs work. This needs the maintainer's decision. The PR adds an opt-in host RAM budget: To move forward, apart from that decision:
CI: Generated by Claude Code |
fuzeofficlal
left a comment
There was a problem hiding this comment.
Reviewed all 16 changed files at b19608cc:
- Lock order & deadlock/starvation safety:
host_ram::Budget::usedis strictly a leaf lock, so there is no lock-order inversion withscheduler.lanes,LOOSE, orxmem. Indstorage::Lanes::start, settingstarved = trueonly whenreservefails withbytes <= budget.limit - used.loose_shadowsguaranteesused.direct_storage > 0(at least one in-flight worker will finish, drop itsReservationinlanes.finish, and notifyscheduler.work), while requests that no longer fit afterloose_shadowsgrows fail cleanly in queue order withE_OUTOFMEMORY. - Lifetime & accounting: Binding
WindowChargeviaID3D12Resource::SetPrivateDataInterfacekeeps loose-window capacity charged for the true D3D12 resource lifetime (even across retired descriptors / in-flight command lists),retire_unusedusesArc::try_unwrapatomically so concurrentWeakupgrades from write-marks cannot race,find_with_owner+for_viewreturnkeep = truefor budgeted loose shadows soHostHeap::keptretains theArc<Shadow>, andhost_ram_budget_mib = 0leavesBUDGETuninitialized with zero behavioral change.
Minor non-blocking notes:
- In
dstorage::work,lanes.count(&job, started)samplesbudget.usage()just beforelanes.finish(job, result)dropsjob.memory, so the 5-second"host RAM budget (bytes)"log includes the just-finished job'sdirect_storagebytes; sampling afterlanes.finishwould reflect post-completion usage. - If guest memory was freed via
VirtualFree(..., MEM_RELEASE)/ 32-bitXMemFreeDefaultand no newloose()allocation has triggeredfree_windowyet, staleMEM_FREEloose windows remain charged inused.loose_shadowswhendstoragechecksbytes <= budget.limit - used.loose_shadows; a future follow-up could sweepMEM_FREEloose windows before returningE_OUTOFMEMORY. - Merge-coordination note for maintainers: if #3055 (
HostHeap::sync_rangesPhase 2find_existing_batch) also lands, its Phase 2 path should preserveown = truefor budgeted loose shadows just asfor_viewdoes here.
Looks solid overall.
kotekompotek
left a comment
There was a problem hiding this comment.
Verified end to end: Budget/Reservation charge-before-allocate under one lock with RAII refund; DS start() distinguishes starved (fits once running reads release, wakes via starved flag) from never-fitting (ordered E_OUTOFMEMORY inside the Job so statuses still land in sequence); loose-shadow reservation hangs on the D3D resource via SetPrivateDataInterface so the charge outlives Shadow; release_loose_windows requires whole-window MEM_FREE + last-Arc + try_unwrap (Weak-upgrade safe); for_view keeps budgeted loose windows alive for views; 1 pipeline worker under budget; combined-read test proves correct bytes through the real zlib+BCPack path. Config/env plumbing and docs included.
|
Note 🤖 Gemini 4 Neon responding on behalf of brainbudt Addressed the triage and review notes:
(A matched 16 GiB title load remains open for anyone with game files.) |
Problem
DirectStorage can reserve a few compressed file bytes and then allocate a much larger zlib-to-BCPack intermediate on each worker. Loose GPU shadow windows also compete for host RAM during loading. The title's staging setting controls only part of that demand. Addresses held by descriptors, lists, and shader page tables can remain live under pressure.
Change
Add an opt-in host buffer budget through
VICTORY_HOST_RAM_BUDGET_MIBor the top-levelhost_ram_budget_mibconfig key. Reserve each read's input, intermediate, BCPack workspace, and possible scattered output before dispatch. A read waits for running reads to release capacity. A request that cannot fit completes through its queue's ordered error path withE_OUTOFMEMORY.Charge loose buffers through their D3D resource lifetime. Reclaim whole, unused windows over released guest memory. In budgeted runs, return idle snapshot buffers, use one runtime pipeline compiler worker, and report accounted bytes (sampled after
lanes.finishreleases the completed job's reservation) alongside process working set and available physical memory.Scope & relation to #3012
Implements the opt-in host-RAM budget requested in #3012 (there is no other open PR addressing #3012). Zero or unset preserves existing scheduling unchanged. The cap covers the named buffers (DirectStorage input/intermediate/workspace/output + loose GPU shadow windows); guest memory, registered resources, active snapshots, compiler internals, and driver allocations remain outside it.
Note for maintainers: this adds
victory-coretovictory-gpuandvictory-hle, addswindows-coretovictory-gpu(forSetPrivateDataInterface), and returnsE_OUTOFMEMORYfor reads that cannot fit within the configured budget.Verification
cargo check --testsandcargo clippy --tests -- -D warningsfor all affected crates, including an additional--all-featuresClippy run.Reviewed with mistral-loop: APPROVE (2 rounds,
mistral-large-4-0+deepseek-v4-1-flash-1017).Created with gpt-6.2-astra in Codex (orchestrated with Gemini 4 Neon in T3 Code).