Repository navigation
Conversation
|
Three things that may save a round of review:
(Also: in my runs on the same machine, commit itself never ran out — 64 GB page file, ~52 GB commit free. The failures were the D3D12 non-local budget. #1021, on the other hand, is the commit limit: |
…essure On 16 GB RAM systems, VirtualAlloc(MEM_COMMIT) fails during core_restofworld.rpf streaming because the Windows commit limit is exhausted by ~6.1 GB of physical pages. commit() returned false, XMemMapPhysicalPages() returned null, the game stored the null, and 2 s later dereferenced [null+0xe] → 0xc0000005. Before surfacing the failure, drop Victory's spare D3D12 upload buffer pool (trim_spare_chunks, now pub) and retry the commit once. The SPARE pool holds committed GPU upload memory that Windows can reuse, freeing committed pages back to the system. The first successful retry logs freed_mb so it is easy to see how much the pool gave. Fixes trustno1-coder#1049 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
7b01c26 to
b03c881
Compare
Root cause
On 16 GB RAM systems,
VirtualAlloc(MEM_COMMIT)fails duringcore_restofworld.rpfstreaming because the Windows commit limit is exhausted. The game allocates ~6.1 GB of physical pages (SEC_RESERVE sections) and commits them on demand throughXMemMapPhysicalPages→place()→show_as()→commit().When the commit limit is hit:
commit()returnsfalseXMemMapPhysicalPages()returns null[null+0xe]→0xc0000005The existing
commit_refused()comment already noted: "the title usually faults soon after on the null it gets" — this PR prevents the null from ever being returned.Fix
Before surfacing the commit failure, drop Victory's spare D3D12 upload buffer pool (
trim_spare_chunks, nowpub) and retry the commit once.The
SPAREpool holds idleID3D12Resourceupload buffers that back committed Windows pages. Dropping them releases that committed memory back to the system, giving the retry a good chance to succeed. The pool often holds hundreds of MB at the moment of peak pressure.Changes
crates/victory-gpu/src/host.rstrim_spare_chunksmadepub, now returnsu64bytes freedcrates/victory-gpu/src/lib.rstrim_spare_chunkscrates/victory-hle/src/modules/xmem.rscommit()callsvictory_gpu::trim_spare_chunks()on first failure and retriesTesting
The crash is specific to 16 GB RAM. Build verified clean (
cargo build --release --locked). The retry path is exercised only when the firstVirtualAllocfails, so there is no overhead on systems that do not hit the commit limit.Closes #1049
🤖 Generated with Claude Code