HLE: report the Windows commit limit before a title's page pool fails #64

Closed
WallasSCRIPTS wants to merge 1 commit from upstream-pr/64 into main
WallasSCRIPTS commented 2026-11-24 00:03:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by WallasSCRIPTS on 2026-11-24T00:03:19Z.


Relates to #23.

What

xmem maps the title's 6.5 GiB pagefile-backed section and commits the
whole view with one VirtualAlloc(MEM_COMMIT). When the Windows paging file
cannot cover it, commit() logged only a WARN; the title then stops on its
own 0x80000003 breakpoint, which reads like a crash rather than a host
limit.

  • Read the system commit charge with K32GetPerformanceInfo.
  • victory run prints the available commit and the limit, and warns below
    7 GiB of headroom before loading the title.
  • A failed commit logs the size asked for, the limit, the current charge,
    the shortfall, and the paging-file change that fixes it.
  • README states the commit requirement and the known-good fixed 32 GB page
    file.

Verification

  • cargo test -p victory-hle: 82 passed, 1 failed. The failure is
    modules::display::tests::sdr_and_display_deferrals (0x80070032),
    reproduced on the unmodified checkout too — no display device here.
  • cargo clippy -p victory-hle -p victory --all-targets: clean.
  • cargo build --profile diag -p victory --features diagnostics: links;
    victory.exe --help runs.
  • Two new tests cover the failure message and the charge reading; both pass.

No game data and no small-pagefile host here, so the warning path is
verified by the API-reading test, not by a live run that hits error 1455.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6571462743 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/64). Originally posted by [WallasSCRIPTS](https://github.com/WallasSCRIPTS) on 2026-11-24T00:03:19Z. --- Relates to #23. ## What `xmem` maps the title's 6.5 GiB pagefile-backed section and commits the whole view with one `VirtualAlloc(MEM_COMMIT)`. When the Windows paging file cannot cover it, `commit()` logged only a WARN; the title then stops on its own `0x80000003` breakpoint, which reads like a crash rather than a host limit. - Read the system commit charge with `K32GetPerformanceInfo`. - `victory run` prints the available commit and the limit, and warns below 7 GiB of headroom before loading the title. - A failed commit logs the size asked for, the limit, the current charge, the shortfall, and the paging-file change that fixes it. - README states the commit requirement and the known-good fixed 32 GB page file. ## Verification - `cargo test -p victory-hle`: 82 passed, 1 failed. The failure is `modules::display::tests::sdr_and_display_deferrals` (0x80070032), reproduced on the unmodified checkout too — no display device here. - `cargo clippy -p victory-hle -p victory --all-targets`: clean. - `cargo build --profile diag -p victory --features diagnostics`: links; `victory.exe --help` runs. - Two new tests cover the failure message and the charge reading; both pass. No game data and no small-pagefile host here, so the warning path is verified by the API-reading test, not by a live run that hits error 1455.
upstream-sync closed this pull request 2026-11-24 06:51:08 +00:00
DaviTostes commented 2026-11-24 06:54:35 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T00:09:08Z.


Tested 6bf8032 stacked on #39 on Arch Linux x86_64, rustc 1.98.1: pass (no regression only).

  • cargo test --workspace: 155 passed, 0 failed, 3 ignored; merge with #39 clean.
  • Scope note: the commit-limit probe and its message are Windows-specific; the Linux run exercises the portable HLE code around it.
  • Overlap note: #51 touches the same xmem.rs area with the same goal (report the commit limit before the title's page pool fails); the two should be merged into one shape.
  • No game data used.

AI-assisted (DeepSeek V4.1 Flash coding agent).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7117758883 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/64#issuecomment-7117758883). Originally posted by [DaviTostes](https://github.com/DaviTostes) on 2026-11-24T00:09:08Z. --- Tested `6bf8032` stacked on **#39** on **Arch Linux x86_64, rustc 1.98.1**: **pass (no regression only)**. - `cargo test --workspace`: **155 passed, 0 failed, 3 ignored**; merge with #39 clean. - Scope note: the commit-limit probe and its message are Windows-specific; the Linux run exercises the portable HLE code around it. - Overlap note: **#51** touches the same `xmem.rs` area with the same goal (report the commit limit before the title's page pool fails); the two should be merged into one shape. - No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).
WallasSCRIPTS commented 2026-11-24 06:54:36 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by WallasSCRIPTS on 2026-11-24T00:09:57Z.


Closing this in favour of #51, which covers the same failure: the requested
size, the system commit charge and limit, paging-file guidance, and the
README requirement — and also appends the report to crashes.log, which
this PR does not. One PR per issue is enough.

The one piece here that #51 does not have is a startup preflight: victory run printing available commit and the limit, warning below 7 GiB of
headroom before the title loads. I have left that as a suggestion on #51;
the branch hle/commit-limit-diagnostics on my fork keeps the code if it
is wanted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7117774078 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/64#issuecomment-7117774078). Originally posted by [WallasSCRIPTS](https://github.com/WallasSCRIPTS) on 2026-11-24T00:09:57Z. --- Closing this in favour of #51, which covers the same failure: the requested size, the system commit charge and limit, paging-file guidance, and the README requirement — and also appends the report to `crashes.log`, which this PR does not. One PR per issue is enough. The one piece here that #51 does not have is a startup preflight: `victory run` printing available commit and the limit, warning below 7 GiB of headroom before the title loads. I have left that as a suggestion on #51; the branch `hle/commit-limit-diagnostics` on my fork keeps the code if it is wanted.

Pull request closed

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
Marvisak/VIctory!64
No description provided.