diff options
| author | WHOISJARDAS <144918410+WHOISJARDAS@users.noreply.github.com> | 2026-11-22 08:54:48 +0000 |
|---|---|---|
| committer | WHOISJARDAS <144918410+WHOISJARDAS@users.noreply.github.com> | 2026-11-22 15:36:20 +0000 |
| commit | e45c973ff0bbe44d5e50f7e5f7c78eda8457a694 (patch) | |
| tree | a4c494237aa5281f693e238c95728f164a3d411d /scripts | |
| parent | bd8fb7c9f544cabd91c1de55274644ba60e9d791 (diff) | |
Tests: don't judge cs_signed_zero_nan's -0 products on Apple GPUs (#1203)
MoltenVK returns +0 for -0 products with or without SignedZeroInfNanPreserve,
in out[0] (v_mul_f32), out[2] (v_pk_mul_f16) and out[3] (v_mul_f16). The mode
still fixes the three NaN checks on Apple. Seen on an Apple A18 Pro and an Apple
Paravirtual device in #664, tracked as #1203 / SHADER-182.
- check.py: judged_words() leaves those three words of cs_signed_zero_nan
unjudged when vk_compute_test's device line names an Apple GPU, and
words_match() compares the rest. The other five words still have to match,
and every other device judges all eight.
- run_gpu_tests.py: uses the same two functions and says which words weren't
judged.
- tests/test_shader_checks.py: tests for the Apple and non-Apple cases, the
NaN checks still judged on Apple, and run_gpu_tests' judge_cs_dump.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/run_gpu_tests.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py index 28eb466d9..caeacfc6c 100644 --- a/scripts/run_gpu_tests.py +++ b/scripts/run_gpu_tests.py | |||
| @@ -32,6 +32,7 @@ from check import (CMPX_CLASS_WORDS, CVT_F32_SAT_CASES, GRADIENT_TESTS, TEST_PRO | |||
| 32 | TEXTURE_MIP_TEST, GATHER_LOD_TEST, MIP_TEST_PASSES, TEXTURE_CONSTANTS, USER_SGPRS_ENV, USER_SGPRS_WORDS, Skip, mesh_v5_test, not_found_message, | 32 | TEXTURE_MIP_TEST, GATHER_LOD_TEST, MIP_TEST_PASSES, TEXTURE_CONSTANTS, USER_SGPRS_ENV, USER_SGPRS_WORDS, Skip, mesh_v5_test, not_found_message, |
| 33 | pick_build_dir, start_failure, texture_gradient_a16_test, texture_mip_test) | 33 | pick_build_dir, start_failure, texture_gradient_a16_test, texture_mip_test) |
| 34 | from check import SIGNED_MIP_TEST | 34 | from check import SIGNED_MIP_TEST |
| 35 | from check import judged_words, words_match # dump words not judged on some devices (cs_signed_zero_nan on Apple) | ||
| 35 | from check import TEXOFF_ARGS, texoff_problem # ps_texoff's expected words and arguments live in check.py | 36 | from check import TEXOFF_ARGS, texoff_problem # ps_texoff's expected words and arguments live in check.py |
| 36 | from check import TEXOFF_FALLBACK, texoff_env # LEONIDA_TEXOFF_FALLBACK=1: texel offsets without maintenance8 | 37 | from check import TEXOFF_FALLBACK, texoff_env # LEONIDA_TEXOFF_FALLBACK=1: texel offsets without maintenance8 |
| 37 | from check import gpu_test_timeout, timed_out # per-program time limit (LEONIDA_GPU_TEST_TIMEOUT) | 38 | from check import gpu_test_timeout, timed_out # per-program time limit (LEONIDA_GPU_TEST_TIMEOUT) |
| @@ -325,7 +326,7 @@ def judge_cs_dump(rc: int, msg: str, want: list[int], *, wave64: bool, partial: | |||
| 325 | if rc != 0 or words is None: | 326 | if rc != 0 or words is None: |
| 326 | return False, msg | 327 | return False, msg |
| 327 | vals = words[:len(want)] | 328 | vals = words[:len(want)] |
| 328 | return vals == want, " ".join((hex if hexwords else str)(x) for x in vals) | 329 | return words_match(vals, want), " ".join((hex if hexwords else str)(x) for x in vals) |
| 329 | 330 | ||
| 330 | 331 | ||
| 331 | def check_pixel_const(raw_path: str, want: tuple[int, int, int, int]) -> tuple[bool, str]: | 332 | def check_pixel_const(raw_path: str, want: tuple[int, int, int, int]) -> tuple[bool, str]: |
| @@ -993,9 +994,13 @@ def run_suite(a, work: str) -> int: | |||
| 993 | if skip: # e.g. Mesa llvmpipe's 8-wide subgroups: these 32-lane masks can't come out right | 994 | if skip: # e.g. Mesa llvmpipe's 8-wide subgroups: these 32-lane masks can't come out right |
| 994 | ok, detail = None, str(skip) | 995 | ok, detail = None, str(skip) |
| 995 | else: | 996 | else: |
| 997 | want = judged_words(name, msg, want) # cs_signed_zero_nan on Apple: -0 products unjudged (#1203) | ||
| 996 | ok, detail = judge_cs_dump(rc, msg, want, wave64=wave64, partial=partial, emulated=emulated, | 998 | ok, detail = judge_cs_dump(rc, msg, want, wave64=wave64, partial=partial, emulated=emulated, |
| 997 | hexwords=name in ("cs_store", "cs_smem_soffset_imm", "cs_w32_lds_u8_d16", | 999 | hexwords=name in ("cs_store", "cs_smem_soffset_imm", "cs_w32_lds_u8_d16", |
| 998 | "cs_lds_b64_cmpst", "cs_signed_zero_nan")) | 1000 | "cs_lds_b64_cmpst", "cs_signed_zero_nan")) |
| 1001 | if ok and None in want: | ||
| 1002 | unjudged = ", ".join(str(i) for i, w in enumerate(want) if w is None) | ||
| 1003 | detail += f" (words {unjudged} not judged on Apple: -0 products, #1203)" | ||
| 999 | results.append((name, ok, detail)) | 1004 | results.append((name, ok, detail)) |
| 1000 | elif name == "cs_imgstore": | 1005 | elif name == "cs_imgstore": |
| 1001 | rc, msg = run_cmd([vk_store, spv]) | 1006 | rc, msg = run_cmd([vk_store, spv]) |