tests: record the XMemIsToolsMemAvailable caller's branch #911
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!911
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/911/head"
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?
@rasptum on GitHub · 2026-11-23 16:52 UTC · original
rasptum:tests/xmem-tools-mem-caller→main· +341 −0 · 7 files · 1 commits · closed without mergingRefs #870
Fixture-only slice for
xmem.dll!XMemIsToolsMemAvailable, per R0Y00's 16:04Z note on #870. It adds no production XMem edit:src/xmem_shim.*is untouched and stays behind #880/#892.What it adds
tests/cpu/tools_mem_caller.asm: a source-built EXE without a C runtime. It importsXMemIsToolsMemAvailableby name fromxmem.dlland starts throughexe_startup.asm. It calls three times, requires the same answer (0 or 1) each time, then records its branch as the exit code:0x7100for FALSE (continue without tools memory),0x7101for TRUE,0xF00 + stepon a failed step.tests/cpu/tools_mem_provider.cpp+.def: a test-only recording provider built asxmem.dllin its own build folder. It is not the desktop shim.TOOLS_MEM_RESULT=0,1orflippicks the answer, and every call appendsquery <n> <result>toTOOLS_MEM_RECORD. If unconfigured, it returns 2.tools_mem_provider_missing.defbuilds the same provider without the export.tests/cpu/tools_mem_caller_check.py, CTestcpu_native_xmem_tools_mem_caller: checks the import table withpefile, then runs each case under the Windows loader and underpe_map_image+pe_map_runin a child process.docs/experiments.mdsubsection.Expected vs observed
The PE import table lists
xmem.dll!XMemIsToolsMemAvailableby name, not by ordinal. The mapped resolver requests exactly that name andcpu_exe_io.dll!finish_exe.pe_map0x71000x7100query 1 0,query 2 0,query 3 00x71010x7101query 1 1,query 2 1,query 3 10xf020xf02query 1 0,query 2 10xf010xf01query 1 20xc0000139unresolved import xmem.dll!XMemIsToolsMemAvailable, not startedSwapping the outcome changes the recorded branch under both loaders (
0x7100vs0x7101). Repeated FALSE calls return the same value and the provider's call count matches the record. Observed as expected in dev and release. No capability skips.Mutation (one-off, not in CI): with the caller's comparison after the second call removed, the test failed. Both loaders exited
0x7100instead of0xf02for the alternating provider.Scope and hypotheses
f89e410,crates/compat/xmem/src/stats.rs:330-355).BOOL XMemIsToolsMemAvailable(void)is an assumption. The caller passes no arguments.xmem.dllstill lacks this export.Environment and commands
Commit
270359e, based onorigin/main3dfe3a9. Windows 10 Pro 10.0.19045.6466, MSVC 19.44.35207 x64 (VS 2022 Build Tools), CMake/Ninja. Source-built inputs only.The same three commands with
release: both 1/1 passed.tests/form_coverage_check.py,tests/docs_links_check.pyandtests/bidi_controls_check.pypassed.Five unrelated commits (CPU fuzz tooling, an LDS shader lowering) merged into
mainduring the final retest.git merge-treewith the currentorigin/mainis clean, and none of those commits touch these files.🤖 Generated with Claude Code
@rasptum on GitHub · 2026-11-23 16:56 UTC · original
Closing as a duplicate. This slice was released on #870 and R0Y00 named #896 the single landing PR for the XMemIsToolsMemAvailable fixture. This PR was opened by mistake after that decision. Sorry for the noise. If anything here is useful to #896 (for example the repeated-call or swapped-outcome controls), happy to pass it along there.
AI-assisted (Claude Code).
Pull request closed