runtime: record both XMemIsToolsMemAvailable caller outcomes #900

Closed
github-bot wants to merge 1 commit from gh-pr/900/head into gh-pr/900/base
Owner

@⁠triggered02 on GitHub · 2026-11-23 16:29 UTC · original
triggered02:runtime/xmem-tools-caller → main · +181 −0 · 6 files · 1 commits · closed without merging

Refs #870. Production XMem behavior stays behind #880/#892.

Change

Adds a test-only recording provider and a source-built MASM caller for XMemIsToolsMemAvailable:

  • two provider builds return TRUE (tools partition) or FALSE (desktop without a tools partition);
  • the caller imports the name, records the BOOL outcome, takes the tools or fallback path, and calls xmem_tools_note/xmem_tools_note_value/xmem_tools_calls;
  • the exit code records the outcome, path and call count: 0x7b11 for TRUE and 0x7a21 for FALSE;
  • each caller runs under the Windows loader and under pe_map, with the recording provider reset between mapped runs;
  • a withheld provider stops the mapping before entry (the first import in table order is xmem_tools_note);
  • no change to src/xmem_shim or production XMem behavior.

Verification

Windows 11 Pro 26200, MSVC 19.52, CMake/Ninja, Ryzen 5 5500. CPU-only; no adapter or debug layer.

ctest --preset dev --no-tests=error -R '^cpu_native_xmem_tools$' -V

Dev: tools partition native 0x7b11, mapped 0x7b11; desktop without a tools partition native 0x7a21, mapped 0x7a21; the withheld-provider control stops before entry. 0.70 s.

ctest --preset release --no-tests=error -R '^cpu_native_xmem_tools$' -V

Release: same results, 0.49 s.

python -B tests/docs_links_check.py (13 files, 178 links), python -B tests/bidi_controls_check.py (722 files) and git diff --check pass.

Evidence and follow-up

  • The fixture makes the desktop-without-a-tools-partition case explicit through the FALSE provider.
  • It does not establish the console ordering or show that the real startup caller can continue on FALSE. The cited public reimplementation checks one console mode before its partition lookup; this fixture records only what the synthetic caller does under both outcomes. That question remains open.
  • The recording provider and caller are source-built and MIT. No game files, dumps, distribution links or secrets.
  • Production behavior stays behind #880/#892; this PR is test-only.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted.

**@⁠triggered02** on GitHub · 2026-11-23 16:29 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/900) `triggered02:runtime/xmem-tools-caller` → `main` · +181 −0 · 6 files · 1 commits · closed without merging Refs #870. Production XMem behavior stays behind #880/#892. ## Change Adds a test-only recording provider and a source-built MASM caller for `XMemIsToolsMemAvailable`: - two provider builds return TRUE (tools partition) or FALSE (desktop without a tools partition); - the caller imports the name, records the BOOL outcome, takes the tools or fallback path, and calls `xmem_tools_note`/`xmem_tools_note_value`/`xmem_tools_calls`; - the exit code records the outcome, path and call count: `0x7b11` for TRUE and `0x7a21` for FALSE; - each caller runs under the Windows loader and under `pe_map`, with the recording provider reset between mapped runs; - a withheld provider stops the mapping before entry (the first import in table order is `xmem_tools_note`); - no change to `src/xmem_shim` or production XMem behavior. ## Verification Windows 11 Pro 26200, MSVC 19.52, CMake/Ninja, Ryzen 5 5500. CPU-only; no adapter or debug layer. ```powershell ctest --preset dev --no-tests=error -R '^cpu_native_xmem_tools$' -V ``` Dev: tools partition native `0x7b11`, mapped `0x7b11`; desktop without a tools partition native `0x7a21`, mapped `0x7a21`; the withheld-provider control stops before entry. 0.70 s. ```powershell ctest --preset release --no-tests=error -R '^cpu_native_xmem_tools$' -V ``` Release: same results, 0.49 s. `python -B tests/docs_links_check.py` (13 files, 178 links), `python -B tests/bidi_controls_check.py` (722 files) and `git diff --check` pass. ## Evidence and follow-up - The fixture makes the desktop-without-a-tools-partition case explicit through the FALSE provider. - It does not establish the console ordering or show that the real startup caller can continue on FALSE. The cited [public reimplementation](https://github.com/omonkeyz/xbox-emulator/blob/f89e4106fe8a1728515afa34ceb5097132cadcda/crates/compat/xmem/src/stats.rs) checks one console mode before its partition lookup; this fixture records only what the synthetic caller does under both outcomes. That question remains open. - The recording provider and caller are source-built and MIT. No game files, dumps, distribution links or secrets. - Production behavior stays behind #880/#892; this PR is test-only. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted.
Add source-built TRUE and FALSE recording providers and a caller that imports the name, records the outcome and next path, and compares native and pe_map. Refs #870.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:27:00 +00:00
github-bot closed this pull request 2026-11-26 22:27:00 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-23 16:29 UTC · original · edited 2026-11-23 16:30 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T16:30:56.356556Z 13a6cdd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-23 16:29 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/900#issuecomment-7107207428) · edited 2026-11-23 16:30 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"13a6cdd73f83f992bcb73880953c2fc4fceee2b2","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-23T16:30:56.356556Z">2026-11-23T16:30:56.356556Z</relative-time> | `13a6cdd` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
Author
Owner

@⁠triggered02 on GitHub · 2026-11-23 16:29 UTC · original

I opened this before seeing rasptum's 16:23Z claim on #870; it is the same scope (source-built caller, recording provider, TRUE/FALSE outcomes, native vs pe_map, missing-export control). Rasptum owns the slice, so I am closing this to avoid duplicate review. The branch runtime/xmem-tools-caller and the tested fixture stay available for reuse/credit. No production xmem edit is included.

**@⁠triggered02** on GitHub · 2026-11-23 16:29 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/900#issuecomment-7107220636) I opened this before seeing rasptum's 16:23Z claim on #870; it is the same scope (source-built caller, recording provider, TRUE/FALSE outcomes, native vs pe_map, missing-export control). Rasptum owns the slice, so I am closing this to avoid duplicate review. The branch `runtime/xmem-tools-caller` and the tested fixture stay available for reuse/credit. No production xmem edit is included.
Author
Owner

@⁠triggered02 on GitHub · 2026-11-23 16:30 UTC · original

Reopened per rasptum's release of the slice. Thanks for the crossed-timing note. The fixture and branch are unchanged; I'll respond to review here.

**@⁠triggered02** on GitHub · 2026-11-23 16:30 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/900#issuecomment-7107253699) Reopened per rasptum's release of the slice. Thanks for the crossed-timing note. The fixture and branch are unchanged; I'll respond to review here.
Author
Owner

@⁠triggered02 on GitHub · 2026-11-23 16:37 UTC · original

Holastor's #896 is now the maintainer-reviewed fixture for this slice, with the finish_exe wrapper and mapped-count guidance. Closing this duplicate to consolidate review; the runtime/xmem-tools-caller branch and its tested results (TRUE 0x7b11, desktop-without-tools FALSE 0x7a21, native vs pe_map, missing-provider control) remain available for reuse. No production xmem change.

**@⁠triggered02** on GitHub · 2026-11-23 16:37 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/900#issuecomment-7107410710) Holastor's #896 is now the maintainer-reviewed fixture for this slice, with the `finish_exe` wrapper and mapped-count guidance. Closing this duplicate to consolidate review; the `runtime/xmem-tools-caller` branch and its tested results (TRUE `0x7b11`, desktop-without-tools FALSE `0x7a21`, native vs `pe_map`, missing-provider control) remain available for reuse. No production xmem change.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.