Repository navigation
Conversation
VirtualAllocEx forwarded every call to Windows' VirtualAllocEx with the console's allocation flags sanitised, so for this process - the title's own memory - MEM_GRAPHICS was dropped and the title got a plain reservation the GPU has no address for. VirtualAlloc is where the console's memory comes from: placeholders, the sparse windows, video memory in the unified region, 64 KiB pages, the write-watched graphics fallback. VirtualFreeEx already routed this process back to VirtualFree for exactly those allocations; the allocation side did not. Route VirtualAllocEx(GetCurrentProcess(), ...) to VirtualAlloc, as VirtualFreeEx does to VirtualFree. Assisted-by: OpenCode (Gemini 4 Neon)
1475636 to
c702d7d
Compare
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Test report for exact head Tested
main: PR: Not tested: AMD, the head merged onto current AI use: Claude Code (Claude Opus 5.5) ran this and wrote the report; the diff was read for safety by a Claude Opus 5.5 sub-agent before it was built. |
|
Two contributors checked independently and found that this PR makes the same change as #1564 (for #1488): #1607, group D91. They suggest keeping #1564. If you agree, closing this PR or joining the other one would save the maintainers a review. If the two differ in a way the checks missed, a note in #1607 helps. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table. |
Addresses
XCL-BT-030from #1488.VirtualAllocExforwarded every call to Windows with the console's allocation flags sanitised — forGetCurrentProcess(), which is the title's own memory, that meantMEM_GRAPHICSwas dropped and the title got a plain Windows reservation the GPU has no address for.VirtualAllocis where the console's memory actually comes from: placeholders, the sparse windows, video memory in the unified region, 64 KiB pages, and the write-watched graphics fallback.VirtualFreeExalready routes this process back toVirtualFreefor exactly those allocations (kernelx.rs:454-464) — the allocation side did not match.This routes
VirtualAllocEx(GetCurrentProcess(), …)toVirtualAlloc, the same wayVirtualFreeExroutes toVirtualFree.What is in it
crates/xcl/src/hle/kernelx.rs:VirtualAllocExsends this process toVirtualAlloc; other processes stay Windows'VirtualAllocEx. Testvirtual_alloc_ex_for_this_process_is_the_titles_allocator(aMEM_RESERVE | MEM_GRAPHICSallocation must be inside the unified region or a sparse window, thenVirtualFreeExreleases it).Evidence it fails without the fix:
VirtualAllocEx(GetCurrentProcess()) must land in the title's memory, got 0x25c95970000— a host reservation with the graphics flag dropped; with the fix it is a sparse-window/unified address andtest result: ok.Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 893 passed, 0 failed, 42 ignored (SKIPPED: 2no wave64; 1no heap windows; 1cannot disable the driver cache (Windows Developer Mode is required))cargo test -p xcl --lib virtual_alloc_ex_for_this_process: 1 passed, 0 failedRegression run
main (
e9e94ce, clean tree, no local changes):PR (
c702d7d, clean tree, no local changes):Not tested
VirtualAllocEx(GetCurrentProcess(), …)for a normal (non-graphics) allocation and then writes to it before committing (the unified/sparse path handles commits, but no game here was traced doing it)AI use
XCL-BT-030againstVirtualAlloc/VirtualFreeEx, wrote the fix and test (and confirmed it fails without it), rebased ontoe9e94ce, ran the test suite andscripts/smoke.ps1regression runs with Scripts: smoke blocks print the game folder's name #677's title hashing, and drafted this PR description.