Recompiler: a constant multiplicand reaches dot4AddPacked as an immediate (misread by RTX 5070 / Intel Xe-LP drivers elsewhere; probe for RTX 50) #2463
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from ivall/xcl. Originally posted by KainanP on 2026-11-25T19:39:37Z.
Both backends pass a compile-time constant multiplicand of the 8-bit dot products straight into
dot4AddPacked. Two drivers have been seen to misread such an immediate in another project's translator. I could not reproduce it on the GPUs I have that run XCL, so this is a request for a run on an RTX 50-series card before anyone writes a fix.What XCL emits (
main2898511,dxc -dumpbinof the kernels, HLSL path andXCL_DIRECT_DXIL=1):v_dot4_i32_i8 v2, v0, 0x4000, v1→dot4AddPacked.i32(i32 163, i32 %acc, i32 %a, i32 16384)(HLSL path,recomp/emit.rs)v_dot4_u32_u8 v3, v0, 2, v1→dot4AddPacked.i32(i32 164, i32 %acc, i32 %a, i32 2)(HLSL path)v_dot8_u32_u4 v4, v0, 2, v1→ twodot4AddPacked(164, …, i32 2)/(…, i32 0)calls (direct DXIL,dxil/lower_wide.rs, since #2173)What was measured elsewhere (VIctory, a different translator, same DXIL shape):
dot4AddPacked(i32 163, i32 2147483632, i32 50526978, i32 16384)returnsacc − 128, RDNA 2 givesacc − 320, as if the driver fed the low half of the immediate into both halves (0x40004000). WARP is right. Marvisak/VIctory#18968086:a78b, driver 31.0.101.5445), my probe there: every constant multiplicand that fits in 16 bits (inline 1, 2, 64, −2, −16; literals0x4000,0x7F00,0xFF80,0xFFFF8000) is read as its low half repeated; the same values from root constants are right. Marvisak/VIctory#2408In XCL, on this laptop
SKIPPED … no wave64), and preflight refuses 16-lane GPUs, so the Intel half does not concern XCL.Probe: branch
KainanP/xcl:probe/dot4-constant-multiplicand(one commit onmain2898511, test only): 25 constants (inline integers, literals, inline floats) as one multiplicand ofv_dot4_i32_i8(src0 and src1),v_dot4_u32_u8,v_dot4c_i32_i8andv_dot8_u32_u4, the other operand and the accumulator from registers, checked against the RDNA 2 definition.It prints
N mismatchesand each wrong lane. If an RTX 50-series (or another) card shows mismatches, the fix VIctory#2408 uses would apply here: when a multiplicand is a known constant, sum its non-zero bytes times the other operand's bytes by hand and keepdot4AddPackedfor register operands. If nobody sees a mismatch, this can be closed.Not related to the world load as far as I know: a wrong dot product gives wrong values, not a stall.
AI use: Claude Code (Claude Opus 5.5) wrote the probe, ran it on the RTX 4060, Intel UHD and WARP here, read the DXIL and wrote this issue.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-26T20:21:20Z.
Tested the requested probe on an RTX 5070, driver 616.92, Ryzen 7 5700X3D, Windows build 26300.10075, Rust 1.100.0 MSVC, SDK DXC/DXIL 1.8.2502.11. The reporter's unmodified probe commit was
48618ec07e11e51858137c09f6e0b46cc20b7c25(parent2898511af1c038a2ef809719e9b6f89e5675c422).cargo test -p xcl --lib gpu_dot4_constant_multiplicands -- --nocapturereported the RTX 5070 adapter, wave32 and 0 mismatches: 1 passed, 0 failed, 0 ignored, no skips. Repeating withXCL_DIRECT_DXIL=1gave the same result. The probe covers 25 constants across five forms and four lanes (500 comparisons per backend). This driver/configuration did not reproduce the reported behavior; other drivers were not tested.AI use: OpenAI Codex with GPT-6.2 Astra ran the tests and reported results; Codex coordinated and prepared this summary.
Imported from ivall/xcl. Originally posted by KainanP on 2026-11-28T06:29:02Z.
Re-ran the probe on current
main(e429936c; the probe commit rebased onto it with no conflicts) on the three adapters in this laptop, with the HLSL path (XCL_DIRECT_DXIL=0) and direct DXIL (XCL_DIRECT_DXIL=1), selecting each withXCL_ADAPTER. Windows build 26200, DXC/DXIL 1.8.2502.11, Rust 1.97.0 MSVC.10de:28a0)8086:a78b)SKIPPED … no wave64SKIPPED … no wave64SKIPPED … no wave64SKIPPED … no wave64The Intel UHD and WARP results are skips, not passes: their waves are narrower than the 32/64 lanes XCL's GPU tests need, and preflight refuses those GPUs anyway, so the Intel driver behaviour seen in VIctory#2408 cannot reach XCL.
With @andrewDoing's RTX 5070 (driver 616.92: 0 mismatches on both backends) and the RTX 4060 here, no GPU that can run XCL has reproduced the misread, including the RTX 50 card this issue asked for. Closing as not reproduced; if a mismatch shows up on another driver (RDNA 2 was the other one seen in VIctory#1896), the probe branch still applies and the issue can be reopened with its output.
AI use: Claude Code (Claude Opus 5.5) rebased the probe, ran it on the three adapters and wrote this comment.