upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/scripts/run_gpu_tests.py
diff options
context:
space:
mode:
authormilk4sale <53350507+milk4sale@users.noreply.github.com>2026-11-24 10:41:43 -0600
committermilk4sale <53350507+milk4sale@users.noreply.github.com>2026-11-24 10:41:43 -0600
commit50407827cd2cb73313c585cdf3d3d40ed7918bae (patch)
treed84f4bf4a47b10e9a14398b9029e299e43e63aee /scripts/run_gpu_tests.py
parent82a2aabcc33bf296b5c2e3e4e7021fa506f8570e (diff)
tests: GPU readback for the binary64 vector compares, v_cmp_*_f64 and v_cmpx_*_f64 (GPU-CMP-F64)
The v_cmp_*_f64 / v_cmpx_*_f64 row of docs/design.md was CPU-checked and measured on native gfx1100, and no fixture in runtime/test/shaders used a binary64 compare, so the SPIR-V those 32 ops translate to had not run on a driver. cs_w32_cmp_f64 is memory-fed, like cs_w32_shift64: check.py seeds 256 operand pairs, the product of 16 values (+-inf, +-max, the 1-ULP neighbours of +-1, the smallest subnormals, +-0, the smallest normal, a NaN whose payload is only in the low dword, a negative quiet NaN), and each of 128 threads loads two of them at run time. Per pair it stores a v_cmp_ word (through VCC) and a v_cmpx_ word (through EXEC): one bit per predicate in opcode order, a bit for tru run with the odd threads turned off (an inactive lane gets VCC 0 and stays off through v_cmpx_), and two bits for lt and nge with VOP3 abs/neg. The expected words come from Python floats. Both GPU runners compare all 1536 heap words, the unchanged inputs included. tests/test_gpu_cmp_f64.py checks, without a GPU, the oracle against an independent restatement of the 16 predicates, a few words worked out by hand, that the assembly gives every predicate the oracle's bit, and the readback and runner verdicts. docs/testing.md describes the fixture and the row names it. No translator or runtime change. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'scripts/run_gpu_tests.py')
-rw-r--r--scripts/run_gpu_tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index e8fce4277..fa69a5f1e 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -37,6 +37,7 @@ from check import SIGNED_MIP_TEST, UINT_MIP_TEST
37from check import cbv_modulate_test 37from check import cbv_modulate_test
38from check import HEAP_INIT_EXPECTED, heap_init_env # cs_heap_init: vk_compute_test's VKC_HEAP_INIT 38from check import HEAP_INIT_EXPECTED, heap_init_env # cs_heap_init: vk_compute_test's VKC_HEAP_INIT
39from check import shift64_test # dynamic 64-bit vector shifts and overlapping destinations 39from check import shift64_test # dynamic 64-bit vector shifts and overlapping destinations
40from check import cmp_f64_test # the 32 binary64 vector compares on memory-fed operands
40from check import judged_words, words_match # dump words not judged on some devices (cs_signed_zero_nan) 41from check import judged_words, words_match # dump words not judged on some devices (cs_signed_zero_nan)
41from check import TEXOFF_ARGS, texoff_problem # ps_texoff's expected words and arguments live in check.py 42from check import TEXOFF_ARGS, texoff_problem # ps_texoff's expected words and arguments live in check.py
42from check import TEXOFF_FALLBACK, texoff_env # LEONIDA_TEXOFF_FALLBACK=1: texel offsets without maintenance8 43from check import TEXOFF_FALLBACK, texoff_env # LEONIDA_TEXOFF_FALLBACK=1: texel offsets without maintenance8
@@ -987,6 +988,10 @@ def run_suite(a, work: str) -> int:
987 detail = shift64_test(a.build, spirv_dir, cs_env) 988 detail = shift64_test(a.build, spirv_dir, cs_env)
988 results.append((name, None if isinstance(detail, Skip) else not detail, 989 results.append((name, None if isinstance(detail, Skip) else not detail,
989 detail or "640 words exact (64 shift cases and unchanged inputs)")) 990 detail or "640 words exact (64 shift cases and unchanged inputs)"))
991 elif name == "cs_w32_cmp_f64":
992 detail = cmp_f64_test(a.build, spirv_dir, cs_env)
993 results.append((name, None if isinstance(detail, Skip) else not detail,
994 detail or "1536 words exact (256 operand pairs and unchanged inputs)"))
990 elif name == "cs_workgroup_yz": 995 elif name == "cs_workgroup_yz":
991 rc, msg = run_cmd([vk_compute, spv, "2x3x4", "workgroup_yz"], env=cs_env) 996 rc, msg = run_cmd([vk_compute, spv, "2x3x4", "workgroup_yz"], env=cs_env)
992 results.append((name,) + compute_result(rc, msg, rc == 0 and "2x3x4 workgroup Y/Z: 0 mismatches" 997 results.append((name,) + compute_result(rc, msg, rc == 0 and "2x3x4 workgroup Y/Z: 0 mismatches"