xmem: physical page numbers are never reused; after ~124 GiB of total allocations they overflow the title's 21-bit field #233
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX#233
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@kekonn on GitHub · 2026-11-26 12:12 UTC · original
crates/victory-hle/src/modules/xmem.rs:695:table.next_page += n * FRAMESonly ever increases.XMemFreePhysicalPages(~719-731) removes entries but never makes their numbers available again. The doc at ~713-716 says the title storesnumber >> 4in 21 bits (128 GiB of pages at most).Once the total of all
XMemAllocatePhysicalPagescalls over the run passes about 124 GiB, the title's truncated numbers are unknown to us (XMemMapPhysicalPagesreturns null, ~1226) or alias live low-numbered pages, which means the wrong memory gets mapped.When: the default path, but only with repeated allocate/free cycles. The title allocates about 6.1 GiB at once, and nothing shows it churning, so this is latent.
Sketch: when
next_page + n*FRAMESwould pass1 << 25, search from0x10_0000for a run ofnnumbers not intable.pages. Normal behaviour is unchanged. The minimal version is a one-time warning when the limit is crossed (~5 lines).(Checked, and not worth changing: stale
LOW_RESERVATIONSentries only matter withVICTORY_PORT_CONSTANTS=1, where they cannot be observed; stalePhysical.holesentries only cost a fast path.)Upstream: no open PR changes this.
Generated by Claude Code
github-bot referenced this issue2026-11-26 16:16:48 +00:00