Test XMem mappings across caller-split placeholders #191

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

@⁠feanorsun on GitHub · 2026-11-26 11:03 UTC · original
feanorsun:test/xmem-caller-split-placeholders → main · +73 −0 · 1 files · 1 commits · open

Refs #38

physical_pages_map_alias_and_unmap first maps a three-page view, then removes its middle page. The mapper splits placeholders as needed. This test changes the order: the caller splits a single 320 KiB reservation into five adjacent 64 KiB placeholders before the first map. It checks all four VirtualFree split results and queries each placeholder's allocation base, size and reserved state.

The test maps one page from the same five-page physical allocation into each slice through XMemMapPhysicalPages. It checks each returned address, verifies the view is committed and read-write, and writes a different marker to each slice. Later maps preserve earlier markers and the boundaries of slices still reserved. A null page array unmaps the middle slice. It returns to MEM_RESERVE while the other four remain mapped with their original values. The test then releases its views, placeholders and physical pages.

The current implementation passes. This PR adds regression coverage for ordinary PAGE_READWRITE views only. It changes no production code.

Windows verification

Each full test name was listed first using -- --exact --list and returned one test. The commands below used the local Cargo cache and CPU memory APIs. The new test passed twice in separate processes, and the two neighboring tests each passed once (4 executions, 0 failures).

cargo test --offline --locked -j 1 -p victory-hle --lib modules::xmem::tests::physical_pages_map_caller_split_placeholders -- --exact --test-threads=1
cargo test --offline --locked -j 1 -p victory-hle --lib modules::xmem::tests::physical_pages_map_alias_and_unmap -- --exact --test-threads=1
cargo test --offline --locked -j 1 -p victory-hle --lib modules::xmem::tests::pages_mapped_again_hold_what_they_held -- --exact --test-threads=1
**@⁠feanorsun** on GitHub · 2026-11-26 11:03 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/191) `feanorsun:test/xmem-caller-split-placeholders` → `main` · +73 −0 · 1 files · 1 commits · open Refs #38 `physical_pages_map_alias_and_unmap` first maps a three-page view, then removes its middle page. The mapper splits placeholders as needed. This test changes the order: the caller splits a single 320 KiB reservation into five adjacent 64 KiB placeholders **before the first map**. It checks all four `VirtualFree` split results and queries each placeholder's allocation base, size and reserved state. The test maps one page from the same five-page physical allocation into each slice through `XMemMapPhysicalPages`. It checks each returned address, verifies the view is committed and read-write, and writes a different marker to each slice. Later maps preserve earlier markers and the boundaries of slices still reserved. A null page array unmaps the middle slice. It returns to `MEM_RESERVE` while the other four remain mapped with their original values. The test then releases its views, placeholders and physical pages. The current implementation passes. This PR adds regression coverage for ordinary `PAGE_READWRITE` views only. It changes no production code. ## Windows verification Each full test name was listed first using `-- --exact --list` and returned one test. The commands below used the local Cargo cache and CPU memory APIs. The new test passed twice in separate processes, and the two neighboring tests each passed once (4 executions, 0 failures). ```text cargo test --offline --locked -j 1 -p victory-hle --lib modules::xmem::tests::physical_pages_map_caller_split_placeholders -- --exact --test-threads=1 cargo test --offline --locked -j 1 -p victory-hle --lib modules::xmem::tests::physical_pages_map_alias_and_unmap -- --exact --test-threads=1 cargo test --offline --locked -j 1 -p victory-hle --lib modules::xmem::tests::pages_mapped_again_hold_what_they_held -- --exact --test-threads=1 ```
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:22:09 +00:00
Author
Owner

@⁠kilolimaVI on GitHub · 2026-11-26 19:13 UTC · original

Tested locally on Windows 11 (Ryzen 7 8845HS / Radeon 780M, pinned toolchain 1.98.1):

  • cargo test -p victory-hle --lib xmem: all pass, including the new physical_pages_map_caller_split_placeholders
  • Whole victory-hle lib suite 10 times in a row (parallel, default threads): 0/10 failures, so no interference with the other tests that map memory

Branch is 14 commits behind main; tested as-is.

**@⁠kilolimaVI** on GitHub · 2026-11-26 19:13 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/191#issuecomment-7201338594) Tested locally on Windows 11 (Ryzen 7 8845HS / Radeon 780M, pinned toolchain 1.98.1): - `cargo test -p victory-hle --lib xmem`: all pass, including the new `physical_pages_map_caller_split_placeholders` - Whole `victory-hle` lib suite 10 times in a row (parallel, default threads): 0/10 failures, so no interference with the other tests that map memory Branch is 14 commits behind main; tested as-is.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/191/head:github-bot/gh-191'
git switch 'github-bot/gh-191'

Merge

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