diff options
| author | aslan2142 <jan.trencansky@protonmail.com> | 2026-11-25 00:20:04 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-25 00:20:04 +0100 |
| commit | e0b08c77d3e168483b3e6f0a0bb093893b4e54d3 (patch) | |
| tree | db5d7408c005e472ec356536a557fdf98090234b /docs/testing.md | |
| parent | 3a73ce11ad3bdec1cc99134a3df3fb0bd2a412e9 (diff) | |
| parent | 7fb019f2202c91a6f1fe6337d69cacd1028daca7 (diff) | |
Merge pull request #1047 from milk4sale/shader/round-f64-specials
rdna2spirv: the binary64 roundings keep a NaN's bits and round a subnormal without the driver (SHADER-ROUND-F64-SPECIALS)
Diffstat (limited to 'docs/testing.md')
| -rw-r--r-- | docs/testing.md | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/docs/testing.md b/docs/testing.md index 79af9551c..9ed1636d3 100644 --- a/docs/testing.md +++ b/docs/testing.md | |||
| @@ -419,21 +419,26 @@ the largest finite value, the infinities, and quiet and signalling NaNs. Each th | |||
| 419 | `v_trunc_f64` with a `neg` source, `v_ceil_f64` with an `abs` source, a `v_floor_f64` whose destination pair overlaps | 419 | `v_trunc_f64` with a `neg` source, `v_ceil_f64` with an `abs` source, a `v_floor_f64` whose destination pair overlaps |
| 420 | its source pair, and a `v_rndne_f64` run with the odd threads turned off, whose destination must keep the pair it | 420 | its source pair, and a `v_rndne_f64` run with the odd threads turned off, whose destination must keep the pair it |
| 421 | held. The expected words come from Python (`round_f64` in `check.py`: exact IEEE-754, the result keeping its | 421 | held. The expected words come from Python (`round_f64` in `check.py`: exact IEEE-754, the result keeping its |
| 422 | source's sign), and `tests/test_gpu_round_f64.py` checks that oracle against exact rational rounding. Two kinds of | 422 | source's sign), and `tests/test_gpu_round_f64.py` checks that oracle against exact rational rounding. All 1152 heap |
| 423 | input are judged by what Vulkan lets a driver do, not by RDNA2: a NaN may come back as another NaN, and a subnormal | 423 | words are compared exactly, the 128 unchanged input words included: a NaN and a subnormal are rounded by the |
| 424 | may be read as a zero of its sign, because the module does not declare `DenormPreserve` for 64 bits. All 1152 heap | 424 | translated code with integer ops and not by the driver, as the row in [design.md](design.md) says. (llvmpipe gets |
| 425 | words are judged, the 128 unchanged input words included. Run it alone with | 425 | one allowance, for what it does to `Trunc` and `RoundEven` on some CPUs; see below.) Run it alone with |
| 426 | `python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_w32_round_f64 --require-pass`. | 426 | `python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_w32_round_f64 --require-pass`. |
| 427 | It needs `shaderFloat64`; a device without it reports a skip. | 427 | It needs `shaderFloat64`; a device without it reports a skip. |
| 428 | 428 | ||
| 429 | Measured: on an RTX 4070 Ti (NVIDIA 620.70.06, Linux) 497 of the 512 results are RDNA2's, and the other 15 are those | 429 | Measured: on an RTX 4070 Ti (NVIDIA 620.70.06, Linux) and on llvmpipe (Mesa 26.2.6, LLVM 23.1.4) all 1152 words |
| 430 | of the two signalling NaNs, which come back quiet with sign and payload kept (`0x7ff0000000000001` gives | 430 | match. While those two kinds of input still went to the driver's function, 15 of the 512 results differed on the |
| 431 | `0x7ff8000000000001`). On llvmpipe (Mesa 26.2.6, LLVM 23.1.4) five more differ: the two smallest subnormals are read | 431 | 4070 Ti, those of the two signalling NaNs, which came back quiet with sign and payload kept (`0x7ff0000000000001` |
| 432 | as zero, so `v_ceil_f64` of the positive one gives +0 instead of 1 and `v_floor_f64` of the negative one -0 instead | 432 | gave `0x7ff8000000000001`), and five more on llvmpipe, which read the two smallest subnormals as zero (`v_ceil_f64` |
| 433 | of -1. Rules broken one at a time each failed the test on both devices: `rndne` lowered as `floor(x + 0.5)` (word | 433 | of the positive one gave +0 instead of 1, `v_floor_f64` of the negative one -0 instead of -1). Rules broken one at a |
| 434 | 20, the sign of -0), `trunc` or `ceil` lowered as `Floor`, the `neg` or the `abs` source modifier ignored (words 8 and | 434 | time each failed the test on both devices: a NaN left to the driver (word 784), the NaN and subnormal tests ignoring |
| 435 | 26), the low result word taken from the high one (word 8), and the fixture without its `v_cmpx` (word 30). Replacing | 435 | the low dword, `v_ceil_f64` or `v_floor_f64` lifting the subnormal of the wrong sign (words 34 and 38), a subnormal's |
| 436 | `RoundEven` by GLSL `Round` changed nothing on either device: both send a tie to the even integer. | 436 | result losing its sign (word 40), a NaN's low word dropped (word 784), `rndne` lowered as `floor(x + 0.5)` (word 20, |
| 437 | the sign of -0), `trunc` or `ceil` lowered as `Floor`, the `neg` or the `abs` source modifier ignored (words 8 and | ||
| 438 | 26), the two result words swapped (word 8), and the fixture without its `v_cmpx` (word 30). Two changes are not | ||
| 439 | caught everywhere: a subnormal left to the driver fails on llvmpipe (word 34) and passes on the 4070 Ti, which keeps | ||
| 440 | binary64 denormals, and `RoundEven` replaced by GLSL `Round` changes nothing on either device, since both send a tie | ||
| 441 | to the even integer. | ||
| 437 | 442 | ||
| 438 | llvmpipe gave those results on a CPU with AVX-512. On one without it, `Trunc` and `RoundEven` of a double go through | 443 | llvmpipe gave those results on a CPU with AVX-512. On one without it, `Trunc` and `RoundEven` of a double go through |
| 439 | the code llvmpipe has for a float, because its double vectors are twice its native width (512 bits at the usual 256) | 444 | the code llvmpipe has for a float, because its double vectors are twice its native width (512 bits at the usual 256) |