Recompiler: range-check UMA memory windows and propagate 64-bit carry/borrow #792
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!792
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/792/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?
@gsucristo on GitHub · 2026-11-24 05:33 UTC · original
gsucristo:recomp/uma-window-bounds-and-carry→main· +306 −76 · 6 files · 1 commits · merged 2026-11-24 05:57 UTCRange-check multi-window UMA address selection and compute 64-bit effective addresses before selecting
xcl_w, so out-of-UMA high dwords cannot alias live windows viahi & 3uand 32-bit offsets carry/borrow across 4 GiB window boundaries. Part of #105.What is in it
crates/xcl/src/gpu/recomp/mod.rs,runner.rs,crates/xcl/src/hle/d3d12x/bind.rs,console_list.rs: passUma::base() >> 32viaIO_UMA_BASE_HI(ioslot 112).crates/xcl/src/gpu/recomp/emit.rs: loadxcl_uma_basefromio, compute 64-bit effective addresses across SMEM, MUBUF/MTBUF, FLAT/GLOBAL (including_addtid, atomics, and BVH) whenmem_windows > 1, splitwindow_read(hi == 0maps to window 0 for 32-bit descriptor tables) vswindow_write(dropshi == 0and out-of-range high dwords), and makemem_accessorsdefaultarms return 0 / drop stores and atomics instead of aliasingmem.crates/xcl/src/gpu/recomp/tests.rs: addgpu_memory_windows_reject_out_of_uma_aliasingcovering out-of-UMA reads/writes/atomics,hi == 0read vs write, stridedV#high-dword masking, 64-bit carry across window 0→1, and signed borrow below window 0; populateIO_UMA_BASE_HIingpu_sparse_vram_descriptors_buffers_and_xmem.Tested
rustc 1.98.1(x86_64-pc-windows-msvccross-compile), debug.cargo test --workspace --no-fail-fast --target x86_64-pc-windows-msvc -- --test-threads=4 --skip a_freed_block_is_decommitted_before_its_address_is_reused: 700 passed, 4 failed (pre-existing Wine-only failures:hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime,test_title_runs_and_game_folder_is_untouched,disk_free_space_ex_reports_pls_quota,set_predication_buffer_state_and_kickoff), 41 ignored, 1 filtered (a_freed_block_is_decommitted_before_its_address_is_reused, aborts under WineMEM_DECOMMITstress).SKIPPEDGPU tests:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64).gpu_memory_windows_reject_out_of_uma_aliasing,gpu_memory_windows_above_4_gib,gpu_mesh_mode_reads_memory_windows,gpu_bvh64_intersect_ray_across_memory_windows_and_grazing,gpu_sparse_vram_descriptors_buffers_and_xmem.Regression run
scripts/smoke.ps1runs on a retail title (Linux/Proton environment only).Not tested
scripts/smoke.ps1retail regression run.AI use
@eizispark on GitHub · 2026-11-24 05:41 UTC · original
Hardware check of
f9e5ee986081c83ec594f60f56b0ae4ade6b9210(verified clean merge withmaine50836b): pass.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profilecargo test --workspace -- --test-threads=4:705 passed, 0 failed, 41 ignored(GPU tests skipped on this adapter:none; all tests includinga_freed_block_is_decommitted_before_its_address_is_reusedande2eran unfiltered)gpu_memory_windows_reject_out_of_uma_aliasing,gpu_memory_windows_above_4_gib,gpu_mesh_mode_reads_memory_windows,gpu_bvh64_intersect_ray_across_memory_windows_and_grazing,gpu_sparse_vram_descriptors_buffers_and_xmem: all passed on native RDNA4 wave64Regression run
main(f4ce27c):PR (
f9e5ee9):Not tested
AI use
scripts/smoke.ps1harness on this machine and formatted this report.@MesshM on GitHub · 2026-11-24 05:51 UTC · original
Test run of
f9e5ee986081c83ec594f60f56b0ae4ade6b9210on AMD RDNA4. I merged it onto currentmaine50836blocally (clean merge).Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 705 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 664 passed, 0 failed, 21 ignoredSKIPPED;gpu_memory_windows_reject_out_of_uma_aliasing,gpu_memory_windows_above_4_gibandgpu_mesh_mode_reads_memory_windowspass.Review: Computing the 64-bit effective address before selecting the window, and range-checking it against the UMA base, stops an out-of-UMA high dword from aliasing a live window through
hi & 3uand lets 32-bit offsets carry across a 4 GiB boundary. I reviewed the emitter change, not every caller of the newioslot.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 ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.