Skip to content

kernelx: implement XMemIsToolsMemAvailable and route xmem.dll - #563

Merged
raylitebull merged 1 commit into
xcl-dev:mainfrom
Ivankiosan:kernelx-xmem-tools-mem
Nov 25, 2026
Merged

raylitebull merged 1 commit into
xcl-dev:mainfrom
Ivankiosan:kernelx-xmem-tools-mem

Conversation

@Ivankiosan

@Ivankiosan Ivankiosan commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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
Ivankiosan force-pushed the kernelx-xmem-tools-mem branch from 4a4aaf5 to 70f9fce Compare November 24, 2026 01:55
@fromthemoonx

Copy link
Copy Markdown

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.

T-Crypt added a commit to T-Crypt/bathyal that referenced this pull request Nov 24, 2026
@MesshM

MesshM commented Nov 24, 2026

Copy link
Copy Markdown

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.

@raylitebull

Copy link
Copy Markdown
Member

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
raylitebull merged commit dbfadb4 into xcl-dev:main Nov 25, 2026
3 checks passed
raylitebull added a commit to raylitebull/xcl that referenced this pull request Nov 25, 2026
…ility

- kernelx: keep plain XMemVirtualAlloc/physical fallbacks below the 40-bit VA
  ceiling via VirtualAlloc2 when available; stop large AllocateTitlePhysicalPages
  pools from stealing pre-committed coherent UMA; skip committing lazy/unmapped
  pages on read_physical_pages while ensuring lazy pages before writes; unmark
  freed lazy pages in FreeTitlePhysicalPages. (XMemIsToolsMemAvailable is
  already on main via xcl-dev#563.)
- dstorage: refresh zero or stale (freed) physical page-table entries via
  read_own (xcl-dev#476/xcl-dev#509 safe) on write/read retry; extend the parallel
  decompression pool to handle physical-page destinations and supported BCPack
  requests.
- gameinput & kbm: skip disconnected-pad XInput rumble stalls and deduplicate
  unchanged motor speeds; implement bounded reading history for GetNextReading /
  GetPreviousReading; extend XCL_PRESS_AT with triggers, sticks, LS/RS, and
  optional durations; add Z/C holdable bumper keys, require mouse capture and
  non-sizing for mouse buttons, and guard KBM mouse velocity against sub-0.5 ms
  zero-delta poll decay.
raylitebull added a commit to raylitebull/xcl that referenced this pull request Nov 25, 2026
…ility

- kernelx: keep plain XMemVirtualAlloc and alloc_physical_home plain fallbacks
  below the 40-bit VA ceiling via VirtualAlloc2 when available; skip committing
  lazy/unmapped pages on read_physical_pages while ensuring lazy pages before
  writes; unmark freed lazy pages in FreeTitlePhysicalPages. (Coherent fallback
  skip on sparse layouts is already on main via xcl-dev#2157; XMemIsToolsMemAvailable
  via xcl-dev#563.)
- dstorage: refresh zero or stale (freed) physical page-table entries via
  read_own (xcl-dev#476/xcl-dev#509 safe) on write/read retry; extend the parallel
  decompression pool to handle physical-page destinations and supported BCPack
  requests.
- gameinput & kbm: skip disconnected-pad XInput rumble stalls and deduplicate
  unchanged motor speeds; implement bounded reading history for GetNextReading /
  GetPreviousReading; extend XCL_PRESS_AT with triggers, sticks, LS/RS, and
  optional durations; add Z/C holdable bumper keys, require mouse capture and
  non-sizing for mouse buttons, and guard KBM mouse velocity against sub-0.5 ms
  zero-delta poll decay.
raylitebull added a commit to raylitebull/xcl that referenced this pull request Nov 25, 2026
…ility

- kernelx: keep plain XMemVirtualAlloc and alloc_physical_home plain fallbacks
  below the 40-bit VA ceiling via VirtualAlloc2 when available; skip committing
  lazy/unmapped pages on read_physical_pages while ensuring lazy pages before
  writes; unmark freed lazy pages in FreeTitlePhysicalPages. (Coherent fallback
  skip on sparse layouts is on main via xcl-dev#2157; XMemIsToolsMemAvailable via xcl-dev#563.)
- dstorage: share execution-time physical page-list resolution (xcl-dev#1405 / xcl-dev#476
  dest_on_stack + read_own live-list reread) across sequential execute() and the
  parallel decompression pool; extend parallel decompression to handle
  physical-page destinations and supported BCPack requests; refresh stale
  physical-page source lists via read_own.
- gameinput & kbm: skip disconnected-pad XInput rumble stalls and deduplicate
  unchanged motor speeds; implement bounded reading history for GetNextReading /
  GetPreviousReading; extend XCL_PRESS_AT with triggers, sticks, LS/RS, and
  optional durations; add Z/C holdable bumper keys, require mouse capture and
  non-sizing for mouse buttons, and guard KBM mouse velocity against sub-0.5 ms
  zero-delta poll decay.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants