recomp: memory window from the full 64-bit address (carry out of the low dword) #123
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!123
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/123/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?
@gefydev on GitHub · 2026-11-23 13:29 UTC · original
gefydev:recomp-window-carry→main· +93 −13 · 2 files · 1 commits · merged 2026-11-23 14:13 UTC#105 item 3.
With more than one memory window, several access kinds picked the window from the base's high dword before the offsets were added:
s_load_*,s_buffer_load_*);If an offset carried out of the low dword, the access went to the base's window at the wrapped low address. A negative global offset that borrowed had the same problem.
image_bvh*_intersect_rayalready did this right.The new
window_atadds the low dword and the offsets in 64 bits and moves the window by the carry. The V#stride * indexproduct is 64-bit too, and the signed SMEM / global offsets are sign-extended. With one window it emits nothing, so the single-window HLSL and its DXIL cache are unchanged.gpu_memory_windows_above_4_gibstill checks that and still passes. With several windows thexcl_w =line now comes after the address computation instead of before it.Not changed: the GS vertex input (
xcl_vin) is still a 32-bit offset in window 0. It is XCL's own staging, not a title address.Test
gpu_memory_window_carry, run in a 2-window UMA arena: the base sits at0xFFFF_F000of window 0, and s_load, s_buffer_load, buffer load / store, global load with SADDR and a global atomic each reach window 1 through their offset. Without the change it fails (the s_load reads 0 from window 0). With it, it passes on a GTX 1650 under Wine, and so do the other lib tests that run there. I did not test the borrow case: in this arena, window 0 maps only its first MiB, so a borrow has nothing valid to land on.@ivall on GitHub · 2026-11-23 14:14 UTC · original
This one had to come out again (merged with the batch, then reverted in
70f8dc4– sorry for the noise, GitHub will show it as merged). With it, XDefiant crashes ~10 s in inside AMD's shader compiler:unhandled exception 0xc0000005 in amdxc64.dll+0xe8f875 (write at address 0x2000000c), while creating the pipeline of a compute shader (8e4af296b9d7fd9c, 2 552 RDNA2 instructions, 4 memory windows). Deterministic; reverting only #123 runs. So the HLSL is valid but its shape (likely the 64-bit address arithmetic before the window switch at every access) trips the AMD driver. If you want to retry: emitting the carry only where an offset can actually cross the dword (immediate/SGPR offsets that are not provably small), or computing it in 32 bits with an explicit carry compare instead ofuint64_t, might avoid it – please open a new PR; I can run the XDefiant check on the RX 9070.