agc_driver_vopc_compare_table fails in wave32 for LG compares in the e32 encoding on AMD RDNA 3.5 #825
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 LeandroLP23 on 2026-10-06T07:45:25Z.
agc_driver_vopc_compare_tablefails in the wave32 run on an AMD RDNA 3.5 GPU:With the check turned into a log of every mismatch, all of them are LG compares in the e32 encoding of the wave32 run, on rows with a NaN operand:
The same compares pass in their e64 encoding, and the wave64 and wave64 split runs pass entirely.
VCmpLgF32is lowered toFPOrdNotEqual32and emitted asOpFOrdNotEqual, and the module declaresSignedZeroInfNanPreserve, so the difference between the e32 and e64 paths in wave32 has not been found yet.Environment
mainat481c85e7, Release, MinGW-w64 GCC 15.2.0 (WinLibs r7), Windows 11 Home 10.0.26300Reproduce
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-06T08:02:07Z.
Narrowed down on the same machine:
FPOrdNotEqual32; the only difference is that the e32 result goes throughBallot(VCC as a lane mask) and is read back by lane, while the e64 result feeds aSelect.OpFOrdNotEqual, asFOrdLessThan || FOrdGreaterThan, asFUnordNotEqual && !IsNan(a) && !IsNan(b), or as(select(lt,1,0) | select(gt,1,0)) != 0gives the same wrong 1 on the NaN rows, only through the ballot in the wave32 run.LTandGTalone pass through the same path, and a constant false reads back correctly.FUnordNotEqual(a, b) && (bits(a) & 0x7fffffff) <= 0x7f800000 && (bits(b) & 0x7fffffff) <= 0x7f800000, makes the test pass, f16 LG included, with no other test changing.This points to the AMD driver's shader compiler folding any float form of ordered not-equal and miscompiling it when it feeds a ballot on a 32-wide subgroup, rather than to the recompiler's SPIR-V. The integer form above avoids it at the cost of a few ALU ops per LG compare on every GPU; I can open a PR with it if that workaround is wanted.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T08:26:30Z.
The integer check gives the same result as
OpFOrdNotEqualfor every input, so a PR with it is fine. Please put the driver version and the failing rows in the description, and the same tests run on another GPU.Imported from boykopovar/AnyPS5. Originally posted by tezzgod74 on 2026-10-09T04:53:38Z.
Same failure on RDNA 4, with the same three rows. An RDNA 2 iGPU in the same machine passes.
With the check turned into a log of every mismatch, as in the comment above:
The e64 encodings, wave64 and wave64 split pass on both devices.
ANYPS5_GPURX 9060Radeon(TM) GraphicsThe rows match the RDNA 3.5 report exactly, and the RDNA 2 device passes the same SPIR-V. That fits a driver compiler issue on RDNA 3 and later, not a recompiler one. I can rerun the integer-NaN form on both devices once it's in a PR.
Environment:
mainat79d23eb7, Release, MinGW-w64 GCC 15.2.0 (WinLibs r7), Windows 11 Pro 10.0.26300, wave32 compute on 32-wide subgroups.Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-09T07:13:34Z.
The integer-NaN form is already in #1473. A run of
agc_driver_vopc_compare_tablewith it on both devices would be very useful; I'll add the results to the description.