Skip to content

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

Closed
WallasSCRIPTS wants to merge 1 commit into
Marvisak:mainfrom
WallasSCRIPTS:hle/commit-limit-diagnostics
Closed

WallasSCRIPTS wants to merge 1 commit into
Marvisak:mainfrom
WallasSCRIPTS:hle/commit-limit-diagnostics

Conversation

@WallasSCRIPTS

Copy link
Copy Markdown

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.

xmem maps the title's 6.5 GiB physical-page section and commits the whole
view in one VirtualAlloc. When the paging file cannot cover it the only
trace was a WARN, after which the title stops on its own breakpoint with no
hint that the host ran out of commit.

Read the system commit charge with K32GetPerformanceInfo, print it at the
start of `victory run`, warn below 7 GiB of headroom, and on a failed commit
log the size asked for, the limit and charge, the shortfall, and the paging
file change that fixes it. Document the requirement in the README.

Two tests cover the report and the charge reading. `cargo test -p victory-hle`
has one pre-existing environment failure (display SDR deferrals, 0x80070032)
unrelated to this change; clippy is clean and the diag build links.
@DaviTostes

Copy link
Copy Markdown

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

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

@WallasSCRIPTS

Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants