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:
authorJan Trencansky <jan.trencansky@protonmail.com>2026-11-24 21:23:42 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-24 21:23:42 -0500
commit0819cfec800c48570beca6b7c2188a2a9eeed873 (patch)
tree8f63ccd0365ff00aa4d77b16c1f476a14ec609cb /docs/testing.md
parentdc925c9bbd8ceb38acf428838bbf248bcc3257d3 (diff)
parent3ff2a2adcd3517f09d120540ae441c947d422e34 (diff)
Merge main (3ff2a2adc) into the #939 merge
Fourteen commits main gained after #968: #413, #1114, #1090 and #1491. Two conflicts, both in the shader check lists: scripts/run_gpu_tests.py imports both sides' cases, and tests/test_shader_checks.py counts eight cases next to COMPUTE (main's cs_w32_salu_ext) and #939's IMAGE_STORE_CASES table in place of main's fixed seven store shaders. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'docs/testing.md')
-rw-r--r--docs/testing.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/testing.md b/docs/testing.md
index d8eb074e6..ffe729d24 100644
--- a/docs/testing.md
+++ b/docs/testing.md
@@ -403,6 +403,28 @@ on an Apple M3 Max (MoltenVK 1.4.2 and 1.4.3): 17 workgroup shapes from 1 to 102
403subgroups, with and without full subgroups and register pressure, all 32 lanes in order. A device whose default 403subgroups, with and without full subgroups and register pressure, all 32 lanes in order. A device whose default
404isn't the requested size still prints `not available`, and those tests skip. 404isn't the requested size still prints `not available`, and those tests skip.
405 405
406`cs_w32_salu_ext` runs 38 scalar ALU ops that no other fixture runs: `s_sub_i32`, `s_andn2_b32`, `s_orn2_b32`,
407`s_xor_b32`, `s_ashr_i32`, `s_mul_hi_u32`, `s_lshl3_add_u32`, `s_lshl4_add_u32`, `s_pack_ll_b32_b16`,
408`s_pack_hh_b32_b16`, `s_abs_i32`, `s_bcnt0_i32_b32`, `s_bitset0_b32`, `s_bitset1_b32`, `s_brev_b32`, `s_flbit_i32`,
409`s_flbit_i32_b32`, `s_sext_i32_i8`, the six `s_cmp_*_i32`, `s_cmp_gt_u32`, `s_cmp_le_u32`, `s_bitcmp0_b32`,
410`s_bitcmp1_b32`, `s_addk_i32`, `s_mulk_i32`, `s_cmovk_i32`, `s_ashr_i64`, `s_lshl_b64`, `s_lshr_b64`,
411`s_bcnt0_i32_b64`, `s_bitset0_b64`, `s_cmov_b64` and `s_ff0_i32_b64`. Its sixteen operand words arrive in `s4..s19`
412through `VKC_SGPRS`, so each op reaches the driver as SPIR-V: a scalar op on literals is folded by the translator
413(the "Chained scalar constant folding" row of [design.md](design.md)) and only its result is stored. One thread stores
414every destination and four words of SCC bits: SCC after each op that writes it, each run on operands that set it
415and on operands that clear it; each compare and bit test both ways, the signed and the unsigned ones on words that
416tell 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
417words are literals in `check.py`, derived in the fixture's header, and `tests/test_gpu_salu_ext.py` recomputes them
418from the fixture's own instruction lines with the reference of `tools/salu_diff.py`, the model that was compared
419with hardware. Both GPU runners compare the whole 80-word heap, the untouched fill after the results included. Run
420it alone with `python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_w32_salu_ext --require-pass`.
421On 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
422translator rules broken one at a time each failed it on both: `s_ashr_i32` shifting in zeros (word 8),
423`s_lshlN_add_u32` taking SCC from the add's carry alone (word 69), `s_abs_i32` negating (word 17), `s_mulk_i32` and
424`s_addk_i32` zero-extending their immediate (words 37 and 21), `s_cmovk_i32` ignoring SCC (word 38), the 64-bit
425shifts taking their count modulo 32 and `s_ashr_i64` shifting in zeros (word 51), and the 64-bit shifts taking SCC
426from the low dword alone (word 72).
427
406`cs_w32_shift64` checks `v_lshlrev_b64`, `v_lshrrev_b64` and `v_ashrrev_i64` with 64 memory-fed cases: 428`cs_w32_shift64` checks `v_lshlrev_b64`, `v_lshrrev_b64` and `v_ashrrev_i64` with 64 memory-fed cases:
407eight boundary values crossed with counts 0, 1, 31, 32, 33, 63, 64 and 65. The expected values come from Python 429eight boundary values crossed with counts 0, 1, 31, 32, 33, 63, 64 and 65. The expected values come from Python
408integers 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). 430integers 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).