upleb.uk

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

summaryrefslogtreecommitdiff
path: root/docs/testing.md
diff options
context:
space:
mode:
authoraslan2142 <jan.trencansky@protonmail.com>2026-11-25 00:20:58 +0100
committerGitHub <noreply@github.com>2026-11-25 00:20:58 +0100
commit2376e7d56bc61bf17f9767e21d651071fe74ee6e (patch)
treeb03cf731250115b958fce2fac762ad8513bc4fdd /docs/testing.md
parente0b08c77d3e168483b3e6f0a0bb093893b4e54d3 (diff)
parent5431c75a6f7d7cd083b15524d8afe27ab461f28e (diff)
Merge pull request #1063 from milk4sale/gpu-test/frexp-ldexp
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)
Diffstat (limited to 'docs/testing.md')
-rw-r--r--docs/testing.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/testing.md b/docs/testing.md
index 9ed1636d3..71aacf533 100644
--- a/docs/testing.md
+++ b/docs/testing.md
@@ -395,6 +395,27 @@ It needs shader Int64 support; a device that lacks it reports a skip. This is a
395independent of wave64 emulation. On RTX 3080 Ti (616.92, Windows 11), all 640 words matched; replacing the count 395independent of wave64 emulation. On RTX 3080 Ti (616.92, Windows 11), all 640 words matched; replacing the count
396mask with 31 or the arithmetic shift with a logical shift made the test fail at words 66 and 251 respectively. 396mask with 31 or the arithmetic shift with a logical shift made the test fail at words 66 and 251 respectively.
397 397
398`cs_w32_frexp_ldexp` checks `v_frexp_mant_f32`, `v_frexp_exp_i32_f32`, `v_ldexp_f32`, `v_frexp_mant_f64` and
399`v_frexp_exp_i32_f64`, which the translator computes with integer ops on the float's words. 64 records of a binary32
400value, an `ldexp` exponent and a binary64 value are loaded at run time: normals, the clamp of the exponent at ±512
401and beyond, results that overflow to an infinity and that fall below the smallest normal, binary32 denormals (read
402as zero), binary64 subnormals (normalized; single fraction bits on both sides of the dword boundary and patterns
403with several), zeros, infinities and NaNs. Each thread stores the five results, `v_frexp_mant_f32` with a `neg`
404source and `v_ldexp_f32` with an `abs` source run with the odd threads turned off, whose destination must keep the
405word it held. The expected words come from an oracle written from the rows of [design.md](design.md)
406(`frexp_mant_f32`, `frexp_exp_i32_f32`, `ldexp_f32` and `frexp_f64` in `check.py`), and
407`tests/test_gpu_frexp_ldexp.py` checks it against `math.frexp` and `math.ldexp` wherever those agree with the
408hardware. Both GPU runners compare all 768 heap words, the 256 unchanged input words included. Run it alone with
409`python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_w32_frexp_ldexp --require-pass`.
410On an RTX 4070 Ti (NVIDIA 620.70.06, Linux) and on llvmpipe (Mesa 26.2.6, LLVM 23.1.4) all 768 words match. While
411the binary32 ops still applied `neg` and `abs` with `OpFNegate` and `FAbs`, six words differed on the 4070 Ti and none
412on llvmpipe: every NaN source under a modifier came back as `0x7fffffff`, the driver's default NaN (word 419 is the
413first: the mantissa of the negated `0x7fc00000`). Rules broken one at a time each failed the test on both devices:
414the mantissa given the exponent field 127 (word 0) or, for binary64, 1023 (word 5), the exponent subtracting 127
415(word 1), `v_ldexp_f32` without its clamp (word 258) or overflowing to the largest finite value (word 106), a
416binary32 denormal not read as zero (word 352), the binary64 subnormal exponent off by one in the low or in the high
417dword (words 134 and 150), and the fixture without its `v_cmpx` (word 15).
418
398`cs_w32_cmp_f64` checks the 32 binary64 vector compares, `v_cmp_*_f64` into VCC and `v_cmpx_*_f64` on EXEC, with 419`cs_w32_cmp_f64` checks the 32 binary64 vector compares, `v_cmp_*_f64` into VCC and `v_cmpx_*_f64` on EXEC, with
399256 memory-fed operand pairs: the product of 16 values (±inf, ±max, the 1-ULP neighbours of ±1, the smallest 420256 memory-fed operand pairs: the product of 16 values (±inf, ±max, the 1-ULP neighbours of ±1, the smallest
400subnormals, ±0, the smallest normal, a NaN whose payload is only in the low dword and a negative quiet NaN). Each 421subnormals, ±0, the smallest normal, a NaN whose payload is only in the low dword and a negative quiet NaN). Each