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:
authorS1m0ne1997 <347981799+S1m0ne1997@users.noreply.github.com>2026-11-22 16:39:33 +0100
committerS1m0ne1997 <347981799+S1m0ne1997@users.noreply.github.com>2026-11-22 16:39:33 +0100
commit72a38ad24d5197cd057f05e35fcf74e853f8c562 (patch)
tree74d0a3a6653c940d0d9b2c775d8c05c08973e91c /scripts/run_gpu_tests.py
parent94f392ac75be65d64178e3dc0b5bda8be7dba805 (diff)
parent4eb6155d3ac4f9d3fadb0d095c4ce13e76783615 (diff)
Merge remote-tracking branch 'origin/main' into shader-33-vs-inputs
# Conflicts: # docs/design.md
Diffstat (limited to 'scripts/run_gpu_tests.py')
-rw-r--r--scripts/run_gpu_tests.py30
1 files changed, 23 insertions, 7 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index 5923d8b70..682427e66 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -25,7 +25,7 @@ sys.path.insert(0, os.path.join(ROOT, "tools"))
25import mc_command # noqa: E402 25import mc_command # noqa: E402
26sys.path.insert(0, SHADER_DIR) 26sys.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_sint32_test, fmt_xy_xyz_test 28from check import Skip, clip_test, fmt_1010102_test, fmt_sint32_test, fmt_xy_xyz_test, tbuffer_store_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, GRADIENT_TESTS, TEST_PROGRAMS, TEXTURE_MIP_DEPENDENCIES,
@@ -38,7 +38,7 @@ from check import gpu_test_timeout, timed_out # per-program time limit (LEONID
38from check import MESH_COMPUTE, mesh_env # LEONIDA_MESH_COMPUTE=1: mesh shaders as compute + a generated VS 38from check import MESH_COMPUTE, mesh_env # LEONIDA_MESH_COMPUTE=1: mesh shaders as compute + a generated VS
39from check import (WAVE32_LANE_DUMPS, WAVE32_LANE_ENV, bitmask_perm_narrow_skip, narrow_subgroup_skip, 39from check import (WAVE32_LANE_DUMPS, WAVE32_LANE_ENV, bitmask_perm_narrow_skip, narrow_subgroup_skip,
40 vcmpx_forms_narrow_skip, wave32_lane_skip) # as in check.py 40 vcmpx_forms_narrow_skip, wave32_lane_skip) # as in check.py
41from check import PIXEL_VERTEX, interp_f16_high_problem, ij_computed_problem # pixel producers and checks 41from check import PIXEL_VERTEX, interp_f16_high_problem, ij_computed_problem, mandelbrot_problem # pixel producers and checks
42from check import GET_LOD_TESTS, STORE_WORDS, get_lod_test, store_words_problem # TEST-184: image atomics and queries 42from check import GET_LOD_TESTS, STORE_WORDS, get_lod_test, store_words_problem # TEST-184: image atomics and queries
43from check import wide_pixel_skip # ps_w64x_readlane: judged only where the fragment stage was required 64-wide 43from check import wide_pixel_skip # ps_w64x_readlane: judged only where the fragment stage was required 64-wide
44 44
@@ -115,7 +115,7 @@ def assemble_to_s(llvm_mc: str, asm_path: str, s_path: str, name: str) -> None:
115 continue 115 continue
116 if ln.startswith("\t"): 116 if ln.startswith("\t"):
117 lines.append(ln) 117 lines.append(ln)
118 with open(s_path, "w", encoding="utf-8") as f: 118 with open(s_path, "w", encoding="utf-8", newline="\n") as f:
119 f.write("\n".join(lines) + "\n") 119 f.write("\n".join(lines) + "\n")
120 120
121 121
@@ -542,7 +542,9 @@ def check_clip_half(raw_path: str, want_b: float, want_a: float) -> tuple[bool,
542OTHER_HARNESS = {"ps_m15": "d3d12_translated_draw_test", "vs_m15": "d3d12_translated_draw_test", 542OTHER_HARNESS = {"ps_m15": "d3d12_translated_draw_test", "vs_m15": "d3d12_translated_draw_test",
543 "ps_m2": "d3d12_m2_textured_test", "vs_m2": "d3d12_m2_textured_test", "ps_m2_uoff": "d3d12_m2_textured_test", 543 "ps_m2": "d3d12_m2_textured_test", "vs_m2": "d3d12_m2_textured_test", "ps_m2_uoff": "d3d12_m2_textured_test",
544 "ps_m3": "d3d12_m3_frame_test", "vs_m3": "d3d12_m3_frame_test", 544 "ps_m3": "d3d12_m3_frame_test", "vs_m3": "d3d12_m3_frame_test",
545 "ps_m3_post": "d3d12_m3_frame_test"} 545 "ps_m3_post": "d3d12_m3_frame_test",
546 "cs_m4_fill": "d3d12_m4_compute_test", "cs_m4_indirect": "d3d12_m4_compute_test",
547 "cs_buf_typed": "d3d12_buffer_uav_test", "cs_buf_counter": "d3d12_buffer_uav_test"}
546 548
547 549
548# Shaders a selected test draws with, built even when the filter leaves them out (#192). 550# Shaders a selected test draws with, built even when the filter leaves them out (#192).
@@ -840,6 +842,10 @@ def run_suite(a, work: str) -> int:
840 # TEST-185: xy/xyz format loads and stores, words measured natively on a Radeon 680M (the .asm header) 842 # TEST-185: xy/xyz format loads and stores, words measured natively on a Radeon 680M (the .asm header)
841 problem = fmt_xy_xyz_test(a.build, spirv_dir, cs_env) 843 problem = fmt_xy_xyz_test(a.build, spirv_dir, cs_env)
842 results.append((name, not problem, problem or "128/128 dumped words exact")) 844 results.append((name, not problem, problem or "128/128 dumped words exact"))
845 elif name == "cs_tbuffer_store":
846 # tbuffer_store_format_*: the instruction's format, words measured natively on a Radeon 680M (the .asm header)
847 problem = tbuffer_store_test(a.build, spirv_dir, cs_env)
848 results.append((name, not problem, problem or "128/128 dumped words exact"))
843 elif name == "cs_global_neg_offset": 849 elif name == "cs_global_neg_offset":
844 # Negative global_load/global_store offsets (cs_global_neg_offset.asm): 40 groups give a 0x2800-byte 850 # Negative global_load/global_store offsets (cs_global_neg_offset.asm): 40 groups give a 0x2800-byte
845 # heap holding both the right addresses and the 4096-lower ones. One thread, no wave64 requirement. 851 # heap holding both the right addresses and the 4096-lower ones. One thread, no wave64 requirement.
@@ -880,7 +886,7 @@ def run_suite(a, work: str) -> int:
880 "cs_w64x_lds_war", "cs_w64x_partial", "cs_w64x_sbarrier", "cs_w64x_load_ballot_load", 886 "cs_w64x_lds_war", "cs_w64x_partial", "cs_w64x_sbarrier", "cs_w64x_load_ballot_load",
881 "cs_w64x_mask_reuse", "cs_w64x_mask_reuse2", "cs_w64x_chain_barrier", "cs_barrier_divergent", 887 "cs_w64x_mask_reuse", "cs_w64x_mask_reuse2", "cs_w64x_chain_barrier", "cs_barrier_divergent",
882 "cs_bpermute32", "cs_w64x_partial_scmp", "cs_w32_partial_scmp", "cs_barrier_early_end", 888 "cs_bpermute32", "cs_w64x_partial_scmp", "cs_w32_partial_scmp", "cs_barrier_early_end",
883 "cs_barrier_loop", "cs_w64x_andn2_exec", "cs_w64x_saveexec_b64"): 889 "cs_barrier_loop", "cs_w64x_andn2_exec", "cs_w64x_saveexec_b64", "cs_lds_b64_cmpst"):
884 cs_dump_wants = { 890 cs_dump_wants = {
885 "cs_store": [0x400080FF, 0xE00003FF, 0x3C004000, 0xEEEEEEEE, 0x40003C00, 0xBC003800, 0x40FF8000, 0x3FF00000], 891 "cs_store": [0x400080FF, 0xE00003FF, 0x3C004000, 0xEEEEEEEE, 0x40003C00, 0xBC003800, 0x40FF8000, 0x3FF00000],
886 # base + soffset + imm (cs_smem_soffset_imm.asm); out[4..7] are seeds the shader leaves alone 892 # base + soffset + imm (cs_smem_soffset_imm.asm); out[4..7] are seeds the shader leaves alone
@@ -902,6 +908,9 @@ def run_suite(a, work: str) -> int:
902 "cs_w32_salu64": [0x1E6A2C48, 0x1234, 0xFFFFFFFF, 0x100, 47, 48, 0xFFFF8000, 0xFFFFFFFE], 908 "cs_w32_salu64": [0x1E6A2C48, 0x1234, 0xFFFFFFFF, 0x100, 47, 48, 0xFFFF8000, 0xFFFFFFFE],
903 # SHADER-85: ds_read_u8/i8_d16[_hi] (cs_w32_lds_u8_d16.asm header) 909 # SHADER-85: ds_read_u8/i8_d16[_hi] (cs_w32_lds_u8_d16.asm header)
904 "cs_w32_lds_u8_d16": [0xBEEF00FF, 0x00FF1234, 0xBEEFFF80, 0xFF801234, 0xBEEF007F, 0x007F1234, 0xBEEF0080, 0xFFFF1234], 910 "cs_w32_lds_u8_d16": [0xBEEF00FF, 0x00FF1234, 0xBEEFFF80, 0xFF801234, 0xBEEF007F, 0x007F1234, 0xBEEF0080, 0xFFFF1234],
911 # ds_cmpst_b32 and the b64 2-address forms (cs_lds_b64_cmpst.asm header)
912 "cs_lds_b64_cmpst": [0x11110001, 0x22220002, 0x33330003, 0x44440004,
913 0xCCCC000C, 0x44440004, 0xBBBB000B, 0x3579BADC],
905 # constant EXEC masks (cs_exec_const.asm): each lane takes its own bit of the constant 914 # constant EXEC masks (cs_exec_const.asm): each lane takes its own bit of the constant
906 "cs_exec_const": [16, 8, 2, 16, 0, 16], 915 "cs_exec_const": [16, 8, 2, 16, 0, 16],
907 # constant lane masks: lane L takes bit L (cs_w32_mask_imm.asm / cs_w64_mask_imm.asm headers) 916 # constant lane masks: lane L takes bit L (cs_w32_mask_imm.asm / cs_w64_mask_imm.asm headers)
@@ -970,7 +979,8 @@ def run_suite(a, work: str) -> int:
970 "cs_w32_permute", "cs_barrier_divergent", "cs_barrier_early_end", "cs_barrier_loop", 979 "cs_w32_permute", "cs_barrier_divergent", "cs_barrier_early_end", "cs_barrier_loop",
971 "cs_w32_lds_u8_d16", "cs_w32_int_ext", "cs_w32_salu64", "cs_w32_misc_ext", "cs_w32_new_ops", 980 "cs_w32_lds_u8_d16", "cs_w32_int_ext", "cs_w32_salu64", "cs_w32_misc_ext", "cs_w32_new_ops",
972 "cs_bpermute32", "cs_w32_partial_scmp", "cs_w32_sincos", 981 "cs_bpermute32", "cs_w32_partial_scmp", "cs_w32_sincos",
973 "cs_exec_const", "cs_w32_mask_imm", "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", 982 "cs_lds_b64_cmpst", "cs_exec_const", "cs_w32_mask_imm",
983 "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8",
974 "cs_dpp_ops", "cs_dpp_bound", "cs_dpp_bank", "cs_dpp_fi") and not emulated and not partial 984 "cs_dpp_ops", "cs_dpp_bound", "cs_dpp_bank", "cs_dpp_fi") and not emulated and not partial
975 if partial and not emulated: 985 if partial and not emulated:
976 cs_env = dict(os.environ, VKC_SUBGROUP_SIZE="64") 986 cs_env = dict(os.environ, VKC_SUBGROUP_SIZE="64")
@@ -982,7 +992,8 @@ def run_suite(a, work: str) -> int:
982 ok, detail = None, str(skip) 992 ok, detail = None, str(skip)
983 else: 993 else:
984 ok, detail = judge_cs_dump(rc, msg, want, wave64=wave64, partial=partial, emulated=emulated, 994 ok, detail = judge_cs_dump(rc, msg, want, wave64=wave64, partial=partial, emulated=emulated,
985 hexwords=name in ("cs_store", "cs_smem_soffset_imm", "cs_w32_lds_u8_d16")) 995 hexwords=name in ("cs_store", "cs_smem_soffset_imm", "cs_w32_lds_u8_d16",
996 "cs_lds_b64_cmpst"))
986 results.append((name, ok, detail)) 997 results.append((name, ok, detail))
987 elif name == "cs_imgstore": 998 elif name == "cs_imgstore":
988 rc, msg = run_cmd([vk_store, spv]) 999 rc, msg = run_cmd([vk_store, spv])
@@ -1173,6 +1184,11 @@ def run_suite(a, work: str) -> int:
1173 with open(raw, "rb") as source: 1184 with open(raw, "rb") as source:
1174 problem = ij_computed_problem(list(struct.iter_unpack("<4I", source.read()))) 1185 problem = ij_computed_problem(list(struct.iter_unpack("<4I", source.read())))
1175 ok, detail = not problem, problem or "computed I/J pair words and v/2 within 1e-6" 1186 ok, detail = not problem, problem or "computed I/J pair words and v/2 within 1e-6"
1187 elif name == "ps_mandelbrot":
1188 with open(raw, "rb") as source:
1189 px = list(struct.iter_unpack("<4I", source.read()))
1190 problem = mandelbrot_problem(px)
1191 ok, detail = not problem, problem or f"{len(px)}/{len(px)} iteration counts match the float32 model"
1176 else: 1192 else:
1177 ok, detail = False, "no checker defined" 1193 ok, detail = False, "no checker defined"
1178 results.append((name, ok, detail)) 1194 results.append((name, ok, detail))