From 2afbcef3c0e998cd806461dc07af1b666ea243e0 Mon Sep 17 00:00:00 2001 From: fiestorra Date: Sun, 29 Nov 2026 21:39:36 +0100 Subject: [PATCH] runner: skip the exact exp2 case on Apple's Paravirtual device That device's OpExp2 lands two ulps low on 2^-125, so the bit-exact fixture cannot hold there; real Apple hardware returns the exact pattern (M5 Max, MoltenVK 1.4.2, passes the same case), which is why this skips by device instead of widening the check for everyone. The skip reads the device line the harness already prints beside the subgroup line that wide_pixel_skip reads, so it needs no new plumbing. Written with an AI assistant. --- runtime/test/shaders/check.py | 15 +++++++++++++++ scripts/run_gpu_tests.py | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/runtime/test/shaders/check.py b/runtime/test/shaders/check.py index 1166ff4571..cae196ae6e 100644 --- a/runtime/test/shaders/check.py +++ b/runtime/test/shaders/check.py @@ -2062,6 +2062,21 @@ def wide_pixel_skip(name, out): return Skip(f"SKIP (this device cannot require a {want}-wide fragment subgroup{seen})") +def paravirtual_exp2_skip(name, out): + """A Skip for the exact-power-of-two exp2 case on Apple's Paravirtual device, else None. + + That device's OpExp2 lands two ulps low on 2^-125 (measured on the CI runner), while real Apple hardware returns the + exact pattern (measured on an M5 Max with MoltenVK 1.4.2). So the case is judged wherever the device can be exact and + skipped where it cannot, rather than given a tolerance that would weaken it everywhere. + """ + if name != "ps_exp_f32_denorm_rt": + return None + m = re.search(r"^device: (.*)$", out, re.MULTILINE) + if not m or "Paravirtual" not in m.group(1): + return None + return Skip("SKIP (Apple Paravirtual: OpExp2 lands two ulps low on 2^-125, real Apple hardware is exact)") + + def f32(x): """x rounded to the nearest float32. One double add or multiply of two float32 values, then this, is the exact IEEE float32 result, so a model built from it matches the GPU bit for bit.""" diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py index c3b73d0985..2cc7e3a867 100644 --- a/scripts/run_gpu_tests.py +++ b/scripts/run_gpu_tests.py @@ -56,6 +56,7 @@ from check import NAN_PAYLOAD_TEST, nan_payload_problem from check import GET_LOD_TESTS, STORE_WORDS, get_lod_test, store_words_problem # TEST-184: image atomics and queries from check import wide_pixel_skip # ps_w64x_readlane: judged only where the fragment stage was required 64-wide +from check import paravirtual_exp2_skip # ps_exp_f32_denorm_rt: judged only where OpExp2 is exact on 2^-125 from check import FMA_FUSED_ENV, judge_fma_fused # cs_fma_fused: strict under LEONIDA_FMA=khr, fused/split under glsl from check import bary_persp_problem # ps_persp_bary's perspective-correct reference @@ -1655,6 +1656,9 @@ def run_suite(a, work: str) -> int: if skip := wide_pixel_skip(name, msg): # a 64-wide pixel stage the device could not give: nothing to judge results.append((name, None, str(skip))) continue + if skip := paravirtual_exp2_skip(name, msg): # Apple Paravirtual: OpExp2 is two ulps low on 2^-125 + results.append((name, None, str(skip))) + continue if name in const_wants: if name == "ps_vcmpx_forms" and (skip := vcmpx_forms_narrow_skip(msg)): ok, detail = None, str(skip)