AGC: agc_driver_mul_lo_u16_high_half fails on AMD's Windows driver since #7673 #8271
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 boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-20T07:58:46Z.
What
agc_driver_mul_lo_u16_high_halffails onmainon an RX 6700 XT with AMD's Windows driver, 3 of 3 runs, since #7673:The emitted SPIR-V looks correct. The store gets the full 32-bit product, as if the driver's compiler dropped the
& 0xffff.Measured
RX 6700 XT (gfx1031), AMD's Windows driver 32.0.21045.5002, Windows 11 26200, Release,
ANYPS5_REQUIRE_VULKAN=1. Each row ran 3 times; the test stops at its first failing case.maina98590decmaina98590decwith #7673 reverted (git revert -m 1 1b0ff1e15)maina98590decwithvMulLoU16taking the low half asBitFieldUExtract(product, 0, 16), or as au16truncation then zero-extension& 0xffff, so the driver gets the same module and these say nothing newThe full suite fails it on
maintoo, alongside the knownlog_macrospair andagc_driver_msaa_dcc_clear_4.The module
Dumped with
APS5_DUMP_COMPUTE_PIPELINES, the masked-factors case of the test (v_and_b32of both factors and of the destination with 0xffff, thenv_mul_lo_u16).On
main, #7673 folds the 24-bit factor extracts away, since the factors are already masked to 16 bits:For x = y = 0xffffffff this is
0 | (0xfffe0001 & 0xffff)= 1, but the GPU stores 0xfffe0001. With #7673 reverted, the factors stayOpBitFieldUExtract %393 0 24, and the result is right:No
NoUnsignedWrap/NoSignedWrapdecorations are on these ids. So I think the driver's compiler, given a product of two factors it knows are 16-bit, treats the product as 16-bit and drops the mask. That would be an AMD compiler bug that #7673 exposes, not a folder bug. I haven't dumped the driver's ISA to confirm it, and I haven't run other drivers. The other three cases of the test (unmasked factors, a chain, a kept high half) pass onmainhere; the two packed cases after the failing one don't run.Options
vMulLoU16andvPkMulLoU16out of #7673'sBitFieldUExtractfold. The pre-#7673 form passes here, and it is what the hardware does (#7018).& 0xffff.@tibzejoker, could you check whether NVIDIA or RADV pass this test on current
main? That would show whether only AMD's Windows compiler is affected.Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-20T08:05:50Z.
A structural diff of the two dumped modules for this case (ids renumbered, names and decorations dropped) shows they are the same program except for this spot. The address arithmetic, bounds checks and store are the same instructions, shifted by 3 ids:
%152and%153are already& 0xffff, so the extracts and the second mask change nothing, and the two modules compute the same value. On this driver the first stores 0xfffe0001 and the second 1. So the difference comes from the driver's compiler, not from the module.Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-20T08:24:34Z.
Closing as a duplicate of #8266, which reported the same failure first. The root cause and fix are in #8266 and #8280.
Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-20T08:55:33Z.
Reopening: I closed this as a duplicate of #8266 at the same moment @oneandonlydean closed #8266 as a duplicate of this one. Keeping this one open as the canonical issue; #8266's RDNA 2 iGPU result stays linked there. The fix is #8280.