runtime: test aligned committed CPU memory on Windows #967
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/974"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-23T19:23:56Z.
Change
Refs #870. Add the aligned committed CPU memory fixture requested in the startup thread.
The fixture reserves three ordinary Windows pages at each guest alignment, 64 KiB and 2 MiB. It commits a non-page-multiple request, checks the exact commit and reserved tail with VirtualQuery, and verifies every committed byte before and after a cross-page write. It then checks that the allocation is released.
Three refusal cases cover rounding overflow, unsupported protection, and a real Win32 commit beyond the reservation. Each preserves the two live pages and the reserved tail. The host failure reaches the caller as ERROR_INVALID_ADDRESS (487).
Verification
02ebdbeon Windows 10 22H2 (19045.6456), MSVC 19.44.35230 x64, Windows SDK 10.0.26100. Both presets passed 5/5 with no skips. Each alignment committed 8,192 bytes for a 4,101-byte request, checked 8,192 zero bytes and a 16-byte cross-page pattern, and released the reservation.The source-built mutation controls failed when the fixture allowed the unsupported protection, replaced error 487 with 87, or skipped the write at byte 4,096. The documentation and diff checks passed.
Evidence and follow-up
Original MIT-licensed source in
tests/xmem_committed_memory_check.cpp. The synthetic fixture checks CPU backing through the public Win32 APIs. Its protection allowlist is fixture policy. Reserve-only XMem calls and GPU registration remain with #888 and #874. See aligned committed CPU memory for an isolated reproduction.Checklist
AI-assisted (Codex).
Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-23T19:43:41Z.
Independent run of
02ebdbeon Windows 11 (Windows 10 was the only OS so far): Windows 11 Pro 26100, Intel Core i7-6820HQ, MSVC 19.52,devpreset. The head merges cleanly withmainat23d2e93(git merge-tree).The fixture passes with the same values at both alignments:
The wider selection
^(xmem_|era_heap|desktop_memory_query)passes 22/22, with no skips. I did not run thereleasepreset here.AI-assisted (Claude Code).