Respect the console build override for XMem pools and allocation statistics #227
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!227
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/227/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@bambermf on GitHub · 2026-11-23 06:07 UTC · original
bambermf:fix/xmem-console-build-selection→main· +8 −4 · 2 files · 1 commits · closed without mergingLibrary / area — XMem allocation pools and allocation statistics.
Exports affected — XMemSetAllocationHysteresis, XMemGetAllocationHysteresis and XMemGetAllocationStatistics. No export table rows changed.
Source of behaviour — The build 19041 pool granule and invalid-type behaviour were established from the Fortnite XMem DLL in #217 and #219. This change addresses how the emulator selects those implementations. I measured both calls through the release xmem.dll on Windows, with a fresh process for each configuration.
What was wrong
Both decisions used the GameInput build resolver directly. Setting TOMBOX_CONSOLE_OSBUILD or the corresponding console_os_build config key had no effect on them. A title could run with the console configured for 19041, yet pool requests rounded to 512 KiB and an invalid allocation-statistics query returned success and cleared the result fields.
Measurements
Each process set one byte of hysteresis for pool 11 and read it back. It also queried memory type 16 with a valid 32-byte output whose result words contained 5, 6 and 7.
The change
Use the existing console build resolver at both decision points. It already handles the console override, config file and fallback to the GameInput/title build. The existing per-process pool granule cache stays in place.
Tests
The isolated build 19041 unit test now supplies opposing console and GameInput overrides and exercises both exports for hysteresis before checking the invalid-type error and output preservation. The release XMem unit and integration suites passed. Local PR gate passed on two Rust files.
@omonkeyz on GitHub · 2026-11-23 13:45 UTC · original
Applied locally on main with your authorship kept (cherry-picked,
61ffabe); tests pass in a sandbox. It ships in the next release; this PR will be closed when that is pushed. Thanks.@kiwe147 on GitHub · 2026-11-23 19:15 UTC · original
Tested head
6ef2fce839, applied withgit apply(whitespace ignored, the line endings of my checkout differ) onmainf89e410, together with #210 (one tree; the PRs touch different files). It applied without conflicts and built.Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, NVIDIA GeForce RTX 3080 (driver 621.24), MSVC, Rust 1.91.1.
cargo test -p xmemNo new failure against
mainf89e410in any of these. This is one combined tree, not a run of this PR alone.AI-assisted: yes (Claude Code)
@omonkeyz on GitHub · 2026-11-25 13:09 UTC · original
Applied on main in
61ffabe(cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.Pull request closed