diff options
| author | ubiquitarianism <283527159+ubiquitarianism@users.noreply.github.com> | 2026-11-24 20:49:40 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-24 20:49:40 -0500 |
| commit | 8a57b3b1d3cc2d205efe4a9a4a4358a0f5f55ca7 (patch) | |
| tree | e255ce6c6c61364b32b163051568f79dff891d1d /docs/testing.md | |
| parent | c266c269e3b2384455e5089dd51dca6003d22321 (diff) | |
| parent | 0c3acdc03056908d30724e9fd2bcc7acc8021936 (diff) | |
Merge pull request #1114 from milk4sale/gpu-test/salu-ext
tests: GPU readback for 38 scalar ALU ops on run-time operands (GPU-SALU-EXT)
Diffstat (limited to 'docs/testing.md')
| -rw-r--r-- | docs/testing.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/testing.md b/docs/testing.md index 71aacf533..d4f69026d 100644 --- a/docs/testing.md +++ b/docs/testing.md | |||
| @@ -384,6 +384,28 @@ on an Apple M3 Max (MoltenVK 1.4.2 and 1.4.3): 17 workgroup shapes from 1 to 102 | |||
| 384 | subgroups, with and without full subgroups and register pressure, all 32 lanes in order. A device whose default | 384 | subgroups, with and without full subgroups and register pressure, all 32 lanes in order. A device whose default |
| 385 | isn't the requested size still prints `not available`, and those tests skip. | 385 | isn't the requested size still prints `not available`, and those tests skip. |
| 386 | 386 | ||
| 387 | `cs_w32_salu_ext` runs 38 scalar ALU ops that no other fixture runs: `s_sub_i32`, `s_andn2_b32`, `s_orn2_b32`, | ||
| 388 | `s_xor_b32`, `s_ashr_i32`, `s_mul_hi_u32`, `s_lshl3_add_u32`, `s_lshl4_add_u32`, `s_pack_ll_b32_b16`, | ||
| 389 | `s_pack_hh_b32_b16`, `s_abs_i32`, `s_bcnt0_i32_b32`, `s_bitset0_b32`, `s_bitset1_b32`, `s_brev_b32`, `s_flbit_i32`, | ||
| 390 | `s_flbit_i32_b32`, `s_sext_i32_i8`, the six `s_cmp_*_i32`, `s_cmp_gt_u32`, `s_cmp_le_u32`, `s_bitcmp0_b32`, | ||
| 391 | `s_bitcmp1_b32`, `s_addk_i32`, `s_mulk_i32`, `s_cmovk_i32`, `s_ashr_i64`, `s_lshl_b64`, `s_lshr_b64`, | ||
| 392 | `s_bcnt0_i32_b64`, `s_bitset0_b64`, `s_cmov_b64` and `s_ff0_i32_b64`. Its sixteen operand words arrive in `s4..s19` | ||
| 393 | through `VKC_SGPRS`, so each op reaches the driver as SPIR-V: a scalar op on literals is folded by the translator | ||
| 394 | (the "Chained scalar constant folding" row of [design.md](design.md)) and only its result is stored. One thread stores | ||
| 395 | every destination and four words of SCC bits: SCC after each op that writes it, each run on operands that set it | ||
| 396 | and on operands that clear it; each compare and bit test both ways, the signed and the unsigned ones on words that | ||
| 397 | tell the two apart; and SCC after each op that must keep it, set to 1 and to 0 in turn before them. The 73 expected | ||
| 398 | words are literals in `check.py`, derived in the fixture's header, and `tests/test_gpu_salu_ext.py` recomputes them | ||
| 399 | from the fixture's own instruction lines with the reference of `tools/salu_diff.py`, the model that was compared | ||
| 400 | with hardware. Both GPU runners compare the whole 80-word heap, the untouched fill after the results included. Run | ||
| 401 | it alone with `python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_w32_salu_ext --require-pass`. | ||
| 402 | On an RTX 4070 Ti (NVIDIA 620.70.06, Linux) and on llvmpipe (Mesa 26.2.6, LLVM 23.1.4) all 80 words match. Nine | ||
| 403 | translator rules broken one at a time each failed it on both: `s_ashr_i32` shifting in zeros (word 8), | ||
| 404 | `s_lshlN_add_u32` taking SCC from the add's carry alone (word 69), `s_abs_i32` negating (word 17), `s_mulk_i32` and | ||
| 405 | `s_addk_i32` zero-extending their immediate (words 37 and 21), `s_cmovk_i32` ignoring SCC (word 38), the 64-bit | ||
| 406 | shifts taking their count modulo 32 and `s_ashr_i64` shifting in zeros (word 51), and the 64-bit shifts taking SCC | ||
| 407 | from the low dword alone (word 72). | ||
| 408 | |||
| 387 | `cs_w32_shift64` checks `v_lshlrev_b64`, `v_lshrrev_b64` and `v_ashrrev_i64` with 64 memory-fed cases: | 409 | `cs_w32_shift64` checks `v_lshlrev_b64`, `v_lshrrev_b64` and `v_ashrrev_i64` with 64 memory-fed cases: |
| 388 | eight boundary values crossed with counts 0, 1, 31, 32, 33, 63, 64 and 65. The expected values come from Python | 410 | eight boundary values crossed with counts 0, 1, 31, 32, 33, 63, 64 and 65. The expected values come from Python |
| 389 | integers using the low six count bits, as specified by the [RDNA2 ISA, VOP3 opcodes 767–769](https://docs.amd.com/api/khub/documents/Et~wpu9g~Ffl7d9q0QZ~Og/content). | 411 | integers using the low six count bits, as specified by the [RDNA2 ISA, VOP3 opcodes 767–769](https://docs.amd.com/api/khub/documents/Et~wpu9g~Ffl7d9q0QZ~Og/content). |