diff options
| author | milk4sale <53350507+milk4sale@users.noreply.github.com> | 2026-11-24 15:54:14 -0600 |
|---|---|---|
| committer | milk4sale <53350507+milk4sale@users.noreply.github.com> | 2026-11-24 15:55:33 -0600 |
| commit | 60c2ed910b90aef3cf5af1df2366a28a25afbe64 (patch) | |
| tree | 378d520565919c501e96b8a49e1e18e497325a48 /docs/testing.md | |
| parent | 355c8c9c2da01a9898df5061d266ca1f5567cdc9 (diff) | |
tests: cs_w32_round_f64 allows llvmpipe's float path for Trunc and RoundEven (GPU-ROUND-F64)
linux-gpu-tools failed this fixture with `word 164 (thread 10): rndne of 0x3fe0000000000001 gave
0x0000000000000000`, on some runners and not on others. The cause is llvmpipe, not the translation: its double
vectors are twice its native width (512 bits at the usual 256), and it has the exact Trunc and RoundEven only for a
width the CPU has a vector extension for. Without AVX-512 the two ops go through the code it has for a float, where
a magnitude above 2^24 comes back unchanged and RoundEven of a smaller one can give the other neighbouring integer.
That is 48 of the 512 results, the same 48 with Mesa 25.2.8 (LLVM 20.1.2) on a runner and with Mesa 26.2.6
(LLVM 23.1.4) under GALLIUM_OVERRIDE_CPU_CAPS=avx, sse4.1 or sse2 on a Ryzen 9 7900X; Floor and Ceil are exact on
that path, and with AVX-512 (or AVX at LP_NATIVE_VECTOR_WIDTH=128) so are all four.
On llvmpipe the judge now lets v_trunc_f64 and v_rndne_f64 return what that path can give: the source itself above
2^24, either neighbouring integer with the source's sign from 0.5 up to it. Everything else stays exact there, and no other
device gets the allowance (ROUND_F64_FLOAT_PATH, keyed like UNJUDGED_WORDS). dump_test hands the test program's
output to a judge, for its device line.
Tested: the fixture passes on llvmpipe natively and under each of the three overrides, at
LP_NATIVE_VECTOR_WIDTH=128, and on the RTX 4070 Ti (NVIDIA 620.70.06) natively and with LEONIDA_W64_EMULATE=1; the
previous judge fails under each override at word 164. tests/test_gpu_round_f64.py rebuilds the 48 measured results
and checks that nothing wider passes.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'docs/testing.md')
| -rw-r--r-- | docs/testing.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/testing.md b/docs/testing.md index 4d76e9f2e..a3602037f 100644 --- a/docs/testing.md +++ b/docs/testing.md | |||
| @@ -397,6 +397,19 @@ of -1. Rules broken one at a time each failed the test on both devices: `rndne` | |||
| 397 | 26), the low result word taken from the high one (word 8), and the fixture without its `v_cmpx` (word 30). Replacing | 397 | 26), the low result word taken from the high one (word 8), and the fixture without its `v_cmpx` (word 30). Replacing |
| 398 | `RoundEven` by GLSL `Round` changed nothing on either device: both send a tie to the even integer. | 398 | `RoundEven` by GLSL `Round` changed nothing on either device: both send a tie to the even integer. |
| 399 | 399 | ||
| 400 | llvmpipe gave those results on a CPU with AVX-512. On one without it, `Trunc` and `RoundEven` of a double go through | ||
| 401 | the code llvmpipe has for a float, because its double vectors are twice its native width (512 bits at the usual 256) | ||
| 402 | and it only has the exact rounding for a width the CPU has an extension for. There a magnitude above 2^24 comes back | ||
| 403 | unchanged (`v_trunc_f64` of 123456789.0625 is 123456789.0625) and `RoundEven` of a smaller one can give the other | ||
| 404 | neighbouring integer (1 for 1.5, 0 for the value just above 0.5): 48 of the 512 results, the same 48 with Mesa | ||
| 405 | 25.2.8 (LLVM 20.1.2) on a CI runner and with Mesa 26.2.6 under `GALLIUM_OVERRIDE_CPU_CAPS=avx`, which is how to see | ||
| 406 | it on a CPU that has AVX-512. `Floor` and `Ceil` are exact on that path. The CI's runners differ in this, so the | ||
| 407 | unchanged fixture passed or failed there by the machine it got. On llvmpipe the judge therefore lets `v_trunc_f64` | ||
| 408 | and `v_rndne_f64` return what that path can give, the source itself above 2^24 and either neighbouring integer | ||
| 409 | from 0.5 up to it, and nothing else (`ROUND_F64_FLOAT_PATH` in `check.py`); `v_floor_f64`, `v_ceil_f64`, the kept | ||
| 410 | pair and the inputs stay exact there, and no other device gets the allowance. `LP_NATIVE_VECTOR_WIDTH=128` makes | ||
| 411 | llvmpipe exact on a CPU with AVX. | ||
| 412 | |||
| 400 | ## Wave64 pixel, vertex and geometry shaders (`w64_graphics.py`) | 413 | ## Wave64 pixel, vertex and geometry shaders (`w64_graphics.py`) |
| 401 | 414 | ||
| 402 | Graphics stages have no emulation: on a 32-wide subgroup a wave64 VS, PS or GS runs as two 32-lane halves, and the | 415 | Graphics stages have no emulation: on a 32-wide subgroup a wave64 VS, PS or GS runs as two 32-lane halves, and the |