From 466b75c54d3e28b3895c491b1ccef43b38f2db4d Mon Sep 17 00:00:00 2001 From: Pipodi Date: Mon, 30 Nov 2026 07:39:15 +0100 Subject: [PATCH] Tests: name the trailing VGPRs in the D16 resinfo kernel test gpu_direct_image_get_resinfo_d16 fails on main on a GPU since 43c56dce (#3495): "2D D16 resinfo clobbered v2/v3", left (0, 0). The test kernel loads and stores only the registers its instructions name (dxil/kernel.rs, `touched`). Until 43c56dce, `rdna2::vgpr_uses` took an image instruction's VDATA from the spec's 128-bit operand, so the two `image_get_resinfo` named v0..v3 and v4..v7 and the kernel carried v2/v3/v6/v7 from the input state to the result. Since then `mimg_vgpr_uses` gives a D16 result its two VGPRs, the trailing ones are never stored, and the result buffer reads 0 for them. The translation is unchanged and does not write them. The test now names v2, v3, v6 and v7 with self-moves after the two queries, so the kernel carries them and a query that wrote four VGPRs would still fail the assertions. CI has no GPU and returns before the run, which is why main's CI is green. Co-Authored-By: Claude Fable 5.2 --- crates/xcl/src/gpu/dxil/msaa_tests.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/xcl/src/gpu/dxil/msaa_tests.rs b/crates/xcl/src/gpu/dxil/msaa_tests.rs index 296c2814a5..554f0bbe51 100644 --- a/crates/xcl/src/gpu/dxil/msaa_tests.rs +++ b/crates/xcl/src/gpu/dxil/msaa_tests.rs @@ -311,6 +311,11 @@ fn gpu_direct_image_get_resinfo_d16() { // T# 0: 2D 64x32 R32_UINT (s[16:23], SRSRC 4); T# 1: 2D MSAA array 4x4x3 (s[24:31], SRSRC 6) code.extend(mimg("IMAGE_GET_RESINFO", &[("VDATA", 0), ("VADDR", 10), ("SRSRC", 4), ("DMASK", 0xF), ("DIM", 1), ("D16", 1)])); code.extend(mimg("IMAGE_GET_RESINFO", &[("VDATA", 4), ("VADDR", 10), ("SRSRC", 6), ("DMASK", 0xF), ("DIM", 7), ("D16", 1)])); + // the kernel loads and stores only the registers its instructions name, and a D16 resinfo + // names its two result VGPRs (`rdna2::vgpr_uses`): self-moves name the trailing ones + for r in [2u64, 3, 6, 7] { + code.extend(encode("V_MOV_B32", "ENC_VOP1", &[("VDST", r), ("SRC0", 256 + r)], None).unwrap()); + } code.extend(encode("S_ENDPGM", "ENC_SOPP", &[], None).unwrap()); if !gpu_ready() { return;