From 833ebaeca1cc84121a473f88c09fa718dc9581d1 Mon Sep 17 00:00:00 2001 From: luckyteagirl <290248872+luckyteagirl@users.noreply.github.com> Date: Thu, 26 Nov 2026 22:12:44 -0800 Subject: [PATCH] Tests: bind the sampler heap before setting the arena root signature The shared compute ABI root signature requests direct indexing for both descriptor heap types. The arena harness bound only the resource heap, violating the root-signature binding contract and reproducing a driver access violation on RX 6800M. Assisted-by: OpenAI Codex (GPT-6.2 Sol) --- crates/xcl/src/gpu/recomp/runner.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/crates/xcl/src/gpu/recomp/runner.rs b/crates/xcl/src/gpu/recomp/runner.rs index 34b5c65201..647f23b356 100644 --- a/crates/xcl/src/gpu/recomp/runner.rs +++ b/crates/xcl/src/gpu/recomp/runner.rs @@ -1544,7 +1544,17 @@ fn run_in_region(dxil: &[u8], state: &KernelState, arena: &Arena) -> Result, Some(&raw_window_uav(size as u64)), h); } - list.SetDescriptorHeaps(&[Some(dh.clone())]); + // The ABI root signature directly indexes both heap types, even for tests + // whose shaders have no samplers. Bind both before setting the signature. + let sampler_heap: ID3D12DescriptorHeap = dev + .CreateDescriptorHeap(&D3D12_DESCRIPTOR_HEAP_DESC { + Type: D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER, + NumDescriptors: 1, + Flags: D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE, + NodeMask: 0, + }) + .map_err(e)?; + list.SetDescriptorHeaps(&[Some(dh.clone()), Some(sampler_heap.clone())]); list.SetComputeRootSignature(&gpu.rs); list.SetComputeRootUnorderedAccessView(0, io_buf.GetGPUVirtualAddress()); list.SetComputeRootUnorderedAccessView(1, res_buf.GetGPUVirtualAddress());