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:
authorJan Trencansky <jan.trencansky@protonmail.com>2026-11-22 07:33:23 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-22 07:33:23 -0500
commitf3977cac42a39bd699fd64ba13e4b5eed612cab9 (patch)
tree09277a5a0919435913557571a666f72658ea5d87 /scripts/run_gpu_tests.py
parent72b5b7820d51f9586822b2bd7e5e384322a28027 (diff)
parent41f448261e1de8a410b4d760e69a7e5656cef858 (diff)
Merge main into test-184-image-ops
main is at 41f44826. Two conflicts, both sides kept: - docs/design.md: both sides edited the one-line "Ray tracing" row. Main's row (the triangle node types and their vertex slots), with this branch's sentence about cs_bvh32 where it stood. - tests/test_shader_checks.py: main counts ps_ssharp (9 -> 10) and patches sampler_test on the lines next to this branch's STORE_WORDS / GET_LOD_TESTS terms and its get_lod_test patch. All four lines. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'scripts/run_gpu_tests.py')
-rw-r--r--scripts/run_gpu_tests.py45
1 files changed, 35 insertions, 10 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index 2d2f0b064..32a02cdaf 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -27,6 +27,7 @@ sys.path.insert(0, SHADER_DIR)
27from build import CLIP_CASES, clip_container, shader_source 27from build import CLIP_CASES, clip_container, shader_source
28from check import Skip, clip_test, fmt_1010102_test, fmt_xy_xyz_test 28from check import Skip, clip_test, fmt_1010102_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 (CMPX_CLASS_WORDS, CVT_F32_SAT_CASES, GRADIENT_TESTS, TEST_PROGRAMS, TEXTURE_MIP_DEPENDENCIES, 31from check import (CMPX_CLASS_WORDS, CVT_F32_SAT_CASES, GRADIENT_TESTS, TEST_PROGRAMS, TEXTURE_MIP_DEPENDENCIES,
31 TEXTURE_MIP_TEST, GATHER_LOD_TEST, MIP_TEST_PASSES, GATHER_WRAP, USER_SGPRS_ENV, USER_SGPRS_WORDS, Skip, mesh_v5_test, not_found_message, 32 TEXTURE_MIP_TEST, GATHER_LOD_TEST, MIP_TEST_PASSES, GATHER_WRAP, USER_SGPRS_ENV, USER_SGPRS_WORDS, Skip, mesh_v5_test, not_found_message,
32 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)
@@ -536,7 +537,7 @@ def check_clip_half(raw_path: str, want_b: float, want_a: float) -> tuple[bool,
536# Shaders a selected test draws with, built even when the filter leaves them out (#192). 537# Shaders a selected test draws with, built even when the filter leaves them out (#192).
537DRAWN_WITH = {GATHER_LOD_TEST: "vs_ids.asm", "ps_flat": "vs_ids.asm", "ps_texture_sample": "vs_ids.asm", "ps_cube_sample": "vs_ids.asm", 538DRAWN_WITH = {GATHER_LOD_TEST: "vs_ids.asm", "ps_flat": "vs_ids.asm", "ps_texture_sample": "vs_ids.asm", "ps_cube_sample": "vs_ids.asm",
538 "ps_texture_sample_d16": "vs_ids.asm", "ps_sample_c_lz": "vs_ids.asm", "ps_sample_c_lz_a16": "vs_ids.asm", 539 "ps_texture_sample_d16": "vs_ids.asm", "ps_sample_c_lz": "vs_ids.asm", "ps_sample_c_lz_a16": "vs_ids.asm",
539 "ps_gather_wrap": "vs_ids.asm", 540 "ps_gather_wrap": "vs_ids.asm", "ps_ssharp": "vs_ids.asm",
540 **{name: "vs_ids.asm" for name in GRADIENT_TESTS}, "vs_clip": "ps_clip_color.asm", 541 **{name: "vs_ids.asm" for name in GRADIENT_TESTS}, "vs_clip": "ps_clip_color.asm",
541 "ps_interp_f16_high": "vs_f16_pack.asm", "ms_f16_pack": "ps_interp_f16_high.asm", 542 "ps_interp_f16_high": "vs_f16_pack.asm", "ms_f16_pack": "ps_interp_f16_high.asm",
542 "ps_interp_f32_mods": "vs_interp_consts.asm", "ps_interp_mov_mods": "vs_interp_consts.asm"} 543 "ps_interp_f32_mods": "vs_interp_consts.asm", "ps_interp_mov_mods": "vs_interp_consts.asm"}
@@ -622,8 +623,22 @@ def main() -> int:
622 shutil.rmtree(work, ignore_errors=True) 623 shutil.rmtree(work, ignore_errors=True)
623 624
624 625
626def _w64_graphics_only() -> frozenset:
627 try:
628 import w64_graphics
629 except ImportError:
630 return frozenset()
631 return frozenset(w64_graphics.FIXTURES)
632
633
634W64_GRAPHICS_ONLY = _w64_graphics_only()
635
636
625def run_suite(a, work: str) -> int: 637def run_suite(a, work: str) -> int:
626 asm_files = sorted({f for f in os.listdir(SHADER_DIR) if f.endswith(".asm")} | {n + ".asm" for n in CLIP_CASES}) 638 asm_files = sorted({f for f in os.listdir(SHADER_DIR) if f.endswith(".asm")} | {n + ".asm" for n in CLIP_CASES})
639 # The wave64 pixel fixtures of runtime/test/shaders/w64_graphics.py (tiers A-C, #1541) are checked by that
640 # runner, not here: they need a 64-wide fragment subgroup or the halves-aware lowering it drives.
641 asm_files = [f for f in asm_files if f[:-4] not in W64_GRAPHICS_ONLY]
627 if a.filter: 642 if a.filter:
628 asm_files = [f for f in asm_files if a.filter in f] 643 asm_files = [f for f in asm_files if a.filter in f]
629 if not asm_files: 644 if not asm_files:
@@ -831,7 +846,7 @@ def run_suite(a, work: str) -> int:
831 # Whole-wave mask test, as in check.py: needs a 64-wide subgroup, skipped where the device has none. 846 # Whole-wave mask test, as in check.py: needs a 64-wide subgroup, skipped where the device has none.
832 # With LEONIDA_W64_EMULATE=1 it was translated with --wave64-emulate and runs on any subgroup size. 847 # With LEONIDA_W64_EMULATE=1 it was translated with --wave64-emulate and runs on any subgroup size.
833 results.append((name,) + wavemask_check(vk_compute, spv, cs_env, w64_emulated())) 848 results.append((name,) + wavemask_check(vk_compute, spv, cs_env, w64_emulated()))
834 elif name in ("cs_store", "cs_smem_soffset_imm", "cs_w32_lane_wrap", "cs_movrelsd_2", "cs_w32_permute", "cs_exec_const", "cs_w32_mask_imm", "cs_w64_mask_imm", "cs_w32_lds_u8_d16", "cs_w32_int_ext", "cs_wave64_ballot", "cs_wm_half_ops", "cs_wm_half_cmp", "cs_wm_bfm64", "cs_wm_scc_rfl", "cs_wqm_w64", "cs_wqm_w32", "cs_wqm_w64_half", 849 elif name in ("cs_store", "cs_smem_soffset_imm", "cs_w32_lane_wrap", "cs_movrelsd_2", "cs_w32_permute", "cs_exec_const", "cs_w32_mask_imm", "cs_w64_mask_imm", "cs_w32_lds_u8_d16", "cs_w32_int_ext", "cs_w32_salu64", "cs_wave64_ballot", "cs_wm_half_ops", "cs_wm_half_cmp", "cs_wm_bfm64", "cs_wm_scc_rfl", "cs_wqm_w64", "cs_wqm_w32", "cs_wqm_w64_half",
835 "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", "cs_dpp_ops", "cs_dpp_bank", "cs_dpp_fi", 850 "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", "cs_dpp_ops", "cs_dpp_bank", "cs_dpp_fi",
836 "cs_dpp_bound", "cs_dpp_w64", 851 "cs_dpp_bound", "cs_dpp_w64",
837 "cs_w64_mask_detect", 852 "cs_w64_mask_detect",
@@ -854,6 +869,8 @@ def run_suite(a, work: str) -> int:
854 "cs_w32_permute": [218, 29, 8, 211, 0, 15, 99, 15], 869 "cs_w32_permute": [218, 29, 8, 211, 0, 15, 99, 15],
855 # integer ops with CPU-only checks until now (cs_w32_int_ext.asm) 870 # integer ops with CPU-only checks until now (cs_w32_int_ext.asm)
856 "cs_w32_int_ext": [1, 27, 1, 0x33332222, 0xC0000000, 0x4000, 18, 0x20304050], 871 "cs_w32_int_ext": [1, 27, 1, 0x33332222, 0xC0000000, 0x4000, 18, 0x20304050],
872 # 64-bit scalar data ops and v_mad_u64_u32 (cs_w32_salu64.asm)
873 "cs_w32_salu64": [0x1E6A2C48, 0x1234, 0xFFFFFFFF, 0x100, 47, 48, 0xFFFF8000, 0xFFFFFFFE],
857 # SHADER-85: ds_read_u8/i8_d16[_hi] (cs_w32_lds_u8_d16.asm header) 874 # SHADER-85: ds_read_u8/i8_d16[_hi] (cs_w32_lds_u8_d16.asm header)
858 "cs_w32_lds_u8_d16": [0xBEEF00FF, 0x00FF1234, 0xBEEFFF80, 0xFF801234, 0xBEEF007F, 0x007F1234, 0xBEEF0080, 0xFFFF1234], 875 "cs_w32_lds_u8_d16": [0xBEEF00FF, 0x00FF1234, 0xBEEFFF80, 0xFF801234, 0xBEEF007F, 0x007F1234, 0xBEEF0080, 0xFFFF1234],
859 # constant EXEC masks (cs_exec_const.asm): each lane takes its own bit of the constant 876 # constant EXEC masks (cs_exec_const.asm): each lane takes its own bit of the constant
@@ -909,8 +926,8 @@ def run_suite(a, work: str) -> int:
909 } 926 }
910 want = cs_dump_wants[name] 927 want = cs_dump_wants[name]
911 # Every dump but cs_store / cs_smem_soffset_imm / cs_w32_lane_wrap / cs_movrelsd_2 / cs_w32_permute / 928 # Every dump but cs_store / cs_smem_soffset_imm / cs_w32_lane_wrap / cs_movrelsd_2 / cs_w32_permute /
912 # cs_w32_lds_u8_d16 / cs_w32_int_ext, the wave32 cs_wqm_w32 / cs_bpermute32 and the DPP tests is a whole-wave (wave64) 929 # cs_w32_lds_u8_d16 / cs_w32_int_ext / cs_w32_salu64, the wave32 cs_wqm_w32 / cs_bpermute32 and the DPP
913 # mask test: ask for a 64-wide subgroup and skip, as check.py does, where the device has none 930 # tests is a whole-wave (wave64) mask test: ask for a 64-wide subgroup and skip, as check.py does, where the device has none
914 # (vk_compute_test exits 77) instead of reporting a failure. With LEONIDA_W64_EMULATE=1 they were 931 # (vk_compute_test exits 77) instead of reporting a failure. With LEONIDA_W64_EMULATE=1 they were
915 # translated with --wave64-emulate and run on any subgroup size. 932 # translated with --wave64-emulate and run on any subgroup size.
916 # cs_w64x_partial and cs_w64x_partial_scmp (40-thread groups) can't have full subgroups: they ask for 933 # cs_w64x_partial and cs_w64x_partial_scmp (40-thread groups) can't have full subgroups: they ask for
@@ -919,7 +936,7 @@ def run_suite(a, work: str) -> int:
919 partial = name in ("cs_w64x_partial", "cs_w64x_partial_scmp") 936 partial = name in ("cs_w64x_partial", "cs_w64x_partial_scmp")
920 wave64 = name not in ("cs_store", "cs_smem_soffset_imm", "cs_wqm_w32", "cs_w32_lane_wrap", "cs_movrelsd_2", 937 wave64 = name not in ("cs_store", "cs_smem_soffset_imm", "cs_wqm_w32", "cs_w32_lane_wrap", "cs_movrelsd_2",
921 "cs_w32_permute", "cs_barrier_divergent", "cs_barrier_early_end", "cs_barrier_loop", 938 "cs_w32_permute", "cs_barrier_divergent", "cs_barrier_early_end", "cs_barrier_loop",
922 "cs_w32_lds_u8_d16", "cs_w32_int_ext", "cs_bpermute32", "cs_w32_partial_scmp", 939 "cs_w32_lds_u8_d16", "cs_w32_int_ext", "cs_w32_salu64", "cs_bpermute32", "cs_w32_partial_scmp",
923 "cs_exec_const", "cs_w32_mask_imm", "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", 940 "cs_exec_const", "cs_w32_mask_imm", "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8",
924 "cs_dpp_ops", "cs_dpp_bound", "cs_dpp_bank", "cs_dpp_fi") and not emulated and not partial 941 "cs_dpp_ops", "cs_dpp_bound", "cs_dpp_bank", "cs_dpp_fi") and not emulated and not partial
925 if partial and not emulated: 942 if partial and not emulated:
@@ -1003,6 +1020,11 @@ def run_suite(a, work: str) -> int:
1003 results.append((name, None, f"SKIP ({reason})")) 1020 results.append((name, None, f"SKIP ({reason})"))
1004 else: 1021 else:
1005 results.append((name, rc == 0, lines[-1] if lines else "")) 1022 results.append((name, rc == 0, lines[-1] if lines else ""))
1023 elif name == "ps_ssharp":
1024 # The S#/T# mip fields through vulkan_sampler() and the view range (check.py's SAMPLER_CASES).
1025 problem = sampler_test(a.build, spirv_dir)
1026 results.append((name, None if isinstance(problem, Skip) else not problem,
1027 problem or f"{len(SAMPLER_CASES)} S#/T# cases, 4096 pixels each exact"))
1006 elif name in ("ps_texoff", "ps_texoff_implicit"): 1028 elif name in ("ps_texoff", "ps_texoff_implicit"):
1007 # Texel offsets: needs vk_texture_test's texture, sampler and descriptor table (vk_harness binds none), 1029 # Texel offsets: needs vk_texture_test's texture, sampler and descriptor table (vk_harness binds none),
1008 # and VK_KHR_maintenance8 for the non-constant Offset; the tool exits 77 without it. 1030 # and VK_KHR_maintenance8 for the non-constant Offset; the tool exits 77 without it.
@@ -1038,17 +1060,17 @@ def run_suite(a, work: str) -> int:
1038 continue 1060 continue
1039 const_wants = { 1061 const_wants = {
1040 "ps_clip_color": (0x3E800000, 0x3F000000, 0x3F400000, 0x3F800000), 1062 "ps_clip_color": (0x3E800000, 0x3F000000, 0x3F400000, 0x3F800000),
1041 "ps_ops": (0x48804300, 5, 7, 0xFFFFFFFC), 1063 "ps_ops": (0x48804300, 5, 7, 0xBFFFFFFC),
1042 "ps_ops2": (0xABCD4400, 0x46001234, 0xFFFFFFFA, 7), 1064 "ps_ops2": (0xABCD4400, 0x46001234, 0xBFFFFFFA, 7),
1043 "ps_ops3": (0xFFFFFFFA, 0x44660066, 0x44AABBCC, 16), 1065 "ps_ops3": (0xBFFFFFFA, 0x44660066, 0x44AABBCC, 16),
1044 "ps_ops4": (0x34000010, 0x00120800, 0xBEEF0000, 0x12343C00), 1066 "ps_ops4": (0x34000010, 0x00120800, 0xBEEF0000, 0x12343C00),
1045 "ps_scc": (1, 1, 3, 0x80000000), 1067 "ps_scc": (1, 1, 3, 0x80000000),
1046 "ps_sdwa": (0x000000F1, 0xFFFEFFF2, 0x3C003344, 0xFFF70000), 1068 "ps_sdwa": (0x000000F1, 0xBFFEFFF2, 0x3C003344, 0xBFF70000),
1047 "ps_legacy_mul": (0, 0, 0, 0x40C00000), # same expectation as check.py 1069 "ps_legacy_mul": (0, 0, 0, 0x40C00000), # same expectation as check.py
1048 "ps_ops5": (0x12340010, 0xBEEF0800, 0xAAAAFFFF, 0xDEADBC00), # from the .asm headers 1070 "ps_ops5": (0x12340010, 0xBEEF0800, 0xAAAAFFFF, 0xDEADBC00), # from the .asm headers
1049 "ps_ops6": (0xF800FFFF, 0x01000010, 0x00800800, 0x8000FFF0), 1071 "ps_ops6": (0xF800FFFF, 0x01000010, 0x00800800, 0x8000FFF0),
1050 "ps_ops7": (0x00FF8077, 0xFF0000FF, 0x89ABCDEF, 0x00070003), 1072 "ps_ops7": (0x00FF8077, 0xFF0000FF, 0x89ABCDEF, 0x00070003),
1051 "ps_ops8": (0x80000000, 0xFFFFFFFF, 0x000F100E, 0x0F0F0F1F), 1073 "ps_ops8": (0x80000000, 0xBFFFFFFF, 0x000F100E, 0x0F0F0F1F),
1052 "ps_f32_mods": (0xC0256A01, 0x3F800000, 0x41E00000, 0x3FC00000), 1074 "ps_f32_mods": (0xC0256A01, 0x3F800000, 0x41E00000, 0x3FC00000),
1053 "ps_vcc_x2": (0x11223344, 0x55667788, 0, 0), 1075 "ps_vcc_x2": (0x11223344, 0x55667788, 0, 0),
1054 "ps_vcmpx_forms": (0xF05B2A48, 0xF05E8A12, 0xB174BE18, 0x15550000), # 14 v_cmpx forms (.asm header) 1076 "ps_vcmpx_forms": (0xF05B2A48, 0xF05E8A12, 0xB174BE18, 0x15550000), # 14 v_cmpx forms (.asm header)
@@ -1076,6 +1098,9 @@ def run_suite(a, work: str) -> int:
1076 "ps_vop3_const_mods": (0xC0000000, 0xBF800000, 0x3F800000, 0xAAAABC00), 1098 "ps_vop3_const_mods": (0xC0000000, 0xBF800000, 0x3F800000, 0xAAAABC00),
1077 "ps_interp_f32_mods": (0x3F800000, 0x00000000, 0x3F400000, 0x3F800000), # drawn with vs_interp_consts 1099 "ps_interp_f32_mods": (0x3F800000, 0x00000000, 0x3F400000, 0x3F800000), # drawn with vs_interp_consts
1078 "ps_interp_mov_mods": (0x3F800000, 0x3FC00000, 0x40000000, 0x3F400000), 1100 "ps_interp_mov_mods": (0x3F800000, 0x3FC00000, 0x40000000, 0x3F400000),
1101 # v_mad_u32_u16 / v_mad_i32_i16 and v_subrev_f16, which had CPU checks only (.asm headers)
1102 "ps_valu16_mad": (0x00000002, 0x00030002, 0x00008000, 0x00000004),
1103 "ps_valu16_subrev": (0xAAAABC00, 0xAAAAC000, 0xAAAA3C00, 0x42003800),
1079 } 1104 }
1080 if name in const_wants: 1105 if name in const_wants:
1081 ok, detail = check_pixel_const(raw, const_wants[name]) 1106 ok, detail = check_pixel_const(raw, const_wants[name])