diff options
| author | milk4sale <53350507+milk4sale@users.noreply.github.com> | 2026-11-24 11:32:48 -0600 |
|---|---|---|
| committer | milk4sale <53350507+milk4sale@users.noreply.github.com> | 2026-11-24 11:32:48 -0600 |
| commit | 5f063e5812f9b12f5c2063c1b552fd975ae9e5e9 (patch) | |
| tree | 59f90002cc8fb3378332baffe1aebb4d187128be /scripts/run_gpu_tests.py | |
| parent | 355c8c9c2da01a9898df5061d266ca1f5567cdc9 (diff) | |
tests, rdna2spirv: GPU readback for frexp and ldexp, and their neg/abs sources move the sign bit (GPU-FREXP-LDEXP, SHADER-FREXP-LDEXP-SIGN-MODS)
v_frexp_mant_f32, v_frexp_exp_i32_f32, v_ldexp_f32, v_frexp_mant_f64 and v_frexp_exp_i32_f64 are lowered with
integer ops on the float's words, and no fixture in runtime/test/shaders ran any of them.
cs_w32_frexp_ldexp is memory-fed, like cs_w32_shift64: check.py seeds 64 records of a binary32 value, an ldexp
exponent and a binary64 value, and each thread loads one at run time and stores the five results, v_frexp_mant_f32
with a neg source, and v_ldexp_f32 with an abs source run with the odd threads turned off. The records cover the
exponent clamp, overflow and underflow, binary32 denormals, binary64 subnormals on both sides of the dword boundary,
zeros, infinities and NaNs. The expected words come from an oracle written from the rows of docs/design.md, checked
against math.frexp and math.ldexp in tests/test_gpu_frexp_ldexp.py.
On an RTX 4070 Ti (NVIDIA 620.70.06) six words were wrong: every NaN source under neg or abs came back as
0x7fffffff, the driver's default NaN. The binary32 branch applied the modifiers as FAbs and OpFNegate, from which
Vulkan lets a driver return any NaN. The three ops only move bits, so the branch now reads its source through
Gen.src_u_sign_mods, as the min/max family does. tests/semantic/test_alu_frexp_ldexp.py checks that the modifiers
are emitted as sign-bit ops. With that the fixture's 768 words are exact on the RTX 4070 Ti and on llvmpipe.
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.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py index aac6efeee..180c9773a 100644 --- a/scripts/run_gpu_tests.py +++ b/scripts/run_gpu_tests.py | |||
| @@ -39,6 +39,7 @@ from check import HEAP_INIT_EXPECTED, heap_init_env # cs_heap_init: vk_compute | |||
| 39 | from check import shift64_test # dynamic 64-bit vector shifts and overlapping destinations | 39 | from check import shift64_test # dynamic 64-bit vector shifts and overlapping destinations |
| 40 | from check import cmp_f64_test # the 32 binary64 vector compares on memory-fed operands | 40 | from check import cmp_f64_test # the 32 binary64 vector compares on memory-fed operands |
| 41 | from check import round_f64_test # the four binary64 roundings on memory-fed inputs | 41 | from check import round_f64_test # the four binary64 roundings on memory-fed inputs |
| 42 | from check import frexp_ldexp_test # binary32 and binary64 frexp, and v_ldexp_f32, on memory-fed records | ||
| 42 | from check import judged_words, words_match # dump words not judged on some devices (cs_signed_zero_nan) | 43 | from check import judged_words, words_match # dump words not judged on some devices (cs_signed_zero_nan) |
| 43 | from check import TEXOFF_ARGS, texoff_problem # ps_texoff's expected words and arguments live in check.py | 44 | from check import TEXOFF_ARGS, texoff_problem # ps_texoff's expected words and arguments live in check.py |
| 44 | from check import TEXOFF_FALLBACK, texoff_env # LEONIDA_TEXOFF_FALLBACK=1: texel offsets without maintenance8 | 45 | from check import TEXOFF_FALLBACK, texoff_env # LEONIDA_TEXOFF_FALLBACK=1: texel offsets without maintenance8 |
| @@ -985,6 +986,10 @@ def run_suite(a, work: str) -> int: | |||
| 985 | if name in CLIP_CASES: | 986 | if name in CLIP_CASES: |
| 986 | detail = clip_test(a.build, spirv_dir, name) | 987 | detail = clip_test(a.build, spirv_dir, name) |
| 987 | results.append((name, None if isinstance(detail, Skip) else not detail, detail or "four pixel masks exact")) | 988 | results.append((name, None if isinstance(detail, Skip) else not detail, detail or "four pixel masks exact")) |
| 989 | elif name == "cs_w32_frexp_ldexp": | ||
| 990 | detail = frexp_ldexp_test(a.build, spirv_dir, cs_env) | ||
| 991 | results.append((name, None if isinstance(detail, Skip) else not detail, | ||
| 992 | detail or "768 words exact (64 records, eight results each, and unchanged inputs)")) | ||
| 988 | elif name == "cs_w32_shift64": | 993 | elif name == "cs_w32_shift64": |
| 989 | detail = shift64_test(a.build, spirv_dir, cs_env) | 994 | detail = shift64_test(a.build, spirv_dir, cs_env) |
| 990 | results.append((name, None if isinstance(detail, Skip) else not detail, | 995 | results.append((name, None if isinstance(detail, Skip) else not detail, |