xmem: keep the space below 4 GiB for the title's 32-bit memory (port of VIctory#1009) #39
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/39"
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?
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by WHOISJARDAS on 2026-11-25T12:34:53Z.
On this machine (RX 9070 XT, Ryzen 7 9800X3D, Windows 11 26200) this fork's
4cbe9d7cannot start the title: it stops at the title's own assertion,0x80000003at+0x19f4f58, about 1 s in. This is Marvisak/VIctory#790: the title's 185 MB 32-bit placeholder (XMemVirtualAllocsize=193986560 kind=0x42000 flags=0x7) finds no room below 4 GiB, because the host's memory got there first. Here 2.3 GB of it was the AMD driver's shader cache files (%LOCALAPPDATA%\AMD\DxcCache\*.parc) mapped below 4 GiB, and Exploit protection's Bottom-up ASLR is off system-wide, so it happens on every start.This is a port of Marvisak/VIctory#1009 (NuraadGit, with MichaelSmithAI's bounded retry), the same change as Zettrox/ztrx#108:
xmem::low_guards::install()at the start ofrunreserves the free space below 4 GiB but the lowest 256 MB;XMemVirtualAllocreleases guards one at a time and retries, guarding again what stays free;warn(nothing was logged before);low_guards::tests::*(2).Tested
RX 9070 XT (driver 32.0.32029.2010), Series X profile, this README's settings:
4cbe9d7stopped at+0x19f4f58at start; with this, it starts and reaches the world (space below 4 GiB kept for the title guards=2 mb=3722).cargo test -p victory-hle --lib low_guards: 2 passedAI use: Claude Code (Claude Opus 5.5) ported the change and ran the checks; the hardware and runs are mine.
🤖 Generated with Claude Code
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by gut0to on 2026-11-27T14:49:34Z.
Code review location:
crates/victory-hle/src/modules/xmem.rs; line 1883Could the refused-retry test also assert last-error preservation? Its allocation closure currently returns null without setting an error, so the tests cover guard restoration but not that
retryrestores the finalVirtualAllocerror after the address queries and guard recreation. An injected closure can set a known error such asERROR_NOT_ENOUGH_MEMORY, then assertGetLastError()returns it after retry; the caller relies on this value when reporting exhaustion.Imported from Belobug/VIctory-Belobug-AMD. Originally posted by gut0to on 2026-11-27T14:49:34Z.
Review: COMMENTED
AI-assisted static review (ChatGPT); I inspected the retry tests but did not run them.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.