Skip to content

HLE: report the host's commit headroom before the title starts - #224

Open
WallasSCRIPTS wants to merge 1 commit into
Marvisak:mainfrom
WallasSCRIPTS:hle/startup-commit-headroom
Open

WallasSCRIPTS wants to merge 1 commit into
Marvisak:mainfrom
WallasSCRIPTS:hle/startup-commit-headroom

Conversation

@WallasSCRIPTS

Copy link
Copy Markdown

Completes the startup check #23 asks for, on top of #51's failure message.

What

XMemAllocatePhysicalPages reserves a pagefile-backed section, and map commits its view in one VirtualAlloc. On its first boot the title asks for 99,776 64 KiB pages (6.1 GiB) in one call. When Windows cannot commit that, the mapping fails, the title gets a null back, and it stops on a breakpoint that reads like a title crash.

#51 now names the limit when the commit fails. This adds the check that runs before it:

  • xmem::commit_headroom() reads K32GetPerformanceInfo and returns what Windows can still commit and the commit limit, in bytes.
  • victory run prints both in the startup block, next to the 6.1 GiB the first boot asks for, and adds a second line when the headroom is short of it.
build          unknown (b99f876b...)
mapped at      0x... (preferred 0x...)
title          7952987A, storage ... (1024 MB)
console        Xbox Series X
commit         21.4 GiB available of 44.0 GiB (first boot asks 6.1 GiB)

Since bug reports paste the startup block, every one of them now carries the host's commit state beside the build hash and the console mode.

Verification

Windows 11 x64, AMD RX 7600, Rust 1.98.1 (the pinned toolchain).

  • cargo test --workspace: 265 passed, 0 failed, 4 ignored (264 before this change; the new test is in victory-hle).
  • cargo clippy -p victory-hle -p victory --all-targets: clean.
  • rustfmt --edition 2024 --check on both touched files: clean.

One honest gap: this host has no title dump, so I could not run victory run against the game. The line prints after binding and before the title starts, so seeing it needs a real run; the numbers behind it are covered by commit_headroom_is_within_the_limit.

Note

The PERFORMANCE_INFORMATION initializer in commit is fixed here as clippy asks (field assignment outside Default::default()), since it is the same struct and its warning was the crate's only one. Say the word if you would rather keep that out of this PR.

Issue Marvisak#23 asks for a check at startup: a host whose paging file cannot
take the 99,776 64 KiB pages (6.1 GiB) the title maps in one call on its
first boot stops the title a few seconds in, and until Marvisak#51 only the bare
failure reached the log.

`xmem::commit_headroom` reads the system commit limit and what is left of
it through `K32GetPerformanceInfo`, the call `commit_limit_message` already
makes. `victory run` prints both in the startup block, next to the 6.1 GiB
the first boot asks for, and adds a line when the headroom is short.

Bug reports paste the startup block, so every one of them now carries the
host's commit state beside the build hash and the console mode.

Verified on Windows 11 x64 (AMD RX 7600), Rust 1.98.1: cargo test
--workspace 265 passed, 0 failed, 4 ignored; clippy clean on victory-hle
and victory, --all-targets; rustfmt --edition 2024 clean. The line itself
needs a title to be seen, which this host has no dump for; the numbers
behind it are covered by `commit_headroom_is_within_the_limit`.

The `PERFORMANCE_INFORMATION` initializer in `commit` is fixed here as
clippy asks, since it is the same struct and its warning was the crate's
only one.
AntoninMichelq pushed a commit to AntoninMichelq/VIctory that referenced this pull request Nov 24, 2026
…the title starts) into the integration

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
@jeremygold02

Copy link
Copy Markdown
Contributor

Thanks @WallasSCRIPTS for reporting host commit headroom before the title starts.

I tested commit b87a9682e3462491bed43e99d91fcc51b39ba7a9 with:

cargo test --locked -p victory-hle --lib commit_headroom_is_within_the_limit -- --test-threads=1
cargo check --locked -p victory

The targeted HLE test passed (1 passed, 0 failed; 86 filtered). commit_headroom_is_within_the_limit verifies that the host query returns a nonzero commit limit and that available commit does not exceed that limit. The app compile check succeeded and includes the startup report_commit path.

There is no test here for the printed values or the low-headroom warning branch, and I did not launch a title.

@mercuryVM mercuryVM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested b87a968 on Windows 11, RTX 5070, MSVC: the workspace passes. On the first full run the victory-hle lib binary exited with 0xc0000005. Two re-runs passed (87/87), as did its base commit, and commit_headroom_is_within_the_limit passes on its own. So it's an intermittent crash that this change didn't introduce, but someone should look at it separately.

  • CommitLimit - CommitTotal (in pages) × PageSize is the commit headroom Windows reports, and the PageSize == 0 guard covers a failed query. Printing it next to the 6.1 GiB first-boot mapping (issue #23) turns a confusing title breakpoint into an actionable line.
  • The PERFORMANCE_INFORMATION struct-update hunk is the same as #405, which is already in our fork. It merges cleanly.

No issues found in the change.

AI-assisted (Claude Code).

mercuryVM added a commit to mercuryVM/VIctory that referenced this pull request Nov 24, 2026
…m before the title starts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BaggyALPHA

Copy link
Copy Markdown
Contributor

Live startup verification on b87a968, title v1.0.2.1, using the diagnostics profile and WARP. The commit line printed in the startup block in both Series X and Series S modes.

One mode-specific mismatch showed up. The preflight says “first boot asks 6.1 GiB” in both modes, but the corresponding large physical-page request was 99,776 × 64 KiB (6.1 GiB) in Series X mode and 63,632 × 64 KiB (3.9 GiB) in Series S mode. The cutoff uses the same constant, so Series S can receive the short-headroom warning even when that particular mapping fits.

Could the reference size use the selected console mode, or be labeled explicitly as a Series X example? I'd also keep it clear that this describes one mapping. Overall startup can commit more memory. I verified the normal startup line and did not force the low-headroom branch.

AI-assisted test execution and write-up (OpenAI Codex).

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Needs work. The branch now merges cleanly into main, so this is the full review.

What it does: xmem::commit_headroom() reads K32GetPerformanceInfo and run.rs report_commit() prints the host's available commit next to the size of the title's first large physical mapping, plus a warning when the headroom is smaller. The query and the saturating_sub arithmetic are fine, and a line like this in bug reports is useful.

What needs changing:

  • FIRST_BOOT_BYTES in apps/victory/src/run.rs is the Series X figure only. BaggyALPHA's run on this head found that the same request is 99,776 × 64 KiB (6.1 GiB) in Series X mode but 63,632 × 64 KiB (3.9 GiB) in Series S mode. The printed line and the available < FIRST_BOOT_BYTES cutoff use the same constant, so Series S users can get a "short of it" warning when the mapping would fit. Pick the size from victory_hle::console::current() (which run() sets just before this point), or label the number as the Series X case and don't warn on it in Series S.
  • The README sentence repeats the same 6.1 GiB claim. Make it match, and say it is one mapping, not the title's total commit.

CI: not run on this head.


Generated by Claude Code

github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants