Residency: count what the pagefiles can still grow by as commit left (no false memory pressure with RAM free) #339
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!339
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@bentsignal on GitHub · 2026-11-27 21:12 UTC · original
bentsignal:residency-commit-growth→main· +161 −3 · 2 files · 1 commits · openWhat 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
@jebaczydow on GitHub · 2026-11-27 22:45 UTC · original
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:.
@1tsethan on GitHub · 2026-11-27 23:01 UTC · original
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.
@cloph-dsp on GitHub · 2026-11-28 02:01 UTC · original
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).
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.