Residency: count what the pagefiles can still grow by as commit left (no false memory pressure with RAM free) #339
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/339"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by bentsignal on 2026-11-27T21:12:57Z.
What this fixes
On a PC with plenty of free RAM, the layer goes into "host memory pressure" about 40 seconds into the first cutscene and stays there:
residency.rsreadsullAvailPageFile(commit left under the limit of the moment) and treats it as a hard wall. On Windows' default setting the pagefile is system-managed: when commit reaches the limit, Windows grows the pagefile. On this PC the limit went from 69 to 75 GB in one session. So the layer thinks it is out of memory while 20+ GB of RAM is free, and then:prefetch_limit, critical commit), so textures picked by index arrive late;pressured()/critical_commit()behaves as if memory were short.The change
available_commit= commit left now + what the pagefiles can still grow by (commit_growth):HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PagingFiles. A system-managed entry (no sizes,0 0, or?:\pagefile.sysfor "automatic on all drives") may grow to 3x RAM, at least 4 GB and at most an eighth of its volume. A custom entry may grow to its own maximum.sample_commitandrefreshuse it. Nothing else changes.VICTORY_COMMIT_GROWTH=0counts the limit of the moment alone, as before.pagefiles=["C:\ system-managed"] commit_limit_mib=70950.A PC with a fixed pagefile (initial = max), or with no pagefile, behaves as before.
Measured
RTX 5070 Ti 16 GB, Ryzen 9 9900X, 61.6 GB RAM, 7.9 GB system-managed pagefile, Windows 11. Series X profile, 2560x1440, DLSS Quality, release build, every pipeline warmed. First cutscene from a save, keys scripted with
VICTORY_KEYS.Late textures in that scene also came from the card's memory, which this PR doesn't touch. Black faces were still there with this change alone.
Windows itself never refused a commit in these runs; the existing
E_OUTOFMEMORYback-off (allocation_error) still covers a real refusal.Tests
cargo test -p victory-gpu --lib residency: 4 passed, including a new one forPagingFilesentries (?:,0 0, custom sizes, empty).cargo clippy -p victory-gpu --all-targets: no new warnings (39 onmainbefore and after).Setup
Own dump of the title. No game files are attached or quoted.
This change and its testing were done with an AI assistant (Claude Code), and the results were checked on my machine.
🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by jebaczydow on 2026-11-27T22:45:58Z.
On a PC where Windows manages the pagefile,
pagefiles()returned no entries here, and the log read:The value on that PC is a
REG_SZ, not aREG_MULTI_SZ:RegGetValueWwithRRF_RT_REG_MULTI_SZalone refuses aREG_SZ. Accepting both types in the two calls fixes it:With that change, the same PC logged:
Windows 11 (10.0.26300), 31.6 GB RAM, system-managed pagefile on C:.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by 1tsethan on 2026-11-27T23:01:06Z.
Independent Windows validation of PR #339.
Tested commit:
e8e2dfcd718a2d1c7b6f1be58b9e9d120cc2980c.cargo test --locked -p victory-gpu residency:: -- --nocapture --test-threads=1Exit: 0.
Coverage here is existing residency tests including pagefile parsing, not empirical allocation/headroom behavior under low disk space or pagefile growth.
Independent verification with OpenAI Codex assistance. Windows 11 Pro build 26200; Rust 1.98.1 MSVC; Windows SDK libraries from Microsoft.Windows.SDK.CPP.x64 10.0.28000.2957. Test harness used an RTX 3070 Ti / AMD integrated-GPU host; adapter identity was not captured for every test. These are focused checks on the stated PR commit, not gameplay, FPS, or a merged-main integration result.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by cloph-dsp on 2026-11-28T02:01:08Z.
Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):
e8e2dfcd718a2d1c7b6f1be58b9e9d120cc2980c, single-commit parent/base0f0ada19095979e2192d1b5a98bb5297cf4d53ea.cargo test --locked -p victory-gpu --lib -- residency::tests::pagefile_entries_say_their_volume_and_largest_size --exact --test-threads=1 --quiet→ 1 passed, 0 failed, 459 filtered, exit 0.git grep -Ffor the test name on the base returned no hits (test is new on this PR);git diff --check 0f0ada19 HEADclean (2 files, +161/-3).CARGO_TARGET_DIR(never shared) withCARGO_BUILD_JOBS=2; local clone is shallow so the PR's single-commit parent was used as base instead of a merge-base.AI-assisted (Hy4 flash).
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by KruIN689 on 2026-11-28T10:41:49Z.
I tested this PR in game. The PC has an RTX 5080 (driver 621.24), 47 GB of RAM and Windows 11. The pagefile is system-managed (
PagingFilesisREG_MULTI_SZ?:\pagefile.sys) and was 16 GB at the start. I used the release build of #822's head with this commit cherry-picked on top. The game is my own copy. Series X profile, 1440p, DLSS Quality.Detection: at start the log read
pagefiles=["C:\\ system-managed"] commit_limit_mib=64696, so the?:entry is found.One 11-minute session. I sampled every 10 s from outside the process (
Win32_PerfFormattedData_PerfOS_Memory, the process's private bytes):residency.rscounted before this PR: 3.3–3.9 GB from minute 1 on, at its lowest 0.7 GB.next_pressurefor almost the whole session.host memory pressure ... physical_free_mib=7749 available_commit_mib=4091and stayed there.Note on the REG_SZ report above:
pagefiles()asks only forRRF_RT_REG_MULTI_SZ. Here the value isREG_MULTI_SZ, so it worked, but that matches the earlier report that aREG_SZvalue gives an empty list. Asking forRRF_RT_REG_SZ | RRF_RT_REG_MULTI_SZshould cover both, since thesplit('\0')that follows already handles a single string.Not tested:
AI use: Claude Code (Claude Opus 5.5) built and ran this, sampled and analyzed the numbers, and drafted this comment. I read it before posting.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by futurepro62 on 2026-11-28T20:44:46Z.
Tested on main
9300875+ this PR. System: RTX 5070 Ti 16 GB (driver 621.40), Ryzen 7 9800X3D (SMT on, 16 threads), 32 GB DDR5, Windows 11 build 26300, pagefile C: 32–64 GB (custom). Title 1.0.2.1. Script launcher, mode 6, Series X, DLSS + DLSS frame generation 4x. Built from source.. Output 3840x2160 + DLSS Performance.Detection works on a custom pagefile (MEASURED):
Before → after, the same kind of scene (MEASURED). Before:
After:
Commit is now counted correctly (7.9 → 42 GB). On a 32 GB PC the warning still comes about one minute into each session. The cause is now the physical-RAM test (
physical <= 3 GiBinnext_pressure, READ IN CODE): the game holds ~24–28 GB private. So with 32 GB this PR removes the commit half of the trigger, but not the warning itself. No errors and no crashes in the sessions so far.