xmem: commit physical pages in pieces, and report the real count #561
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!561
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-561"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@JoshRob297 on GitHub · 2026-11-24 04:56 UTC · original
JoshRob297:JoshRob297/aporte-xmem-fisicas→main· +208 −20 · 2 files · 1 commits · openAddresses #23.
A title that asks for a large block of physical pages fails outright when the host cannot commit all of it at once. The console ABI does not promise one contiguous commitment: the request carries a page count, the title compares what it got, and a host can commit what it allows in pieces and report the real count instead of failing the whole call.
What this changes (
crates/victory-hle/src/modules/xmem.rs)Verification
That is a type-check against the target this project pins in
rust-toolchain.toml, not a run: the change is in the physical-page path and has not been exercised against a title.What it does not fix
If the title requires the full reservation contiguously — as opposed to asking for a count and comparing — this does not help, and the way to tell is to log the count the title asks for against the count the host can commit. I have not measured that on the failing machine.
Provenance
The measurement this rests on comes from static analysis of the retail executable's allocation call sites (flag word, 64 KiB unit, and one call site that compares the returned page count), not from the source of this project. No game data is included here: no paths, no container names, no hashes.
@jeremygold02 on GitHub · 2026-11-24 17:52 UTC · original
Verification ran against PR head
3c02d8cf89470f487bab9c3a207da75084aca8b2; the PR was open at refresh.cargo test -j 1 -p victory-hle xmem::tests: 6 passed, 1 failed:modules::xmem::tests::allocated_physical_pages_are_committed.cargo test -j 1 -p victory-hle xmem::tests -- --test-threads=1: the same 6 passed and 1 failed, so the failure reproduces without parallel test interference.The failure is at
xmem.rs:1112:VirtualFree(reserve, 0, MEM_RELEASE)returns 0. The test maps pages into the reservation, then callsXMemFreePhysicalPages, which removes the page-number records but does not unmap the view.XMemMapPhysicalPageswith null pages is the unmap path; the test needs to unmap before releasing the reservation.commits_across_a_piece_boundaryand the other five xmem tests pass. The focused tests cover the 64-MiB commit boundary and a 4-page allocation, but do not simulate host commit-limit exhaustion or a short allocation.This verification was AI-assisted.
@Marvisak on GitHub · 2026-11-25 00:25 UTC · original
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(ac2525d). Conflicting files:crates/victory-hle/src/modules/xmem.rs.The content has not been reviewed yet; it will be once the branch is rebased onto
main.Generated by Claude Code
@jeremygold02 on GitHub · 2026-11-25 03:13 UTC · original · edited 2026-11-25 03:22 UTC
Triage verdict — Rebase and verify short allocations (
3c02d8c)Evidence
3c02d8cis charging pages at allocation time and returning a short count.SEC_COMMITunder Wine to avoid repeated wineserver scans.Checks and limits
940d32f,cargo test -p victory-hle commit_limit_report_includes_request_and_system_commitpassed with synthetic inputs. That verifies the diagnostic text; it does not force a host allocation failure.Next step
commitconflict, and test a deterministic partial commit before calling it ready. The acceptance case should assert the returned count, which page IDs can still be mapped, and what happens when nothing can be committed.SEC_RESERVEand piece commits.This verification was AI-assisted.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.