xmem: wire executable __XMemAllocationHooks__ export into XMemAlloc/X… #546

Closed
kotekompotek wants to merge 1 commit from upstream-pr/546 into main
kotekompotek commented 2026-11-24 07:28:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kotekompotek on 2026-11-24T07:28:25Z.


Claimed in the coordination issue as: XMEM-HOOKS (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140854018)

What and why

  • Rebased onto current main.
  • Wired an executable's exported __XMemAllocationHooks__ ({alloc, free}) through pe_loader / shims into XMemAlloc/XMemFree (while XMemAllocDefault/XMemFreeDefault bypass hooks and Loader::~Loader() clears them).
  • Updated runtime/shims/xmem.h comment and docs/xmem_exe_calls.md to accurately reflect that only the symbol export is observed in docs/xmem_exe_calls.md and title runtime hook behaviour is unmeasured.

Tested

  • Built and ran CTest targets pe_loader (Passed, 1.80s) and xmem (Passed, 0.27s) on Windows.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5467962992 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/546). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-24T07:28:25Z. --- Claimed in the coordination issue as: XMEM-HOOKS (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140854018) ### What and why - Rebased onto current `main`. - Wired an executable's exported `__XMemAllocationHooks__` (`{alloc, free}`) through `pe_loader` / `shims` into `XMemAlloc`/`XMemFree` (while `XMemAllocDefault`/`XMemFreeDefault` bypass hooks and `Loader::~Loader()` clears them). - Updated `runtime/shims/xmem.h` comment and `docs/xmem_exe_calls.md` to accurately reflect that only the symbol export is observed in `docs/xmem_exe_calls.md` and title runtime hook behaviour is unmeasured. ### Tested - Built and ran CTest targets `pe_loader` (`Passed`, 1.80s) and `xmem` (`Passed`, 0.27s) on Windows. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed.
PierreEbele commented 2026-11-25 00:09:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T00:09:31Z.


Reviewed 3216db78 by reading the code and running a git merge check. The changed shim, loader and xmem_test targets are Windows/MSVC-only, so I did not compile or run them here.

  1. Conflict and duplicated plumbing. git merge-tree --write-tree origin/main pr546 reports CONFLICT (content) in runtime/src/pe_loader.cpp. Since 522faa2e, main already registers the executable's __XMemAllocationHooks__ at map time (pe_loader.cpp:1505, shims::add_xmem_allocation_hooks) and clears them in ~Loader (:1097). It exposes them as rt::shims::xmem_allocation_hooks() (shims.h, registry.cpp:501-523), which d3d12_xs.cpp:133 already uses. The PR's parallel notify_xmem_allocation_hooks / rt::xmem::XMemAllocationHooks path is therefore redundant. What is still missing on main is the forwarding in xmem.cpp. A rebase that has XMemAlloc/XMemFree read rt::shims::xmem_allocation_hooks() would keep this PR's useful half.
  2. That rebase also removes the ordering gap in this version. Here the pair is installed in Loader::initialise(Module&), after the dependency DLLs' DllMain/TLS attach. An XMemAlloc made in that window comes from the shim heap, but once the hooks are installed its XMemFree would go to the title's free. Main's map-time registration avoids this.
  3. rt::xmem::allocation_hooks() (xmem.h:18) has no caller in the tree.
  4. docs/xmem_exe_calls.md:32 says the loader binds "a non-null {alloc, free} pair". However, xmem.cpp checks alloc and free separately, so a half-null pair would mix allocators. Either require both or reword the doc.

AI-assisted review.

Recommendation: Fix first

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7148210205 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/546#issuecomment-7148210205). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T00:09:31Z. --- Reviewed 3216db78 by reading the code and running a git merge check. The changed shim, loader and `xmem_test` targets are Windows/MSVC-only, so I did not compile or run them here. 1. **Conflict and duplicated plumbing.** `git merge-tree --write-tree origin/main pr546` reports `CONFLICT (content)` in `runtime/src/pe_loader.cpp`. Since 522faa2e, main already registers the executable's `__XMemAllocationHooks__` at map time (`pe_loader.cpp:1505`, `shims::add_xmem_allocation_hooks`) and clears them in `~Loader` (`:1097`). It exposes them as `rt::shims::xmem_allocation_hooks()` (`shims.h`, `registry.cpp:501-523`), which `d3d12_xs.cpp:133` already uses. The PR's parallel `notify_xmem_allocation_hooks` / `rt::xmem::XMemAllocationHooks` path is therefore redundant. What is still missing on main is the forwarding in `xmem.cpp`. A rebase that has `XMemAlloc`/`XMemFree` read `rt::shims::xmem_allocation_hooks()` would keep this PR's useful half. 2. That rebase also removes the ordering gap in this version. Here the pair is installed in `Loader::initialise(Module&)`, after the dependency DLLs' DllMain/TLS attach. An `XMemAlloc` made in that window comes from the shim heap, but once the hooks are installed its `XMemFree` would go to the title's `free`. Main's map-time registration avoids this. 3. `rt::xmem::allocation_hooks()` (`xmem.h:18`) has no caller in the tree. 4. `docs/xmem_exe_calls.md:32` says the loader binds "a non-null `{alloc, free}` pair". However, `xmem.cpp` checks `alloc` and `free` separately, so a half-null pair would mix allocators. Either require both or reword the doc. AI-assisted review. **Recommendation:** Fix first
kotekompotek commented 2026-11-25 07:24:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kotekompotek on 2026-11-25T07:24:31Z.


Reworked per review: dropped the duplicate hook plumbing and wired XMemAlloc/XMemFree through the existing registry from main (rt::shims::xmem_allocation_hooks()). Forwarding happens only when both callbacks are non-null; XMemAllocDefault/XMemFreeDefault stay on the default allocator path. Rebased on ubi/main (42537e7b6), head is now 9ff7e32a9.

Tested

  • xmem_test (xmem variant) on this branch: all new checks pass - the alloc hook receives size/attributes, the free hook receives pointer/attributes, XMemAllocDefault/XMemFreeDefault bypass the registered hooks, and removing the hooks restores default behavior.
  • Note: xmem_test stops later in the "xmem heap-lock faults" section at its 30 s no-progress watchdog (deadlock between the fault-handler lock and the process heap). Reproduced identically on clean ubi/main without this change, so it is a pre-existing baseline issue, not a regression from this PR. Reported as a finding in the coordination issue.

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7155826098 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/546#issuecomment-7155826098). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T07:24:31Z. --- Reworked per review: dropped the duplicate hook plumbing and wired `XMemAlloc`/`XMemFree` through the existing registry from main (`rt::shims::xmem_allocation_hooks()`). Forwarding happens only when both callbacks are non-null; `XMemAllocDefault`/`XMemFreeDefault` stay on the default allocator path. Rebased on `ubi/main` (42537e7b6), head is now `9ff7e32a9`. ### Tested - `xmem_test` (xmem variant) on this branch: all new checks pass - the alloc hook receives size/attributes, the free hook receives pointer/attributes, `XMemAllocDefault`/`XMemFreeDefault` bypass the registered hooks, and removing the hooks restores default behavior. - Note: `xmem_test` stops later in the "xmem heap-lock faults" section at its 30 s no-progress watchdog (deadlock between the fault-handler lock and the process heap). Reproduced identically on clean `ubi/main` without this change, so it is a pre-existing baseline issue, not a regression from this PR. Reported as a finding in the coordination issue. AI-assisted: yes
PierreEbele commented 2026-11-25 07:31:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T07:31:14Z.


Re-checked 9ff7e32a by reading the code and running a merge check. It is still Windows/MSVC-only, so I did not compile or run it here.

The four points from my earlier review are addressed:

  • The parallel plumbing is gone. git diff --stat origin/main...pr546 now touches only docs/xmem_exe_calls.md, runtime/shims/xmem.cpp and runtime/test/xmem_test.cpp. git merge-tree --write-tree origin/main pr546 reports no conflict.
  • XMemAlloc/XMemFree read main's rt::shims::xmem_allocation_hooks() (xmem.cpp:107-120), so the map-time registration in pe_loader.cpp also removes the ordering gap.
  • The unused rt::xmem::allocation_hooks() is no longer added.
  • Both callbacks are now required in both paths (xmem.cpp:108,116), and the doc matches that.

One small nit: docs/xmem_exe_calls.md:35 says the half-null case is "checked in xmem_test", but the new block only tests a complete pair and its removal. Either add a {&test_alloc_hook, nullptr} case that asserts the hook is not called, or drop "half-null" from the "checked" clause.

AI-assisted review.

Recommendation: Merge (after the doc nit, optional)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7155950696 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/546#issuecomment-7155950696). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T07:31:14Z. --- Re-checked 9ff7e32a by reading the code and running a merge check. It is still Windows/MSVC-only, so I did not compile or run it here. The four points from my earlier review are addressed: - The parallel plumbing is gone. `git diff --stat origin/main...pr546` now touches only `docs/xmem_exe_calls.md`, `runtime/shims/xmem.cpp` and `runtime/test/xmem_test.cpp`. `git merge-tree --write-tree origin/main pr546` reports no conflict. - `XMemAlloc`/`XMemFree` read main's `rt::shims::xmem_allocation_hooks()` (`xmem.cpp:107-120`), so the map-time registration in `pe_loader.cpp` also removes the ordering gap. - The unused `rt::xmem::allocation_hooks()` is no longer added. - Both callbacks are now required in both paths (`xmem.cpp:108,116`), and the doc matches that. One small nit: `docs/xmem_exe_calls.md:35` says the half-null case is "checked in `xmem_test`", but the new block only tests a complete pair and its removal. Either add a `{&test_alloc_hook, nullptr}` case that asserts the hook is not called, or drop "half-null" from the "checked" clause. AI-assisted review. **Recommendation:** Merge (after the doc nit, optional)
kotekompotek commented 2026-11-25 07:57:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kotekompotek on 2026-11-25T07:57:19Z.


Doc nit addressed in 8c3eb1826: the test now also registers a {alloc, nullptr} pair and asserts neither hook is called (XMemAlloc/XMemFree stay on the default path), matching the "half-null" wording in docs/xmem_exe_calls.md. All hook checks pass in xmem_test (the later "xmem heap-lock faults" watchdog stop reproduces identically on clean ubi/main).

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7156439580 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/546#issuecomment-7156439580). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T07:57:19Z. --- Doc nit addressed in `8c3eb1826`: the test now also registers a `{alloc, nullptr}` pair and asserts neither hook is called (XMemAlloc/XMemFree stay on the default path), matching the "half-null" wording in `docs/xmem_exe_calls.md`. All hook checks pass in `xmem_test` (the later "xmem heap-lock faults" watchdog stop reproduces identically on clean ubi/main). AI-assisted: yes
kotekompotek commented 2026-11-25 09:40:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kotekompotek on 2026-11-25T09:40:17Z.


@PierreEbele the doc nit is covered at 8c3eb1826: xmem_test now registers {&test_alloc_hook, nullptr} and checks both halves of it — that XMemAlloc does not call the hook and XMemFree stays on the default path ("a half-null hook pair is not called" / "leaves XMemFree on the default path"). All hook checks pass locally; the only red section remains the pre-existing heap-lock deadlock reproduced on clean ubi/main (finding in #1608).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7158644428 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/546#issuecomment-7158644428). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T09:40:17Z. --- @PierreEbele the doc nit is covered at `8c3eb1826`: `xmem_test` now registers `{&test_alloc_hook, nullptr}` and checks both halves of it — that `XMemAlloc` does not call the hook and `XMemFree` stays on the default path ("a half-null hook pair is not called" / "leaves XMemFree on the default path"). All hook checks pass locally; the only red section remains the pre-existing heap-lock deadlock reproduced on clean `ubi/main` (finding in #1608).
zmasi commented 2026-11-28 22:40:23 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T22:40:23Z.


Native Windows 11 + MSVC 19.44 Verification (8c3eb18264 + origin/main adfb3821a2)

Verdict: PASS (0 blockers, 0 new /W4 warnings)

Environment & Merge Check

  • Host: Windows 11 (10.0.26200), MSVC 19.44.35228 (x64, /W4 /permissive- /utf-8 /O2 /EHsc)
  • Merge hygiene: Clean merge onto origin/main (adfb3821a2, git merge-tree --write-tree rc=0), and clean combined merge alongside #1600 (testfiles::temp_dir() in runtime/test/xmem_test.cpp).

Red -> Green Results

  • Red (origin/main runtime/shims/xmem.cpp + PR #546 runtime/test/xmem_test.cpp, linked /OPT:NOREF /BASE:0x140000000 /DYNAMICBASE:NO):
    • Exited 1, failing all 6 active hook checks (XMemAlloc forwards to registered alloc hook with attributes, XMemAllocDefault bypasses registered alloc hook, XMemFree forwards to registered free hook with attributes, clearing allocation hooks restores default XMemAlloc, clearing allocation hooks restores default XMemFree, a half-null hook pair is not called).
  • Green (PR #546 + origin/main):
    • xmem_test.exe (default): PASS (xmem_test: OK (497 checks), 4.26 s), passing all 9 __XMemAllocationHooks__ checks (size + attributes forwarding on XMemAlloc/XMemFree, XMemAllocDefault/XMemFreeDefault bypass without recursion when a hook chains back into the default allocator, hook clearing, and half-null pair fallback).
    • xmem_test.exe --pool-zero-read: PASS (xmem_test: OK (24 checks), 0.04 s).
    • python -I tests/test_docs_encoding.py & python -I tests/test_docs_table_rows.py (docs/xmem_exe_calls.md): PASS (OK).

Diff Audit Notes

  • Requiring both alloc and free in HooksPair to be non-null before dispatching avoids pairing a custom alloc with the default free (or vice versa) across non-atomic two-pointer writes to __XMemAllocationHooks__.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246900252 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/546#issuecomment-7246900252). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T22:40:23Z. --- ### Native Windows 11 + MSVC `19.44` Verification (`8c3eb18264` + `origin/main` `adfb3821a2`) **Verdict**: **PASS** (0 blockers, 0 new `/W4` warnings) #### Environment & Merge Check - **Host**: Windows 11 (`10.0.26200`), MSVC `19.44.35228` (`x64`, `/W4 /permissive- /utf-8 /O2 /EHsc`) - **Merge hygiene**: Clean merge onto `origin/main` (`adfb3821a2`, `git merge-tree --write-tree` `rc=0`), and clean combined merge alongside `#1600` (`testfiles::temp_dir()` in `runtime/test/xmem_test.cpp`). #### Red -> Green Results - **Red** (`origin/main` `runtime/shims/xmem.cpp` + PR `#546` `runtime/test/xmem_test.cpp`, linked `/OPT:NOREF /BASE:0x140000000 /DYNAMICBASE:NO`): - Exited `1`, failing all 6 active hook checks (`XMemAlloc forwards to registered alloc hook with attributes`, `XMemAllocDefault bypasses registered alloc hook`, `XMemFree forwards to registered free hook with attributes`, `clearing allocation hooks restores default XMemAlloc`, `clearing allocation hooks restores default XMemFree`, `a half-null hook pair is not called`). - **Green** (`PR #546 + origin/main`): - `xmem_test.exe` (default): **PASS** (`xmem_test: OK (497 checks)`, `4.26 s`), passing all 9 `__XMemAllocationHooks__` checks (`size` + `attributes` forwarding on `XMemAlloc`/`XMemFree`, `XMemAllocDefault`/`XMemFreeDefault` bypass without recursion when a hook chains back into the default allocator, hook clearing, and half-null pair fallback). - `xmem_test.exe --pool-zero-read`: **PASS** (`xmem_test: OK (24 checks)`, `0.04 s`). - `python -I tests/test_docs_encoding.py` & `python -I tests/test_docs_table_rows.py` (`docs/xmem_exe_calls.md`): **PASS** (`OK`). #### Diff Audit Notes - Requiring both `alloc` and `free` in `HooksPair` to be non-null before dispatching avoids pairing a custom `alloc` with the default `free` (or vice versa) across non-atomic two-pointer writes to `__XMemAllocationHooks__`. AI-assisted.
TheGeogeo commented 2026-11-29 06:52:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T06:52:47Z.


Tested 8c3eb1826 merged (no commit) with main ef3299584. GPUs tested: NVIDIA GeForce RTX 3080, driver 621.40, Windows 11 10.0.26300; MSVC 19.52 (Visual Studio 18), Ninja, RelWithDebInfo. check_no_game_data.py is clean.

  • Base: xmem, xmem_no_write_watch and xmem_write_watch pass on plain main ef3299584.
  • Green: all three pass on the merge.
  • Red: with runtime/shims/xmem.cpp back to main, all three fail the hook checks:
    • XMemAlloc forwards to registered alloc hook with attributes
    • XMemAllocDefault bypasses registered alloc hook
    • XMemFree forwards to registered free hook with attributes
    • clearing allocation hooks restores default XMemAlloc
    • clearing allocation hooks restores default XMemFree
    • a half-null hook pair is not called
    • a half-null hook pair leaves XMemFree on the default path
  • No regression: the merge rebuilds 199 executables. Of their 309 other tests, only xbox_present fails, as on plain main here.
  • LINK: gta6rt.exe linked without ws2_32.lib gives main's 26 unresolved Rust-std symbols, nothing new. Its imports are identical to main's.
  • The docs/xmem_exe_calls.md claims match the code on the merge:
    • the pair is registered in Loader::map_image (pe_loader.cpp:1837) and cleared in ~Loader (:1424);
    • XMemAllocDefault/XMemFreeDefault bypass the hooks (xmem.cpp:171-179);
    • a half-null pair stays on the shim heap.

No blocker from my side. AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7252124882 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/546#issuecomment-7252124882). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T06:52:47Z. --- Tested `8c3eb1826` merged (no commit) with `main` `ef3299584`. GPUs tested: NVIDIA GeForce RTX 3080, driver 621.40, Windows 11 10.0.26300; MSVC 19.52 (Visual Studio 18), Ninja, RelWithDebInfo. `check_no_game_data.py` is clean. - Base: `xmem`, `xmem_no_write_watch` and `xmem_write_watch` pass on plain `main` `ef3299584`. - Green: all three pass on the merge. - Red: with `runtime/shims/xmem.cpp` back to `main`, all three fail the hook checks: - `XMemAlloc forwards to registered alloc hook with attributes` - `XMemAllocDefault bypasses registered alloc hook` - `XMemFree forwards to registered free hook with attributes` - `clearing allocation hooks restores default XMemAlloc` - `clearing allocation hooks restores default XMemFree` - `a half-null hook pair is not called` - `a half-null hook pair leaves XMemFree on the default path` - No regression: the merge rebuilds 199 executables. Of their 309 other tests, only `xbox_present` fails, as on plain `main` here. - LINK: `gta6rt.exe` linked without `ws2_32.lib` gives `main`'s 26 unresolved Rust-std symbols, nothing new. Its imports are identical to `main`'s. - The `docs/xmem_exe_calls.md` claims match the code on the merge: - the pair is registered in `Loader::map_image` (`pe_loader.cpp:1837`) and cleared in `~Loader` (`:1424`); - `XMemAllocDefault`/`XMemFreeDefault` bypass the hooks (`xmem.cpp:171-179`); - a half-null pair stays on the shim heap. No blocker from my side. AI-assisted (Claude Code).
fiestorra commented 2026-11-30 09:54:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T09:54:51Z.


Independent verification on this machine (Windows 11, MSVC 19.44.35226), with a negative control that bites on three of six tests.

1. It applies. merge-tree clean; the commits cherry-pick onto main 4014af7fe without a conflict. Three files: docs/xmem_exe_calls.md, runtime/shims/xmem.cpp (the change) and runtime/test/xmem_test.cpp.

2. With the branch, all six tests pass:

ctest -R 'xmem'
100% tests passed, 0 tests failed out of 6

3. The control - revert only the shim, keep the test:

git checkout origin/main -- runtime/shims/xmem.cpp
cmake --build … --target xmem_test
ctest -R 'xmem' --output-on-failure
50% tests passed, 3 tests failed out of 6
FAIL XMemAlloc forwards to registered alloc hook with attributes

Three of the six bite, and the first one names the change: XMemAlloc must forward to a registered alloc hook with its attributes, which is what the shim change adds.

What I did not test: the memory accounting the doc describes, and the other three tests' relationship to the change (they pass with the shim reverted, so they cover something else).

Why I am commenting: I verify open pull requests that replay onto current main by applying them in a scratch worktree, building the targets their tests name in ctest --show-only=json-v1, running them, and then reverting only the source change to see which tests stop passing.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7274856506 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/546#issuecomment-7274856506). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T09:54:51Z. --- Independent verification on this machine (Windows 11, MSVC 19.44.35226), with a negative control that bites on three of six tests. **1. It applies.** `merge-tree` clean; the commits cherry-pick onto `main` `4014af7fe` without a conflict. Three files: `docs/xmem_exe_calls.md`, `runtime/shims/xmem.cpp` (the change) and `runtime/test/xmem_test.cpp`. **2. With the branch, all six tests pass:** ``` ctest -R 'xmem' 100% tests passed, 0 tests failed out of 6 ``` **3. The control - revert only the shim, keep the test:** ``` git checkout origin/main -- runtime/shims/xmem.cpp cmake --build … --target xmem_test ctest -R 'xmem' --output-on-failure 50% tests passed, 3 tests failed out of 6 FAIL XMemAlloc forwards to registered alloc hook with attributes ``` **Three of the six bite**, and the first one names the change: `XMemAlloc` must forward to a registered alloc hook **with its attributes**, which is what the shim change adds. **What I did not test:** the memory accounting the doc describes, and the other three tests' relationship to the change (they pass with the shim reverted, so they cover something else). **Why I am commenting:** I verify open pull requests that replay onto current `main` by applying them in a scratch worktree, building the targets their tests name in `ctest --show-only=json-v1`, running them, and then reverting **only** the source change to see which tests stop passing. Written with an AI assistant.
aslan2142 commented 2026-12-01 17:21:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T17:21:10Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7319162057 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/546#issuecomment-7319162057). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T17:21:10Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

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
ProjectLeonida/mandy!546
No description provided.