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

Open
github-bot wants to merge 1 commit from github-bot/gh-356 into main AGit
Owner

@⁠Adika713 on GitHub · 2026-11-26 18:20 UTC · original
Adika713:fix/lazy-physical-pages → main · +267 −32 · 1 files · 1 commits · draft

## 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.

**@⁠Adika713** on GitHub · 2026-11-26 18:20 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/356) `Adika713:fix/lazy-physical-pages` → `main` · +267 −32 · 1 files · 1 commits · draft ## 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.
Add VICTORY_LAZY_PHYSICAL=1 to defer commit of large reserved physical-page
views beyond a small prefix and commit touched 64 KiB pages on demand via a
vectored exception handler. Add VICTORY_FILE_PHYSICAL=1 to back physical-page
sections with a temporary file instead of pagefile commit.

Both modes are opt-in and default off. This targets the measured Windows
commit-limit failure (6.1 GiB physical-page allocation, os error 1455) seen on
32 GB hosts with small pagefiles.

Game-free test: lazy_range_tracking_splits_on_remove.

AI-assisted: OpenCode / Big Pickle
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 18:20:58 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/356/head:github-bot/gh-356'
git switch 'github-bot/gh-356'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-356'
git switch 'github-bot/gh-356'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-356'
git switch 'github-bot/gh-356'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-356'
git switch 'main'
git merge --squash 'github-bot/gh-356'
git switch 'main'
git merge --ff-only 'github-bot/gh-356'
git switch 'main'
git merge 'github-bot/gh-356'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.