From 9461cf727ab94c30dfc864adc83efe898a6946a1 Mon Sep 17 00:00:00 2001 From: LucasHoepfner <150492753+LucasHoepfner@users.noreply.github.com> Date: Mon, 23 Nov 2026 23:28:00 -0300 Subject: [PATCH 1/2] Tests: the sparse VRAM test's scalar loads take no register offset gpu_sparse_vram_descriptors_buffers_and_xmem left SOFFSET unset on its three S_LOAD_DWORD* instructions. The field is then 0, which is s0, so every load added s0: the low half of arg_table's address. That is 0 only while arg_table is the first allocation in the coherent window. After an earlier uma.alloc (placed_title_textures_share_vram_and_preserve_pixels takes 16 MiB there) the descriptor loads read s0 bytes past the heap and out_buf stayed 0: "submit 1 lane 0 mismatch", left 0, right 1077. They now pass SOFFSET = 125 (no register), as the other SMEM tests do. Part of #343 Assisted-by: Claude Code (Claude Fable 5.2) --- crates/xcl/src/gpu/recomp/tests.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/xcl/src/gpu/recomp/tests.rs b/crates/xcl/src/gpu/recomp/tests.rs index 596a74198..0660088f7 100644 --- a/crates/xcl/src/gpu/recomp/tests.rs +++ b/crates/xcl/src/gpu/recomp/tests.rs @@ -3259,10 +3259,10 @@ fn gpu_sparse_vram_descriptors_buffers_and_xmem() { // Translate + DXC-compile RDNA2 compute shader (4 windows, 32-bit descriptor table with hi = 0) let p = prog(&[ - ("S_LOAD_DWORD", "ENC_SMEM", &[("SDATA", 20), ("SBASE", 0), ("OFFSET", 0)], None), // s[0:1] -> Window 3 root arg table + ("S_LOAD_DWORD", "ENC_SMEM", &[("SDATA", 20), ("SBASE", 0), ("OFFSET", 0), ("SOFFSET", 125)], None), // s[0:1] -> Window 3 root arg table ("S_MOV_B32", "ENC_SOP1", &[("SDST", 5), ("SSRC0", 128)], None), // s5 = 0 (32-bit descriptor table pointer) - ("S_LOAD_DWORDX4", "ENC_SMEM", &[("SDATA", 8), ("SBASE", 2), ("OFFSET", 0)], None), // s[4:5] + 0 -> Window 0 sparse desc slot 0 - ("S_LOAD_DWORDX4", "ENC_SMEM", &[("SDATA", 12), ("SBASE", 2), ("OFFSET", 32)], None), // s[4:5] + 32 -> Window 0 sparse desc slot 1 + ("S_LOAD_DWORDX4", "ENC_SMEM", &[("SDATA", 8), ("SBASE", 2), ("OFFSET", 0), ("SOFFSET", 125)], None), // s[4:5] + 0 -> Window 0 sparse desc slot 0 + ("S_LOAD_DWORDX4", "ENC_SMEM", &[("SDATA", 12), ("SBASE", 2), ("OFFSET", 32), ("SOFFSET", 125)], None), // s[4:5] + 32 -> Window 0 sparse desc slot 1 ("BUFFER_LOAD_DWORD", "ENC_MUBUF", &[("VDATA", 1), ("VADDR", 0), ("SRSRC", 2), ("SOFFSET", 128), ("IDXEN", 1)], None), ("V_ADD_NC_U32", "ENC_VOP2", &[("VDST", 2), ("SRC0", 20), ("VSRC1", 1)], None), ("BUFFER_STORE_DWORD", "ENC_MUBUF", &[("VDATA", 2), ("VADDR", 0), ("SRSRC", 3), ("SOFFSET", 128), ("IDXEN", 1)], None), From 0fb9f4a11948234945715726ffd035fdf624e597 Mon Sep 17 00:00:00 2001 From: LucasHoepfner <150492753+LucasHoepfner@users.noreply.github.com> Date: Mon, 23 Nov 2026 23:28:13 -0300 Subject: [PATCH 2/2] Tests: the sparse VRAM and UMA import tests take the backend's device gpu_sparse_vram_descriptors_buffers_and_xmem and gpu_uma_import_check_at_init called real::init() directly, the only callers besides d3d12x::backend(). Two first calls at once each open the UMA windows, and the second replaces the sparse state the first test is using: the mismatch beside gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes, and the way the suite reaches the deadlock of #344. backend() initialises once. The change was first described by CryingLaughing in #343. Fixes #343 Assisted-by: Claude Code (Claude Fable 5.2) --- crates/xcl/src/gpu/recomp/tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/xcl/src/gpu/recomp/tests.rs b/crates/xcl/src/gpu/recomp/tests.rs index 0660088f7..b4e3a3530 100644 --- a/crates/xcl/src/gpu/recomp/tests.rs +++ b/crates/xcl/src/gpu/recomp/tests.rs @@ -3191,7 +3191,7 @@ fn gpu_uma_import_check_at_init() { if !gpu_ready() { return; } - crate::hle::d3d12x::real::init().expect("real D3D12.X backend"); + assert_eq!(crate::hle::d3d12x::backend(), crate::hle::d3d12x::Backend::Real, "real D3D12.X backend"); let s = crate::hle::d3d12x::real::stats().uma_import_check; assert!(s.starts_with("ok") || s.starts_with("off"), "{s}"); } @@ -3213,7 +3213,7 @@ fn gpu_sparse_vram_descriptors_buffers_and_xmem() { if !gpu_ready() { return; } - crate::hle::d3d12x::real::init().expect("real D3D12.X backend"); + assert_eq!(crate::hle::d3d12x::backend(), crate::hle::d3d12x::Backend::Real, "real D3D12.X backend"); let u = crate::gpu::uma::get().expect("UMA"); assert_eq!(u.shader_windows(), 4, "runtime layout has 4 shader windows"); assert!(u.is_sparse_window(0) && u.is_sparse_window(1) && u.is_sparse_window(2), "windows 0..2 sparse VRAM");