[CLAIM] VSP-03: discard dead streaming-pool pages from the section's lasting view (working set) #8

Closed
opened 2026-11-30 16:22:19 +00:00 by github-bot · 1 comment
Owner

@⁠thefafu on GitHub · 2026-11-30 00:20 UTC · original

Roadmap Task ID

VSP-03

Technical Plan & File Scope

File: crates/vesper-hle/src/modules/xmem.rs only.

Problem measured (RX 9060 XT / 32 GB, Series X, 4K out + HW RT; details in issue 5): the whole-section view kept by Section::window (VESPER_SECTION_WINDOW) keeps every page DirectStorage wrote or the books read through it in the working set, also after the title unmapped and gave the page back. Working set 22-25 GB, free RAM 1-4 GB; spikes over 100 ms are 22 % of spikes with 1-2 GB free RAM and 5 % with 5-6 GB free.

Change (VESPER_POOL_DISCARD=1, off by default): Section gets resident/discarded/fresh bits; window() marks pages used; change() and unmap() note pages that lost a view; a thread, a while after (adaptive 2-10 s) and only while free RAM is under VESPER_POOL_DISCARD_BELOW_MB, MEM_RESETs pages shown by no view but the whole-section view under the views' lock, in pieces of 64 pages, then VirtualUnlocks them after the lock (pages used again since their unmapping are kept). A "pool discard:" line every 30 s.

Measured so far: 11-28 GB let go per drive, under 0.5 % needed again; working set peak ~25.5 GB down to 18-23 GB. A first version with 64 MiB pieces under the lock stalled the title's CopyPageMappings (77 ms a frame on the frame chain in a VESPER_TIMELINE trace); with 4 MiB pieces spikes over 200 ms went 14 -> 7 a minute and over 500 ms 1.3 -> 0.4.

Verification for the PR: xmem unit tests, clippy -D warnings, xtask tests, before/after benchmarks (Avg/Med FPS, p95, GPU busy, peak private RAM, working set) from the same restored save and route.

Contributor Rules

  • I confirmed no other open Task Claim holds this ID.
  • I will include local clippy + xtask test results and real before/after benchmarks in my PR.
**@⁠thefafu** on GitHub · 2026-11-30 00:20 UTC · [original](https://github.com/monte-alt/vesper/issues/8) ### Roadmap Task ID VSP-03 ### Technical Plan & File Scope File: `crates/vesper-hle/src/modules/xmem.rs` only. Problem measured (RX 9060 XT / 32 GB, Series X, 4K out + HW RT; details in issue 5): the whole-section view kept by `Section::window` (`VESPER_SECTION_WINDOW`) keeps every page DirectStorage wrote or the books read through it in the working set, also after the title unmapped and gave the page back. Working set 22-25 GB, free RAM 1-4 GB; spikes over 100 ms are 22 % of spikes with 1-2 GB free RAM and 5 % with 5-6 GB free. Change (`VESPER_POOL_DISCARD=1`, off by default): `Section` gets resident/discarded/fresh bits; `window()` marks pages used; `change()` and `unmap()` note pages that lost a view; a thread, a while after (adaptive 2-10 s) and only while free RAM is under `VESPER_POOL_DISCARD_BELOW_MB`, MEM_RESETs pages shown by no view but the whole-section view under the views' lock, in pieces of 64 pages, then VirtualUnlocks them after the lock (pages used again since their unmapping are kept). A "pool discard:" line every 30 s. Measured so far: 11-28 GB let go per drive, under 0.5 % needed again; working set peak ~25.5 GB down to 18-23 GB. A first version with 64 MiB pieces under the lock stalled the title's `CopyPageMappings` (77 ms a frame on the frame chain in a `VESPER_TIMELINE` trace); with 4 MiB pieces spikes over 200 ms went 14 -> 7 a minute and over 500 ms 1.3 -> 0.4. Verification for the PR: xmem unit tests, clippy `-D warnings`, xtask tests, before/after benchmarks (Avg/Med FPS, p95, GPU busy, peak private RAM, working set) from the same restored save and route. ### Contributor Rules - [x] I confirmed no other open Task Claim holds this ID. - [x] I will include local clippy + xtask test results and real before/after benchmarks in my PR.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 16:22:19 +00:00
Author
Owner

@⁠thefafu on GitHub · 2026-11-30 00:21 UTC · original

Closing this as a duplicate of #4, which claimed VSP-03 earlier and touches the same file (xmem.rs). It did not show up in the issue search when I checked before filing (search index delay), sorry for the noise.

The pool-discard change described here can follow as its own scoped change once #4 has landed; the measurements are in #5, and I left a note on #4.

**@⁠thefafu** on GitHub · 2026-11-30 00:21 UTC · [original](https://github.com/monte-alt/vesper/issues/8#issuecomment-7265203965) Closing this as a duplicate of #4, which claimed VSP-03 earlier and touches the same file (`xmem.rs`). It did not show up in the issue search when I checked before filing (search index delay), sorry for the noise. The pool-discard change described here can follow as its own scoped change once #4 has landed; the measurements are in #5, and I left a note on #4.
This discussion has been locked. Commenting is limited to contributors.
No description provided.