kernelx: VirtualAllocEx for this process is the title's allocator #1796
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1796
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1796"
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?
@b3IKK on GitHub · 2026-11-24 20:52 UTC · original
b3IKK:kernelx/virtualallocex-title-memory→main· +29 −0 · 1 files · 1 commits · openAddresses
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 #677's title hashing, and drafted this PR description.@b3IKK on GitHub · 2026-11-24 21:15 UTC · original
Rebased onto
e9e94ce(which also brought #677's anonymised itle: line into scripts/smoke.ps1) and re-ran the test suite and both smoke runs: 893 passed, 0 failed, 42 ignored; blocks pasted above are from the new script.@futurepro62 on GitHub · 2026-11-24 21:31 UTC · original · edited 2026-11-24 22:20 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
c702d7d(on its basee9e94ce).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip pso_measurement_compiles_an_exact_synthetic_record: 891 passed, 0 failed, 42 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.virtual_alloc_ex_for_this_process_is_the_titles_allocator.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 893 passed, 0 failed, 42 ignored. SKIPPED:heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipon NVIDIA. Both fail on main7f7e768too, not because of this PR: underXCL_REQUIRE_GPU=mesh,runner::skip_testturns their skips into failures.heap_window_out_of_memory_falls_back_to_the_switch_formskips whenXCL_HEAP_WINDOWSis unset (#1651), andshaders::tests::pso_measurement_compiles_an_exact_synthetic_recordskipped because Developer Mode was off. Developer Mode was turned on before the AMD run, and therepso_measurement_compiles_an_exact_synthetic_recordran and passed.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-24 23:41 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored.Thanks!
@throny on GitHub · 2026-11-25 09:55 UTC · original
Test report for exact head
c702d7d.Tested
cargo build --workspace && cargo test --workspace -- --test-threads=4onc702d7das it is (its own base): 893 passed, 0 failed, 42 ignored.SKIPPED: 4 lines (no wave64 on this adapter, and the like).scripts/smoke.ps1, the retail title, 60 s, release builds,main568e7dbfirst, then this head:main:
PR:
Not tested: AMD, the head merged onto current
main, a world load.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.
@throny on GitHub · 2026-11-26 08:08 UTC · original
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.
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.