xmem: opt-in lazy/file-backed physical pages for commit-limit pressure #356

Open
Adika713 wants to merge 1 commit from upstream-pr/356 into main
Adika713 commented 2026-11-26 18:20:08 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by Adika713 on 2026-11-26T18:20:08Z.


## What / why
Opt-in host-memory mitigation for the measured Windows commit-limit failure when the title allocates large physical-page pools (~6.1 GiB). On 32 GB hosts with a small pagefile, the pre-fix run hit Windows commit limit reached while committing 6538919936 bytes of physical pages and exited at 12s.

This adds two default-off env flags:

  • VICTORY_LAZY_PHYSICAL=1: commit only a small prefix of reserved physical-page views, register the view range, and commit faulting 64 KiB pages on demand via a vectored exception handler. If VEH cannot be installed or prefix commit fails, it falls back to the existing commit-refused path.
  • VICTORY_FILE_PHYSICAL=1: back physical-page sections with a temporary file (VICTORY_CACHE_DIR or current dir) instead of pagefile-backed section commit; file is removed on section drop. Falls back to pagefile-backed section on failure.

What is in it

  • crates/victory-hle/src/modules/xmem.rs: adds opt-in section creation/commit behavior, lazy range tracking, VEH demand-commit, lazy range cleanup on unmap, and game-free test lazy_range_tracking_splits_on_remove.

Tested

  • Hardware: Windows 11, AMD RX 6950 XT 16337 MB, Ryzen 5 3600, 32 GB RAM, pagefile unchanged (2688 MB).
  • cargo build --locked -p victory -p victory-hle (F: temp/target F:\VIctory-Belobug-AMD\_agent_tmp\target-avatarmanz) => Finished dev profile.
  • cargo test --locked -p victory-hle --lib lazy_range_tracking_splits_on_remove -- --test-threads=1 => ok. 1 passed; 0 failed.
  • cargo test --locked -p victory-hle --lib pages_say_where_they_are_mapped -- --test-threads=1 => ok. 1 passed; 0 failed.
  • Monitored real game run test-story-series-x-20261126-191228 (series-x, 1280x720, BudgetMb 64, TextureMax 128, lazy/file physical on, 240s max): elapsed_s=80 stop=exited exit_code=, frame_interval_count=0 max_frame_logged=1024 frame_presented_log_count=11 world_entry_candidate=False reason=insufficient_present_samples, shot_30s.png avg=129.5 min=0 max=249 (non-black; not proof of world entry). The earlier 12s os error 1455 physical-page commit-limit failure did not reproduce. New failure mode: many dstorage os error 1450 read failures followed by unhandled exception 0xc00000fd stack overflow at victory.exe+0x11a5a77. Logs: F:\VIctory-Belobug-AMD\_agent_reports\logs\test-story-series-x-20261126-191228.*.

Not tested

  • No 7900 XTX / i9-12900K / 64 GB target-hardware validation.
  • No claim of world entry, stable FPS, visuals, or crash-free story session.
  • cargo test -p victory-hle --lib modules::xmem -- --test-threads=1 previously hit StackOverflowException in the target dir during investigation; individual xmem tests above passed. Needs follow-up before marking ready.

AI use

OpenCode / Big Pickle (gpt-5 reasoning style not used; model as reported by harness). AI-assisted code/test/log analysis; all commands/results above were actually run.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6632741270 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/356). Originally posted by [Adika713](https://github.com/Adika713) on 2026-11-26T18:20:08Z. --- ## What / why Opt-in host-memory mitigation for the measured Windows commit-limit failure when the title allocates large physical-page pools (~6.1 GiB). On 32 GB hosts with a small pagefile, the pre-fix run hit `Windows commit limit reached while committing 6538919936 bytes of physical pages` and exited at 12s. This adds two default-off env flags: - `VICTORY_LAZY_PHYSICAL=1`: commit only a small prefix of reserved physical-page views, register the view range, and commit faulting 64 KiB pages on demand via a vectored exception handler. If VEH cannot be installed or prefix commit fails, it falls back to the existing commit-refused path. - `VICTORY_FILE_PHYSICAL=1`: back physical-page sections with a temporary file (`VICTORY_CACHE_DIR` or current dir) instead of pagefile-backed section commit; file is removed on section drop. Falls back to pagefile-backed section on failure. ## What is in it - `crates/victory-hle/src/modules/xmem.rs`: adds opt-in section creation/commit behavior, lazy range tracking, VEH demand-commit, lazy range cleanup on unmap, and game-free test `lazy_range_tracking_splits_on_remove`. ## Tested - Hardware: Windows 11, AMD RX 6950 XT 16337 MB, Ryzen 5 3600, 32 GB RAM, pagefile unchanged (2688 MB). - `cargo build --locked -p victory -p victory-hle` (F: temp/target `F:\VIctory-Belobug-AMD\_agent_tmp\target-avatarmanz`) => **Finished dev profile**. - `cargo test --locked -p victory-hle --lib lazy_range_tracking_splits_on_remove -- --test-threads=1` => `ok. 1 passed; 0 failed`. - `cargo test --locked -p victory-hle --lib pages_say_where_they_are_mapped -- --test-threads=1` => `ok. 1 passed; 0 failed`. - Monitored real game run `test-story-series-x-20261126-191228` (series-x, 1280x720, BudgetMb 64, TextureMax 128, lazy/file physical on, 240s max): `elapsed_s=80 stop=exited exit_code=`, `frame_interval_count=0 max_frame_logged=1024 frame_presented_log_count=11 world_entry_candidate=False reason=insufficient_present_samples`, `shot_30s.png avg=129.5 min=0 max=249` (non-black; not proof of world entry). The earlier 12s `os error 1455` physical-page commit-limit failure did **not** reproduce. New failure mode: many dstorage `os error 1450` read failures followed by `unhandled exception 0xc00000fd` stack overflow at `victory.exe+0x11a5a77`. Logs: `F:\VIctory-Belobug-AMD\_agent_reports\logs\test-story-series-x-20261126-191228.*`. ## Not tested - No 7900 XTX / i9-12900K / 64 GB target-hardware validation. - No claim of world entry, stable FPS, visuals, or crash-free story session. - `cargo test -p victory-hle --lib modules::xmem -- --test-threads=1` previously hit `StackOverflowException` in the target dir during investigation; individual xmem tests above passed. Needs follow-up before marking ready. ## AI use OpenCode / Big Pickle (gpt-5 reasoning style not used; model as reported by harness). AI-assisted code/test/log analysis; all commands/results above were actually run.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/356:upstream-pr/356'
git switch 'upstream-pr/356'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/356'
git switch 'upstream-pr/356'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/356'
git switch 'upstream-pr/356'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/356'
git switch 'main'
git merge --squash 'upstream-pr/356'
git switch 'main'
git merge --ff-only 'upstream-pr/356'
git switch 'main'
git merge 'upstream-pr/356'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
avatarmanz/VIctory-7900XTX!356
No description provided.