runtime: reserve XMem address space as mappable placeholders #938

Merged
R0Y00 merged 1 commit from upstream-pr/945 into main 2026-11-23 18:27:22 +00:00
R0Y00 commented 2026-11-23 18:13:22 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T18:13:22Z.


Refs #870 and #888. This applies the reserve-only profile and source-built validation approach proposed by @descent81 in #888 to the shared backing that landed in #934.

Reserve Windows placeholders without committing memory. Split a page from an owned reservation only when mapping needs it, and coalesce the range after the last view is removed. Preserve the page's contents across unmap/remap and leave caller-provided standalone placeholders supported.

The Windows fixture covers both reservation sizes, maps an interior page, checks the original value after remapping, releases the full range and recreates the same range at the same address. The verified profile covers only the two reserve-only shapes.

ctest --preset release --no-tests=error -R '^xmem_shim_(mapped_pages|physical_pages|exports|tools_memory)$' --output-on-failure

Windows x64, MSVC 19.51, 4/4 passed.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6565825831 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/945). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T18:13:22Z. --- Refs #870 and #888. This applies the reserve-only profile and source-built validation approach proposed by @descent81 in #888 to the shared backing that landed in #934. Reserve Windows placeholders without committing memory. Split a page from an owned reservation only when mapping needs it, and coalesce the range after the last view is removed. Preserve the page's contents across unmap/remap and leave caller-provided standalone placeholders supported. The Windows fixture covers both reservation sizes, maps an interior page, checks the original value after remapping, releases the full range and recreates the same range at the same address. The verified profile covers only the two reserve-only shapes. ```powershell ctest --preset release --no-tests=error -R '^xmem_shim_(mapped_pages|physical_pages|exports|tools_memory)$' --output-on-failure ``` Windows x64, MSVC 19.51, 4/4 passed.
upstream-sync closed this pull request 2026-11-24 06:45:31 +00:00
legacy-code-archaeologist commented 2026-11-24 06:49:27 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-23T18:16:38Z.


Independent run of 2e236d9 on a second machine: Windows 11 Pro 26100, Intel Core i7-6820HQ, MSVC 19.52, dev preset. The head merges cleanly with main at 1c13def (git merge-tree).

ctest --preset dev --no-tests=error -R '^xmem_shim_(mapped_pages|physical_pages|exports|tools_memory)$' --output-on-failure

Result: 4/4 passed. xmem_shim_mapped_pages reports Aliased writes, scatter order, remap, rollback, and grant lifetime agree. The wider ^xmem_ selection passes 12/12, with no skips.

I did not run the release preset here.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7109922676 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/945#issuecomment-7109922676). Originally posted by [legacy-code-archaeologist](https://github.com/legacy-code-archaeologist) on 2026-11-23T18:16:38Z. --- Independent run of `2e236d9` on a second machine: Windows 11 Pro 26100, Intel Core i7-6820HQ, MSVC 19.52, `dev` preset. The head merges cleanly with `main` at `1c13def` (`git merge-tree`). ```powershell ctest --preset dev --no-tests=error -R '^xmem_shim_(mapped_pages|physical_pages|exports|tools_memory)$' --output-on-failure ``` Result: 4/4 passed. `xmem_shim_mapped_pages` reports `Aliased writes, scatter order, remap, rollback, and grant lifetime agree`. The wider `^xmem_` selection passes 12/12, with no skips. I did not run the `release` preset here. AI-assisted (Claude Code).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!938
No description provided.