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:
authormilk4sale <53350507+milk4sale@users.noreply.github.com>2026-11-24 10:41:43 -0600
committermilk4sale <53350507+milk4sale@users.noreply.github.com>2026-11-24 10:41:43 -0600
commit50407827cd2cb73313c585cdf3d3d40ed7918bae (patch)
treed84f4bf4a47b10e9a14398b9029e299e43e63aee /docs/testing.md
parent82a2aabcc33bf296b5c2e3e4e7021fa506f8570e (diff)
tests: GPU readback for the binary64 vector compares, v_cmp_*_f64 and v_cmpx_*_f64 (GPU-CMP-F64)
The v_cmp_*_f64 / v_cmpx_*_f64 row of docs/design.md was CPU-checked and measured on native gfx1100, and no fixture in runtime/test/shaders used a binary64 compare, so the SPIR-V those 32 ops translate to had not run on a driver. cs_w32_cmp_f64 is memory-fed, like cs_w32_shift64: check.py seeds 256 operand pairs, the product of 16 values (+-inf, +-max, the 1-ULP neighbours of +-1, the smallest subnormals, +-0, the smallest normal, a NaN whose payload is only in the low dword, a negative quiet NaN), and each of 128 threads loads two of them at run time. Per pair it stores a v_cmp_ word (through VCC) and a v_cmpx_ word (through EXEC): one bit per predicate in opcode order, a bit for tru run with the odd threads turned off (an inactive lane gets VCC 0 and stays off through v_cmpx_), and two bits for lt and nge with VOP3 abs/neg. The expected words come from Python floats. Both GPU runners compare all 1536 heap words, the unchanged inputs included. tests/test_gpu_cmp_f64.py checks, without a GPU, the oracle against an independent restatement of the 16 predicates, a few words worked out by hand, that the assembly gives every predicate the oracle's bit, and the readback and runner verdicts. docs/testing.md describes the fixture and the row names it. No translator or runtime change. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'docs/testing.md')
-rw-r--r--docs/testing.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/testing.md b/docs/testing.md
index 04a5af180..eda140a9a 100644
--- a/docs/testing.md
+++ b/docs/testing.md
@@ -357,6 +357,22 @@ It needs shader Int64 support; a device that lacks it reports a skip. This is a
357independent of wave64 emulation. On RTX 3080 Ti (616.92, Windows 11), all 640 words matched; replacing the count 357independent of wave64 emulation. On RTX 3080 Ti (616.92, Windows 11), all 640 words matched; replacing the count
358mask with 31 or the arithmetic shift with a logical shift made the test fail at words 66 and 251 respectively. 358mask with 31 or the arithmetic shift with a logical shift made the test fail at words 66 and 251 respectively.
359 359
360`cs_w32_cmp_f64` checks the 32 binary64 vector compares, `v_cmp_*_f64` into VCC and `v_cmpx_*_f64` on EXEC, with
361256 memory-fed operand pairs: the product of 16 values (±inf, ±max, the 1-ULP neighbours of ±1, the smallest
362subnormals, ±0, the smallest normal, a NaN whose payload is only in the low dword and a negative quiet NaN). Each
363thread stores one bit per predicate for both forms, a bit for `tru` run with the odd threads turned off (an inactive
364lane gets VCC 0 from `v_cmp_` and stays off through `v_cmpx_`) and two bits for `lt` and `nge` with VOP3 `abs`/`neg`.
365The expected words come from Python floats (`cmp_f64_words` in `check.py`): IEEE-754 ordering, with every pair that
366has a NaN unordered. Both GPU runners compare all 1536 heap words (512 result words and 1024 unchanged input words);
367the operands are loaded at run time, so neither the translator nor the driver can fold a compare. Run it alone with
368`python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_w32_cmp_f64 --require-pass`.
369It is a wave32 test and no step of it needs a particular subgroup width, so it also runs on llvmpipe; the SGPR-pair
370and constant operand forms are CPU-checked only (`tests/semantic/test_cmp_f64.py`). On an RTX 4070 Ti (NVIDIA
371620.70.06, Linux) all 1536 words matched, and seven translator rules broken one at a time each failed it: no `-0`
372canonicalization at word 206, a NaN test that ignores the low dword at word 28, an ordering key without the low
373dword at word 70, the raw result written to an inactive lane's VCC at word 2, `v_cmpx_` replacing EXEC at word 3,
374`abs` ignored and `nlt` lowered as the negation of `le` at word 0.
375
360## Wave64 pixel, vertex and geometry shaders (`w64_graphics.py`) 376## Wave64 pixel, vertex and geometry shaders (`w64_graphics.py`)
361 377
362Graphics stages have no emulation: on a 32-wide subgroup a wave64 VS, PS or GS runs as two 32-lane halves, and the 378Graphics stages have no emulation: on a 32-wide subgroup a wave64 VS, PS or GS runs as two 32-lane halves, and the