runtime: record both XMemIsToolsMemAvailable caller outcomes #893

Closed
triggered02 wants to merge 1 commit from upstream-pr/900 into main
triggered02 commented 2026-11-23 16:29:01 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-23T16:29:01Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6563867921 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/900). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-23T16:29:01Z. --- 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.
upstream-sync closed this pull request 2026-11-24 06:45:19 +00:00
triggered02 commented 2026-11-24 06:49:17 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-23T16:29:42Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7107220636 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/900#issuecomment-7107220636). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-23T16:29:42Z. --- 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.
chatgpt-codex-connector[bot commented 2026-11-24 06:49:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-23T16:29:11Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7107207428 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/900#issuecomment-7107207428). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-23T16:29:11Z. --- <!-- 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>
triggered02 commented 2026-11-24 06:49:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-23T16:30:58Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7107253699 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/900#issuecomment-7107253699). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-23T16:30:58Z. --- 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 commented 2026-11-24 06:49:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-23T16:37:03Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7107410710 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/900#issuecomment-7107410710). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-23T16:37:03Z. --- 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

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!893
No description provided.