HLE xmem: avoid recommitting pages when mapping GPU aliases #809

Open
github-bot wants to merge 1 commit from github-bot/gh-809 into main AGit
Owner

@⁠Chezzuss on GitHub · 2026-11-25 08:27 UTC · original
Chezzuss:codex/fxceless-skip-alias-recommit → main · +52 −8 · 1 files · 1 commits · open

What

When copying GPU page mappings, map_alias finds the source in a live physical view. Mapping another view of the same section page can use its existing commitment, so the alias path skips the redundant VirtualAlloc(MEM_COMMIT). The initial mapping and the existing partial-unmap restoration path still commit as before.

Tested

Windows 11 x64, build 26340. All 12 XMem tests passed with cargo test --locked --profile diag -p victory-hle modules::xmem::tests -- --test-threads=1. The regression test checks the commit call count, the alias's MEM_COMMIT state, and writes shared through both views. This branch was tested with synthetic data. Its effect on frame rate has not been isolated.

AI-assisted.

**@⁠Chezzuss** on GitHub · 2026-11-25 08:27 UTC · [original](https://github.com/fxceless/victory-fork/pull/809) `Chezzuss:codex/fxceless-skip-alias-recommit` → `main` · +52 −8 · 1 files · 1 commits · open ## What When copying GPU page mappings, `map_alias` finds the source in a live physical view. Mapping another view of the same section page can use its existing commitment, so the alias path skips the redundant `VirtualAlloc(MEM_COMMIT)`. The initial mapping and the existing partial-unmap restoration path still commit as before. ## Tested Windows 11 x64, build 26340. All 12 XMem tests passed with `cargo test --locked --profile diag -p victory-hle modules::xmem::tests -- --test-threads=1`. The regression test checks the commit call count, the alias's `MEM_COMMIT` state, and writes shared through both views. This branch was tested with synthetic data. Its effect on frame rate has not been isolated. AI-assisted.
The source view already committed the section page. First mappings and restored fragments retain the existing commit path. The XMem tests verify commitment, shared writes, and the number of calls to commit. Tested with the Windows XMem suite. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:51:37 +00:00
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-25 09:54 UTC · original

Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head e40ef63 into main 9376fd6 in a throwaway tree (no conflict). cargo clippy --workspace --all-targets --locked -- -D warnings fails, with the same two errors as main itself on this machine (function placed_filler_twins is never used, field depth_written is never read, victory-gpu): this PR adds none and removes none. cargo test --workspace --locked: 540 passed, 0 failed, 10 ignored, two runs (main alone: 540 passed). The title was not run, so this says nothing about in-game effect. No game data.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-25 09:54 UTC · [original](https://github.com/fxceless/victory-fork/pull/809#issuecomment-7158952482) Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head `e40ef63` into `main` `9376fd6` in a throwaway tree (no conflict). `cargo clippy --workspace --all-targets --locked -- -D warnings` fails, with the same two errors as `main` itself on this machine (`function placed_filler_twins is never used`, `field depth_written is never read`, `victory-gpu`): this PR adds none and removes none. `cargo test --workspace --locked`: 540 passed, 0 failed, 10 ignored, two runs (`main` alone: 540 passed). The title was not run, so this says nothing about in-game effect. No game data. AI-assisted (Claude Code); no game data.
This pull request has changes conflicting with the target branch.
  • crates/victory-hle/src/modules/xmem.rs
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.
git fetch -u origin '+refs/pull/809/head:github-bot/gh-809'
git switch 'github-bot/gh-809'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-809'
git switch 'github-bot/gh-809'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-809'
git switch 'github-bot/gh-809'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-809'
git switch 'main'
git merge --squash 'github-bot/gh-809'
git switch 'main'
git merge --ff-only 'github-bot/gh-809'
git switch 'main'
git merge 'github-bot/gh-809'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.