runtime: add a source-built tools-memory availability fixture #889
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/896"
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 Holastor on 2026-11-23T16:20:28Z.
Refs #870.
Overview
Following the binding of default allocator (#879) and physical pages (#880, #887), startup preflight mapping reaches
xmem.dll!XMemIsToolsMemAvailable.Per community evidence and the maintainer's note in #870, this PR provides an independent, source-built caller and controlled recording-provider fixture testing the contract without changing the production XMem shim:
cpu_tools_mem_caller.exe(tests/cpu/tools_mem_caller.asm): tiny standalone MASM executable that importsXMemIsToolsMemAvailableby name fromxmem.dll, executes repeated calls to verify consistency, and branches cleanly on theBOOLresult without stack or register corruption.cpu_tools_mem_provider/cpu_tools_mem_provider_devkit(tests/cpu/tools_mem_provider.cpp/.def): controlled recording provider providingXMemIsToolsMemAvailableunder both modes:FALSE(0), caller takes the title fallback path (exit code42), and provider records exactly 2 calls.TRUE(1), caller takes the devkit path (exit code84), and provider records exactly 2 calls.pe_mapcomparison and negative controls (tests/cpu/tools_mem_check.py):pe_map(custom in-process loader) produce identical exit codes across both modes.xmem.dllis missing, returningSTATUS["unresolved"]with diagnosticunresolved import xmem.dll!XMemIsToolsMemAvailable.Verification
Environment: Windows 11 x64, MSVC 19.51, CMake/Ninja, Python 3.11 (
out/pe-env).Dev preset
Output:
Release preset
Output:
Documentation & pure-Python checks
All passed:
docs_links_check.py: Checked 13 Markdown files and 180 links.bidi_controls_check.py: Checked 719 tracked source, script and build/CI files: no bidirectional controls.form_coverage_check.py: form coverage checks passed.git diff --check: 0 issues.Checklist
docs/experiments.mdwith the new capability and reproduction commands.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T16:31:58Z.
I reviewed
8e85283balongside the #874 fixture. Please reuse the existing source-built EXE finish wrapper: this fixture still returns straight from the native /ENTRY, the same shape that hung under the Windows loader in #891. Preserve the mapped return and use the live-worker control for the native path. The two call counters are currently read only from the mapped process, so please label them as mapped counts unless the native subprocess records its own. The two providers establish the caller's behavior with controlled FALSE and TRUE returns. Please scope the documentation to those results until there is separate evidence for actual console or production-shim behavior.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T16:41:43Z.
The shared candidate is now
1a5148e. Thanks to Holastor for the repeated-query check and to triggered02 for the independent per-process record-and-compare evidence in #900. The same source-built EXE now uses the shared startup wrapper in both modes. Windows native launch exits with a live worker and pe_map returns to its host. The controlled providers produce exit 42 or 84 with two matching queries checked inside each process. With the trace export still supplied, withholding just XMemIsToolsMemAvailable fails at import resolution before entry. Independently passed cpu_native_tools_mem in Debug and Release on Windows x64. The production shim is unchanged.