fix(shader): lower f16 NLE comparisons through swapped unordered less… #399

Merged
boykopovar merged 2 commits from upstream-pr/399 into main 2026-10-02 19:06:31 +00:00
boykopovar commented 2026-10-02 18:20:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by boykopovar on 2026-10-02T18:20:20Z.


Translate VCmpNleF16 and VCmpxNleF16 to FPUnordLessThan32 with reversed operands. Apply operand conversion and source modifiers before swapping. Extend agc_driver_vopc_compare to cover all 144 pairs from the existing f16 edge-value table. Preserve the original input set and expected results. This change targets the intermittent Linux/lavapipe comparison failure. The root cause and effectiveness on lavapipe remain unverified.

Run each test three times without rebuilding; any failed run fails CI.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4719906194 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/399). Originally posted by [boykopovar](https://github.com/boykopovar) on 2026-10-02T18:20:20Z. --- Translate VCmpNleF16 and VCmpxNleF16 to FPUnordLessThan32 with reversed operands. Apply operand conversion and source modifiers before swapping. Extend agc_driver_vopc_compare to cover all 144 pairs from the existing f16 edge-value table. Preserve the original input set and expected results. This change targets the intermittent Linux/lavapipe comparison failure. The root cause and effectiveness on lavapipe remain unverified. Run each test three times without rebuilding; any failed run fails CI.
oneandonlydean commented 2026-10-03 02:47:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-03T02:47:45Z.


A heads-up: I suspect agc_driver_vopc_compare became intermittent on the Linux CI runner (llvmpipe) after this change. It fails with thread 1 compare 39 is 0, expected 1; compare 39 is the f16 NLE case (!(ha <= hb)). I have seen it on three unrelated PRs (#290 run 37075919674, #312 run 37071265405, #407 run 37065871874), while main passed at 7d40a57d, so it does not fail every time. I have not reproduced it locally (my test runs use an NVIDIA GPU), so this may be llvmpipe behaviour rather than the lowering itself.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5964789931 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/399#issuecomment-5964789931). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-03T02:47:45Z. --- A heads-up: I suspect `agc_driver_vopc_compare` became intermittent on the Linux CI runner (llvmpipe) after this change. It fails with `thread 1 compare 39 is 0, expected 1`; compare 39 is the f16 NLE case (`!(ha <= hb)`). I have seen it on three unrelated PRs (#290 run 37075919674, #312 run 37071265405, #407 run 37065871874), while `main` passed at 7d40a57d, so it does not fail every time. I have not reproduced it locally (my test runs use an NVIDIA GPU), so this may be llvmpipe behaviour rather than the lowering itself.
oneandonlydean commented 2026-10-03 19:32:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-03T19:32:32Z.


Found the cause of the intermittent compare 39 failure: it is an LLVM 20 x86 backend bug in lavapipe on Xeons with AVX512-FP16 (Granite and Emerald Rapids runners fail every time, EPYC and Ice Lake pass), not this change. Details and a one-line CI fix in #477.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5972744216 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/399#issuecomment-5972744216). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-03T19:32:32Z. --- Found the cause of the intermittent `compare 39` failure: it is an LLVM 20 x86 backend bug in lavapipe on Xeons with AVX512-FP16 (Granite and Emerald Rapids runners fail every time, EPYC and Ice Lake pass), not this change. Details and a one-line CI fix in #477.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!399
No description provided.