kernelx: implement XMemIsToolsMemAvailable and route xmem.dll #563

Manually merged
github merged 1 commit from gh-pr/563/head into gh-pr/563/base 2026-11-26 04:25:48 +00:00
Owner

@⁠Ivankiosan on GitHub · 2026-11-24 01:50 UTC · original
Ivankiosan:kernelx-xmem-tools-mem → main · +20 −0 · 3 files · 1 commits · merged 2026-11-25 01:06 UTC

Implement XMemIsToolsMemAvailable in kernelx and route xmem.dll to KERNELX.

On Xbox consoles, tooling/debug memory is exclusive to DevKits. In retail titles, XMemIsToolsMemAvailable() always returns 0 (FALSE), matching the behavior of sibling tooling APIs in kernelx.rs like ToolingMemoryStatus. This resolves the final remaining stub imported by the retail title Scarlett package (game_scarlett_master.exe).

What is in it

  • crates/xcl/src/hle/kernelx.rs: implement XMemIsToolsMemAvailable returning 0 (FALSE) and add unit test
  • crates/xcl/src/hle/mod.rs: add "xmem.dll" to KERNELX route list
  • crates/xcl/src/resolver.rs: add unit test verifying xmem.dll imports route to KERNELX

Tested

  • Hardware: AMD Radeon RX 7600 (8152 MiB VRAM, driver 32.0.32029.2010), AMD x86_64 CPU, Windows 11 Build 26200, rustc 1.100.0 (MSVC), debug & release builds
  • Commands run: cargo test --workspace -- --test-threads=4: 673 passed, 0 failed, 37 ignored
  • SKIPPED GPU tests on adapter: none
  • Game checked: retail title Scarlett retail build (game_scarlett_master.exe): xcl inspect reduced unresolved imports from 1 stub to 0 stubs (587/587 imports resolved)

Regression run

xcl-smoke v1
commit: 508a0c74d7c0625d6d2de8d24494e69dc2e1926f
gpu: AMD Radeon RX 7600
title: xbox
seconds: 20
exit: 0x0
frames shown: 259 (PresentX 260)
presents per 2 s (last 3): 69 60 60
device removals: 0
crashes: 0
peak commit: 9735 MB
xcl-smoke v1
commit: 70f9fce18ebb395051b81723c2ab1d9c20f670ff
gpu: AMD Radeon RX 7600
title: xbox
seconds: 20
exit: 0x0
frames shown: 282 (PresentX 282)
presents per 2 s (last 3): 61 61 59
device removals: 0
crashes: 0
peak commit: 9684 MB

Not tested

  • NVIDIA GPUs / Intel Arc GPUs
  • Titles that query tools memory beyond XMemIsToolsMemAvailable

AI use

  • Antigravity with Gemini 2.5 Flash for investigating symbol semantics, implementing HLE function and unit tests, and executing workspace test suites and regression smoke runs
**@⁠Ivankiosan** on GitHub · 2026-11-24 01:50 UTC · [original](https://github.com/xcl-dev/xcl/pull/563) `Ivankiosan:kernelx-xmem-tools-mem` → `main` · +20 −0 · 3 files · 1 commits · merged 2026-11-25 01:06 UTC Implement `XMemIsToolsMemAvailable` in `kernelx` and route `xmem.dll` to `KERNELX`. On Xbox consoles, tooling/debug memory is exclusive to DevKits. In retail titles, `XMemIsToolsMemAvailable()` always returns `0` (`FALSE`), matching the behavior of sibling tooling APIs in `kernelx.rs` like `ToolingMemoryStatus`. This resolves the final remaining stub imported by the retail title Scarlett package (`game_scarlett_master.exe`). **What is in it** - `crates/xcl/src/hle/kernelx.rs`: implement `XMemIsToolsMemAvailable` returning 0 (`FALSE`) and add unit test - `crates/xcl/src/hle/mod.rs`: add `"xmem.dll"` to `KERNELX` route list - `crates/xcl/src/resolver.rs`: add unit test verifying `xmem.dll` imports route to `KERNELX` **Tested** - Hardware: AMD Radeon RX 7600 (8152 MiB VRAM, driver 32.0.32029.2010), AMD x86_64 CPU, Windows 11 Build 26200, rustc 1.100.0 (MSVC), debug & release builds - Commands run: `cargo test --workspace -- --test-threads=4`: 673 passed, 0 failed, 37 ignored - `SKIPPED` GPU tests on adapter: none - Game checked: retail title Scarlett retail build (`game_scarlett_master.exe`): `xcl inspect` reduced unresolved imports from 1 stub to 0 stubs (587/587 imports resolved) **Regression run** ``` xcl-smoke v1 commit: 508a0c74d7c0625d6d2de8d24494e69dc2e1926f gpu: AMD Radeon RX 7600 title: xbox seconds: 20 exit: 0x0 frames shown: 259 (PresentX 260) presents per 2 s (last 3): 69 60 60 device removals: 0 crashes: 0 peak commit: 9735 MB ``` ``` xcl-smoke v1 commit: 70f9fce18ebb395051b81723c2ab1d9c20f670ff gpu: AMD Radeon RX 7600 title: xbox seconds: 20 exit: 0x0 frames shown: 282 (PresentX 282) presents per 2 s (last 3): 61 61 59 device removals: 0 crashes: 0 peak commit: 9684 MB ``` **Not tested** - NVIDIA GPUs / Intel Arc GPUs - Titles that query tools memory beyond `XMemIsToolsMemAvailable` **AI use** - Antigravity with Gemini 2.5 Flash for investigating symbol semantics, implementing HLE function and unit tests, and executing workspace test suites and regression smoke runs
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:25:46 +00:00
github manually merged commit 70f9fce18e into gh-pr/563/base 2026-11-26 04:25:48 +00:00
Author
Owner

@⁠fromthemoonx on GitHub · 2026-11-24 02:03 UTC · original

NVIDIA run, since Not tested lists NVIDIA GPUs.

Tested

  • Exact head 70f9fce18ebb395051b81723c2ab1d9c20f670ff, clean worktree
  • NVIDIA GeForce RTX 3060 (32-lane waves), driver 32.0.16.1088; AMD Ryzen 7 5700X; Windows 11 Pro 26H2 (build 26300.9974); rustc 1.100.0 stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0); debug
  • cargo build --workspace, then cargo test --workspace -- --test-threads=4: 682 passed, 0 failed, 41 ignored (lib 642 / 0 / 21)
  • The two new tests passed in that run: hle::kernelx::tests::xmem_is_tools_mem_available_returns_false, resolver::tests::xmem_imports_route_through_kernelx
  • SKIPPED (no wave64 on this adapter): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware
  • XCL_SAMPLE_* not set

Not tested

  • A retail title, so no smoke.ps1 run here. The change is CPU-side, so the GPU vendor should not matter to it.
  • Release build.

AI use

  • Claude Code (Claude Opus 5.5) ran the build and tests on the machine above and wrote this report from the log.
**@⁠fromthemoonx** on GitHub · 2026-11-24 02:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/563#issuecomment-7119713362) NVIDIA run, since **Not tested** lists NVIDIA GPUs. **Tested** - Exact head `70f9fce18ebb395051b81723c2ab1d9c20f670ff`, clean worktree - NVIDIA GeForce RTX 3060 (32-lane waves), driver 32.0.16.1088; AMD Ryzen 7 5700X; Windows 11 Pro 26H2 (build 26300.9974); rustc 1.100.0 `stable-x86_64-pc-windows-msvc`; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0); debug - `cargo build --workspace`, then `cargo test --workspace -- --test-threads=4`: **682 passed, 0 failed, 41 ignored** (lib 642 / 0 / 21) - The two new tests passed in that run: `hle::kernelx::tests::xmem_is_tools_mem_available_returns_false`, `resolver::tests::xmem_imports_route_through_kernelx` - SKIPPED (no wave64 on this adapter): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` - `XCL_SAMPLE_*` not set **Not tested** - A retail title, so no `smoke.ps1` run here. The change is CPU-side, so the GPU vendor should not matter to it. - Release build. **AI use** - Claude Code (Claude Opus 5.5) ran the build and tests on the machine above and wrote this report from the log.
Author
Owner

@⁠MesshM on GitHub · 2026-11-24 03:33 UTC · original

Test run of 70f9fce18ebb395051b81723c2ab1d9c20f670ff on AMD RDNA4. I merged it onto current main 91f9a5e locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 694 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 654 passed, 0 failed, 21 ignored
  • 0 SKIPPED; xmem_is_tools_mem_available_returns_false and xmem_imports_route_through_kernelx pass.

Review: xmem.dll joins the module names resolved against KERNELX (like kernel32legacy.dll). On main nothing routed xmem.dll, so its imports were stubs; now any of its functions kernelx already has resolve there and the rest stay stubs, so I see no regression. Returning FALSE matches a retail console. I found nothing to change.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

**@⁠MesshM** on GitHub · 2026-11-24 03:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/563#issuecomment-7121206482) Test run of `70f9fce18ebb395051b81723c2ab1d9c20f670ff` on AMD RDNA4. I merged it onto current `main` `91f9a5e` locally (clean merge) and tested that tree. **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **694 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 654 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; `xmem_is_tools_mem_available_returns_false` and `xmem_imports_route_through_kernelx` pass. **Review:** `xmem.dll` joins the module names resolved against `KERNELX` (like `kernel32legacy.dll`). On `main` nothing routed `xmem.dll`, so its imports were stubs; now any of its functions `kernelx` already has resolve there and the rest stay stubs, so I see no regression. Returning FALSE matches a retail console. I found nothing to change. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 00:56 UTC · original

Diff check on 70f9fce:

  • Adding XMemIsToolsMemAvailable (returning 0) to kernelx::exports() and routing xmem.dll cleanly unblocks retail titles that query tooling memory availability.
  • Already verified across both AMD (RX 9060 XT) and NVIDIA (RTX 3060), with PR description passing.

Next step to unblock merge: Please rebase onto current main so CI runs Build and test (Windows, no GPU) on the head.

**@⁠raylitebull** on GitHub · 2026-11-25 00:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/563#issuecomment-7149050838) Diff check on `70f9fce`: - Adding `XMemIsToolsMemAvailable` (returning `0`) to `kernelx::exports()` and routing `xmem.dll` cleanly unblocks retail titles that query tooling memory availability. - Already verified across both AMD (`RX 9060 XT`) and NVIDIA (`RTX 3060`), with `PR description` passing. **Next step to unblock merge:** Please rebase onto current `main` so CI runs `Build and test (Windows, no GPU)` on the head.
This discussion has been locked. Commenting is limited to contributors.
No description provided.