RTX 3080 Ti (12 GB), 32 GB RAM: VICTORY_WINDOW_KB / WINDOW_TAILS / INPLACE measured on 90228a7 — none moves private memory by more than ~0.3 GB #54

Open
opened 2026-11-26 03:35:17 +00:00 by github-bot · 2 comments
Owner

@⁠CDR-0000 on GitHub · 2026-11-24 20:58 UTC · original

shadow.rs keeps the 4 MiB window grid "until a run with the memory line's window counts has shown what the finer grids give". Four runs answer that on this PC.

Setup
NVIDIA GeForce RTX 3080 Ti 12 GB (32-lane waves), driver 32.0.16.1742; Ryzen 7 7800X3D; 32 GB RAM, 16 GB page file (commit limit 47.6 GB); Windows 11 Pro 26300; diag build (--profile diag --features diagnostics) of 90228a7. Same route each run (straight into the prologue), no input. Each run was stopped by an outside guard at 20 GB private, 85–98 s in, all past the world load.

Run windows window MB ever copied span asked host copies of title memory private at stop to 20 GB
default (4096 KiB) 700 2988 1805 1485 3975 MB 19.7 GB 85 s
VICTORY_WINDOW_KB=1024 2069 3512 2030 1641 4499 MB 20.3 GB ~88 s
VICTORY_WINDOW_KB=256 + VICTORY_WINDOW_TAILS=1 4727 2706 1760 1399 3693 MB 19.7 GB 98 s
VICTORY_INPLACE=1 (+ _PROBE=1) 672 (+81 in place, 384 MB) 2868 1633 1434 3483 MB 20.1 GB 90 s
  • 1 MiB grid is worse here: +514 MB of windows — the same memory asked for with different ranges lands in several windows (as the comment warns).
  • 256 KiB + tails: −282 MB of windows for 6.8x as many; private memory at matching times after the world load is within ~0.5 GB of the default in every run.
  • In place, stage 1: at most 81 windows (384 MB) placed; 600–723 turned down as view memory. The census line: "a section of 6236 MB, reserved: refused as a heap until it is made with SEC_COMMIT". On this title ~88% of windows are page-pool views, so stage 1 cannot move the total.

Where the memory is (default run, memory map at 19.7 GB private): title heaps 4628 MB; process heap 741 MB; windows 2206 MB; write-combined 7047 MB (146 × 32 MB: 4137 MB); other private ≥ 1 MB 4012 MB (3 × 1024 MB: 1435 MB, 28 × 32 MB: 893 MB); card 6740 of 11316 MB budget, 4919 MB of PC memory shared with it.

Without a larger page file the plain release build ends with memory allocation of 3145728 bytes failed at 23.4 GB private, ~240 s in. So on a 32 GB PC the window and in-place switches don't change whether the game fits; what would is making the page pool openable in place (SEC_COMMIT, at 6.2 GB of commit up front) or dropping the CPU side of copies.

Logs and summaries for all four runs available on request.

Written with Claude Code (Claude Opus 5.5); the runs are mine.

**@⁠CDR-0000** on GitHub · 2026-11-24 20:58 UTC · [original](https://github.com/fxceless/victory-fork/issues/54) `shadow.rs` keeps the 4 MiB window grid "until a run with the memory line's window counts has shown what the finer grids give". Four runs answer that on this PC. **Setup** NVIDIA GeForce RTX 3080 Ti 12 GB (32-lane waves), driver 32.0.16.1742; Ryzen 7 7800X3D; 32 GB RAM, 16 GB page file (commit limit 47.6 GB); Windows 11 Pro 26300; diag build (`--profile diag --features diagnostics`) of `90228a7`. Same route each run (straight into the prologue), no input. Each run was stopped by an outside guard at 20 GB private, 85–98 s in, all past the world load. | Run | windows | window MB | ever copied | span asked | host copies of title memory | private at stop | to 20 GB | |---|---|---|---|---|---|---|---| | default (4096 KiB) | 700 | 2988 | 1805 | 1485 | 3975 MB | 19.7 GB | 85 s | | `VICTORY_WINDOW_KB=1024` | 2069 | 3512 | 2030 | 1641 | 4499 MB | 20.3 GB | ~88 s | | `VICTORY_WINDOW_KB=256` + `VICTORY_WINDOW_TAILS=1` | 4727 | 2706 | 1760 | 1399 | 3693 MB | 19.7 GB | 98 s | | `VICTORY_INPLACE=1` (+ `_PROBE=1`) | 672 (+81 in place, 384 MB) | 2868 | 1633 | 1434 | 3483 MB | 20.1 GB | 90 s | - **1 MiB grid is worse here**: +514 MB of windows — the same memory asked for with different ranges lands in several windows (as the comment warns). - **256 KiB + tails**: −282 MB of windows for 6.8x as many; private memory at matching times after the world load is within ~0.5 GB of the default in every run. - **In place, stage 1**: at most 81 windows (384 MB) placed; 600–723 turned down as view memory. The census line: "a section of 6236 MB, reserved: refused as a heap until it is made with SEC_COMMIT". On this title ~88% of windows are page-pool views, so stage 1 cannot move the total. **Where the memory is (default run, memory map at 19.7 GB private):** title heaps 4628 MB; process heap 741 MB; windows 2206 MB; write-combined 7047 MB (146 × 32 MB: 4137 MB); other private ≥ 1 MB 4012 MB (3 × 1024 MB: 1435 MB, 28 × 32 MB: 893 MB); card 6740 of 11316 MB budget, 4919 MB of PC memory shared with it. Without a larger page file the plain release build ends with `memory allocation of 3145728 bytes failed` at 23.4 GB private, ~240 s in. So on a 32 GB PC the window and in-place switches don't change whether the game fits; what would is making the page pool openable in place (SEC_COMMIT, at 6.2 GB of commit up front) or dropping the CPU side of copies. Logs and summaries for all four runs available on request. Written with Claude Code (Claude Opus 5.5); the runs are mine.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:35:17 +00:00
Author
Owner

@⁠JFIREonFIRE on GitHub · 2026-11-24 23:05 UTC · original

More context on where private memory goes, since the windows are only a small part of it. Taken from the fork's own memory map diagnostics line at steady state in the prologue. RTX 3090 24 GB, 32 GB RAM, 2119b0e, diag build, about 11 minutes in the world. The process peaked at 24.7 GB private, and Windows had to grow the page file to fit it (system commit 50 of 52 GB, 3–4 GB of RAM free).

category (as the map line names it) committed in memory
write-combined (buffers shared with the card) 11,225 MB 856 MB
views of the title's pages (mapped) 7,237 MB 4,156 MB
the title's page pool (mapped, 1 GB and more) 6,236 MB 0 MB
the title's heaps (private) 4,628 MB 2,003 MB
other private allocations of 1 MB and more 4,681 MB 4,622 MB
windows of title memory and other 4 MiB allocations 2,491 MB 2,455 MB
process heap 1,075 MB 1,069 MB

Points that may help decide what to work on. They come from reading the code, so they are leads, not measurements of a change:

  1. Write-combined is the biggest committed category, and almost none of it is resident. The biggest groups are 263 × 32 MB (6.6 GB) plus many 5–15 MB blocks. That looks like the driver's allocations for card resources and upload memory (host textures alone are ~8 GB of DEFAULT committed resources), charged to process commit. If so, they cost page file and commit limit rather than RAM, and texture-copy eviction (#140, #48, #45, #42) is the lever, not the window grid. I haven't confirmed which D3D12 objects back these blocks.
  2. The title's heaps: ~2.6 GB committed and never touched. XMemVirtualAlloc with MEM_COMMIT commits the whole range up front (xmem.rs, the VirtualAlloc2 call). Reserving and committing on first touch would return most of that, with these risks:
    • writes from the kernel (e.g. DirectStorage reads into title memory) would need the range committed first;
    • VirtualQuery must still answer COMMIT;
    • in-place heaps need a fully committed allocation.
  3. The page pool is a single 6.2 GB SEC_RESERVE section. A page's commit is taken when it is first mapped and never comes back while the section lives. It also isn't counted in "private", which is why the system commit is higher than private suggests. Splitting it into sections under 4 GiB would also clear the way for OpenExistingHeapFromFileMapping (which upstream #880 found refuses committed sections of 4,096 MB and above). In your runs, page-pool views are most of the windows.
  4. 5 × 1 GB and ~28 × 32 MB private blocks (~3 GB) aren't allocated anywhere in the tree. They may be driver-internal, possibly tied to command lists: the log shows ~670 host lists alive and "private bytes grew … while lists were made".

AI-assisted (Claude Code). Counts from the log only.

**@⁠JFIREonFIRE** on GitHub · 2026-11-24 23:05 UTC · [original](https://github.com/fxceless/victory-fork/issues/54#issuecomment-7146998482) More context on where private memory goes, since the windows are only a small part of it. Taken from the fork's own `memory map` diagnostics line at steady state in the prologue. RTX 3090 24 GB, 32 GB RAM, `2119b0e`, diag build, about 11 minutes in the world. The process peaked at 24.7 GB private, and Windows had to grow the page file to fit it (system commit 50 of 52 GB, 3–4 GB of RAM free). | category (as the map line names it) | committed | in memory | |---|---:|---:| | write-combined (buffers shared with the card) | **11,225 MB** | 856 MB | | views of the title's pages (mapped) | 7,237 MB | 4,156 MB | | the title's page pool (mapped, 1 GB and more) | 6,236 MB | 0 MB | | the title's heaps (private) | 4,628 MB | 2,003 MB | | other private allocations of 1 MB and more | 4,681 MB | 4,622 MB | | windows of title memory and other 4 MiB allocations | 2,491 MB | 2,455 MB | | process heap | 1,075 MB | 1,069 MB | Points that may help decide what to work on. They come from reading the code, so they are leads, not measurements of a change: 1. **Write-combined is the biggest committed category, and almost none of it is resident.** The biggest groups are 263 × 32 MB (6.6 GB) plus many 5–15 MB blocks. That looks like the driver's allocations for card resources and upload memory (host textures alone are ~8 GB of DEFAULT committed resources), charged to process commit. If so, they cost page file and commit limit rather than RAM, and texture-copy eviction (#140, #48, #45, #42) is the lever, not the window grid. I haven't confirmed which D3D12 objects back these blocks. 2. **The title's heaps: ~2.6 GB committed and never touched.** `XMemVirtualAlloc` with `MEM_COMMIT` commits the whole range up front (`xmem.rs`, the `VirtualAlloc2` call). Reserving and committing on first touch would return most of that, with these risks: - writes from the kernel (e.g. DirectStorage reads into title memory) would need the range committed first; - `VirtualQuery` must still answer COMMIT; - in-place heaps need a fully committed allocation. 3. **The page pool is a single 6.2 GB `SEC_RESERVE` section.** A page's commit is taken when it is first mapped and never comes back while the section lives. It also isn't counted in "private", which is why the system commit is higher than private suggests. Splitting it into sections under 4 GiB would also clear the way for `OpenExistingHeapFromFileMapping` (which upstream #880 found refuses committed sections of 4,096 MB and above). In your runs, page-pool views are most of the windows. 4. **5 × 1 GB and ~28 × 32 MB private blocks (~3 GB)** aren't allocated anywhere in the tree. They may be driver-internal, possibly tied to command lists: the log shows ~670 host lists alive and "private bytes grew … while lists were made". AI-assisted (Claude Code). Counts from the log only.
Author
Owner

@⁠j-fuxa on GitHub · 2026-11-26 01:41 UTC · original

Numbers from an RTX 4060 Laptop (a hardware adapter) for calls that the header of inplace.rs measured with WARP, plus one trap.

Matches the header: OpenExistingHeapFromFileMapping returns E_INVALIDARG for a SEC_RESERVE section; OpenExistingHeapFromAddress1(addr, size) opens committed 64 KiB-aligned sub-ranges as custom write-back L0 heaps; placed resources need D3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER (textures row-major only); while a heap is open, VirtualProtect, VirtualFree and UnmapViewOfFile on its pages fail with error 87.

Different from the WARP figure (70 ms for 256 MiB; not like for like, another adapter): opening cost 2.4 to 5 ms per heap regardless of size. Opening makes every page resident (+256 MiB of working set for an untouched 256 MiB range). So the number of heaps, not their size, sets the cost; a few large heaps would beat many 4 MiB ones.

One A/B in the title's world (copy against in place, a single run each): fps 0.8 / 0.8, preparing 597 / 406 ms, GPU 304 / 505 ms (not explained), working set 14.31 / 13.52 GiB.

A trap if pages are dirtied for GetWriteWatch from Rust: AtomicU8::fetch_add(0) is an idempotent read-modify-write, which release builds lower to a plain load. The page stays clean, so dev-profile tests pass and release builds fail. lock add byte ptr [p], 0 (inline asm) does dirty it. We saw no use of that pattern in the files we read; flagging it in case a dirtying helper is added.

Caveats: single runs, the GPU-time rise is unexplained, and our in-place path differs from the one in this tree.

**@⁠j-fuxa** on GitHub · 2026-11-26 01:41 UTC · [original](https://github.com/fxceless/victory-fork/issues/54#issuecomment-7180035412) Numbers from an RTX 4060 Laptop (a hardware adapter) for calls that the header of inplace.rs measured with WARP, plus one trap. Matches the header: `OpenExistingHeapFromFileMapping` returns E_INVALIDARG for a SEC_RESERVE section; `OpenExistingHeapFromAddress1(addr, size)` opens committed 64 KiB-aligned sub-ranges as custom write-back L0 heaps; placed resources need `D3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER` (textures row-major only); while a heap is open, `VirtualProtect`, `VirtualFree` and `UnmapViewOfFile` on its pages fail with error 87. Different from the WARP figure (70 ms for 256 MiB; not like for like, another adapter): opening cost 2.4 to 5 ms per heap regardless of size. Opening makes every page resident (+256 MiB of working set for an untouched 256 MiB range). So the number of heaps, not their size, sets the cost; a few large heaps would beat many 4 MiB ones. One A/B in the title's world (copy against in place, a single run each): fps 0.8 / 0.8, preparing 597 / 406 ms, GPU 304 / 505 ms (not explained), working set 14.31 / 13.52 GiB. A trap if pages are dirtied for `GetWriteWatch` from Rust: `AtomicU8::fetch_add(0)` is an idempotent read-modify-write, which release builds lower to a plain load. The page stays clean, so dev-profile tests pass and release builds fail. `lock add byte ptr [p], 0` (inline asm) does dirty it. We saw no use of that pattern in the files we read; flagging it in case a dirtying helper is added. Caveats: single runs, the GPU-time rise is unexplained, and our in-place path differs from the one in this tree.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/fxceless--victory-fork#54
No description provided.