Physical pages can be held in our working set so the pagefile is not written behind the title (VICTORY_KEEP_PAGES=1, off by default) #1291
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1294"
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 fxceless/victory-fork. Originally posted by flxppr on 2026-11-26T12:02:34Z.
What
When the title unmaps the last view of physical pages it wrote (it remaps all the time), Windows moves them to the modified list and writes them to the pagefile, even though the title still holds them. On a slow drive that write-back starves DirectStorage reads.
With
VICTORY_KEEP_PAGES=1, each section of physical pages gets one view of all of it that is never unmapped, and each page a view commits is read once through it. The pages stay in the working set and only leave if Windows trims us. Cost: address space, plus one read per 4 KiB at each mapping. Off under Wine (its sections are sparse files). Off by default; one file changed (crates/victory-hle/src/modules/xmem.rs).Measured
RX 7600 XT, Ryzen 7 5800X, 48 GB RAM, DRAM-less SATA SSD (89% full), 32 GB fixed pagefile. Same save, the diagnostics build, the speed switches (
ASYNC_SUBMIT,QUEUE2,TEXTURE_NO_WAIT,INDIRECT_WINDOW,COPY_PLAIN,CARD_WINDOWS_MB=512) on in both runs. Disk counters sampled once a second.Without the switch, after a heavy remap the drive sat at 100% busy moving 1 to 2 MB/s for 60 to 90 s, and loading stopped until it drained. With it that never happened. The remaining ~0.5 s hitches line up with streaming reads on a healthy drive.
When it helps
Worth trying with a SATA drive and spare RAM. A tester's run on 16 GB RAM with an NVMe drive (Series S profile, ~19 GB committed) was neutral to slightly worse, within run-to-run noise: with that little room, Windows trims the working set anyway, and an NVMe never showed the write-back stalls. That is why it stays opt-in.
Not tested: Wine.
Imported from fxceless/victory-fork. Originally posted by Exopus-0x65f7ad0 on 2026-11-26T13:15:53Z.
Data point for the untested case: 16 GB RAM, RTX 5060 Ti 8 GB, NVMe, Windows 11, Series S profile.
Setup: our tree with this commit ported onto 2 MiB sections (the keeping view is made per section). Same save, standing at the cell window, about 6 minutes in the world each.
VICTORY_KEEP_PAGES1Leaving it off here. It looks worth keeping opt-in for SATA drives with plenty of RAM.
AI-assisted (Claude Code). Counts only, nothing from the game.
Imported from fxceless/victory-fork. Originally posted by flxppr on 2026-11-26T14:23:57Z.
Thanks, that's exactly the case I couldn't test. It matches what I'd expect: keeping pages resident only helps when RAM has room to spare and the disk is the bottleneck. On 16 GB with ~19 GB committed, Windows trims the working set anyway, and an NVMe never hits the 100%-busy flush stalls a SATA SSD did here (48 GB RAM, SATA, the stalls stopped with
VICTORY_KEEP_PAGES=1).It stays opt-in (off unless set to
1). I've added a line to the description: worth trying on SATA drives with spare RAM, neutral to slightly worse on 16 GB.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.