upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/scripts/run_gpu_tests.py
diff options
context:
space:
mode:
authorJustDown <121580190+JustDownTV@users.noreply.github.com>2026-11-22 00:41:15 +0100
committerJustDown <121580190+JustDownTV@users.noreply.github.com>2026-11-22 15:48:12 +0100
commit9df596963a26f95662ece759da17be033e83c379 (patch)
treebb882fb8c68340c96dc47b833ee9d3209f9f7936 /scripts/run_gpu_tests.py
parent6a6704df1592e1dc4a3215ddf1423a78adb52045 (diff)
Translator: v_cvt_pk_u8_f32 NaN gives 0, with RDNA2-measured GPU test (SHADER-48)
Measured natively on an RDNA2 iGPU (gfx1036): v_cvt_pk_u8_f32 rounds to nearest even, clamps to [0, 255] and gives 0 for NaN. The RoundEven rule was right; NaN reached FClamp, which is undefined for a NaN operand, so it is now replaced by +0 first. cs_cvt_pk_u8.asm holds eight hardware words (four byte selects), checked by check.py and run_gpu_tests.py, and bit-for-bit on the CPU by tests/semantic/test_cvt_pk_u8.py. Contract-table row added. Fixes #358
Diffstat (limited to 'scripts/run_gpu_tests.py')
-rw-r--r--scripts/run_gpu_tests.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index d1d6e402d..efd08031c 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -28,7 +28,7 @@ from build import CLIP_CASES, clip_container, shader_source
28from check import Skip, clip_test, fmt_1010102_test, fmt_sint32_test, fmt_xy_xyz_test 28from check import Skip, clip_test, fmt_1010102_test, fmt_sint32_test, fmt_xy_xyz_test
29from compute_fixture import compute_header 29from compute_fixture import compute_header
30from check import SAMPLER_CASES, sampler_test # ps_ssharp: the S#/T# mip fields (vk_sampler_test) 30from check import SAMPLER_CASES, sampler_test # ps_ssharp: the S#/T# mip fields (vk_sampler_test)
31from check import (CMPX_CLASS_WORDS, CVT_F32_SAT_CASES, GRADIENT_TESTS, TEST_PROGRAMS, TEXTURE_MIP_DEPENDENCIES, 31from check import (CMPX_CLASS_WORDS, CVT_F32_SAT_CASES, CVT_PK_U8_WORDS, GRADIENT_TESTS, TEST_PROGRAMS, TEXTURE_MIP_DEPENDENCIES,
32 TEXTURE_MIP_TEST, GATHER_LOD_TEST, MIP_TEST_PASSES, TEXTURE_CONSTANTS, USER_SGPRS_ENV, USER_SGPRS_WORDS, Skip, mesh_v5_test, not_found_message, 32 TEXTURE_MIP_TEST, GATHER_LOD_TEST, MIP_TEST_PASSES, TEXTURE_CONSTANTS, USER_SGPRS_ENV, USER_SGPRS_WORDS, Skip, mesh_v5_test, not_found_message,
33 pick_build_dir, start_failure, texture_gradient_a16_test, texture_mip_test) 33 pick_build_dir, start_failure, texture_gradient_a16_test, texture_mip_test)
34from check import SIGNED_MIP_TEST 34from check import SIGNED_MIP_TEST
@@ -803,10 +803,10 @@ def run_suite(a, work: str) -> int:
803 results.append((name, ok, problem or f"4096 pixels in each of {len(GET_LOD_TESTS[name])} draw(s): the " 803 results.append((name, ok, problem or f"4096 pixels in each of {len(GET_LOD_TESTS[name])} draw(s): the "
804 "clamped and the calculated LOD within 1/16")) 804 "clamped and the calculated LOD within 1/16"))
805 elif name in ("cs_bounds", "cs_smem_bounds", "cs_smem_stride_align", "cs_smem_sload_neg", "cs_buf_tail", "cs_oob_select", "cs_oob_tail", 805 elif name in ("cs_bounds", "cs_smem_bounds", "cs_smem_stride_align", "cs_smem_sload_neg", "cs_buf_tail", "cs_oob_select", "cs_oob_tail",
806 "cs_buf_swizzle", "cs_cmpx_class_f32"): 806 "cs_buf_swizzle", "cs_cmpx_class_f32", "cs_cvt_pk_u8"):
807 # num_records bounds check (cs_bounds.asm): the out-of-bounds store is dropped and the out-of-bounds 807 # num_records bounds check (cs_bounds.asm): the out-of-bounds store is dropped and the out-of-bounds
808 # load reads 0, so thread 0's four output words are fixed. One thread, no wave64 requirement. 808 # load reads 0, so thread 0's four output words are fixed. One thread, no wave64 requirement.
809 # cs_cmpx_class_f32 is per-lane and needs no particular subgroup width either. 809 # cs_cmpx_class_f32 and cs_cvt_pk_u8 are per-lane and need no particular subgroup width either.
810 # The other four pin the SMEM and raw MUBUF rules measured on an RX 6800 (derivations in each .asm). 810 # The other four pin the SMEM and raw MUBUF rules measured on an RX 6800 (derivations in each .asm).
811 rc, msg = run_cmd([vk_compute, spv, "1", "dump"], env=cs_env) 811 rc, msg = run_cmd([vk_compute, spv, "1", "dump"], env=cs_env)
812 want = { 812 want = {
@@ -824,6 +824,7 @@ def run_suite(a, work: str) -> int:
824 "cs_buf_swizzle": [0x5EED0024, 0x5EED0044, 0x5EED004C, 0x5EED0008, 0x5EED0028, 0, 0xBEEF0000, 824 "cs_buf_swizzle": [0x5EED0024, 0x5EED0044, 0x5EED004C, 0x5EED0008, 0x5EED0028, 0, 0xBEEF0000,
825 0xBEEF0001], 825 0xBEEF0001],
826 "cs_cmpx_class_f32": CMPX_CLASS_WORDS, 826 "cs_cmpx_class_f32": CMPX_CLASS_WORDS,
827 "cs_cvt_pk_u8": CVT_PK_U8_WORDS,
827 }[name] 828 }[name]
828 words = dump_words(msg) 829 words = dump_words(msg)
829 vals = words[:len(want)] if words else [] 830 vals = words[:len(want)] if words else []