diff options
| author | aslan2142 <jan.trencansky@protonmail.com> | 2026-11-25 00:20:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-25 00:20:58 +0100 |
| commit | 2376e7d56bc61bf17f9767e21d651071fe74ee6e (patch) | |
| tree | b03cf731250115b958fce2fac762ad8513bc4fdd /docs/testing.md | |
| parent | e0b08c77d3e168483b3e6f0a0bb093893b4e54d3 (diff) | |
| parent | 5431c75a6f7d7cd083b15524d8afe27ab461f28e (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.md | 21 |
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 | |||
| 395 | independent of wave64 emulation. On RTX 3080 Ti (616.92, Windows 11), all 640 words matched; replacing the count | 395 | independent of wave64 emulation. On RTX 3080 Ti (616.92, Windows 11), all 640 words matched; replacing the count |
| 396 | mask with 31 or the arithmetic shift with a logical shift made the test fail at words 66 and 251 respectively. | 396 | mask 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 | ||
| 400 | value, an `ldexp` exponent and a binary64 value are loaded at run time: normals, the clamp of the exponent at ±512 | ||
| 401 | and beyond, results that overflow to an infinity and that fall below the smallest normal, binary32 denormals (read | ||
| 402 | as zero), binary64 subnormals (normalized; single fraction bits on both sides of the dword boundary and patterns | ||
| 403 | with several), zeros, infinities and NaNs. Each thread stores the five results, `v_frexp_mant_f32` with a `neg` | ||
| 404 | source and `v_ldexp_f32` with an `abs` source run with the odd threads turned off, whose destination must keep the | ||
| 405 | word 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 | ||
| 408 | hardware. 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`. | ||
| 410 | On 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 | ||
| 411 | the binary32 ops still applied `neg` and `abs` with `OpFNegate` and `FAbs`, six words differed on the 4070 Ti and none | ||
| 412 | on llvmpipe: every NaN source under a modifier came back as `0x7fffffff`, the driver's default NaN (word 419 is the | ||
| 413 | first: the mantissa of the negated `0x7fc00000`). Rules broken one at a time each failed the test on both devices: | ||
| 414 | the 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 | ||
| 416 | binary32 denormal not read as zero (word 352), the binary64 subnormal exponent off by one in the low or in the high | ||
| 417 | dword (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 |
| 399 | 256 memory-fed operand pairs: the product of 16 values (±inf, ±max, the 1-ULP neighbours of ±1, the smallest | 420 | 256 memory-fed operand pairs: the product of 16 values (±inf, ±max, the 1-ULP neighbours of ±1, the smallest |
| 400 | subnormals, ±0, the smallest normal, a NaN whose payload is only in the low dword and a negative quiet NaN). Each | 421 | subnormals, ±0, the smallest normal, a NaN whose payload is only in the low dword and a negative quiet NaN). Each |