Coalesce separately unmapped pages in XMemMapPhysicalPages #4761
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4761
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4760"
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?
@Saikava on GitHub · 2026-12-01 05:47 UTC · original
Saikava:fix/xmem-contiguous-remap→main· +41 −1 · 1 files · 1 commits · openWhat it changes
When two adjacent physical pages are unmapped one at a time, Windows leaves a separate placeholder for each page. Mapping the consecutive pages again in one call asks Windows to replace both placeholders with one section view. The call returns null even though both page IDs and the destination are valid.
If a multi-page run starts at a known placeholder shorter than the run,
map_pagesnow asks the existingone_placeholderhelper to join an exact cover before placing the view. The regression test gives each page a distinct byte and checks both remapped pages and a third page that stayed mapped.How it was tested
Windows 11 x64 build 26300, Rust 1.98.1 MSVC. The test uses synthetic pages and the public XMem calls. No game session or FPS measurement was used.
cargo test --locked -p victory-hle --lib modules::xmem::tests::separately_unmapped_pages_can_be_mapped_as_one_run -- --exactwithVICTORY_LAZY_VIEWS=0and=1, withVICTORY_SOFT_VIEWS=0in both. On5fabb46ewith only the test added, both runs returned null at the two-page remap. One3c6dbd7, both runs passed and all three bytes matched.RUST_TEST_THREADS=1 cargo test --locked -p victory-hlepassed on the patch with 470 unit tests and 2 integration tests passing, and 13 unit tests ignored.cargo xtask policy --stagedpassed.cargo clippy --locked -p victory-hle --all-targets -- -D warningsreported the same five findings invictory-gpuon both revisions. Tracked by #4708.Checked for overlap
xmem.rsamong the 934 open PRs at the time of review. No matching fix found. Related work includes Wine mappings in #2455, alias-source locking in #4143 and unchanged mapping batches in #4607.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.