diff options
Diffstat (limited to 'scripts/run_gpu_tests.py')
| -rw-r--r-- | scripts/run_gpu_tests.py | 80 |
1 files changed, 58 insertions, 22 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py index 94de20f26..66400b57a 100644 --- a/scripts/run_gpu_tests.py +++ b/scripts/run_gpu_tests.py | |||
| @@ -38,6 +38,7 @@ from check import judged_words, words_match # dump words not judged on some de | |||
| 38 | from check import TEXOFF_ARGS, texoff_problem # ps_texoff's expected words and arguments live in check.py | 38 | from check import TEXOFF_ARGS, texoff_problem # ps_texoff's expected words and arguments live in check.py |
| 39 | from check import TEXOFF_FALLBACK, texoff_env # LEONIDA_TEXOFF_FALLBACK=1: texel offsets without maintenance8 | 39 | from check import TEXOFF_FALLBACK, texoff_env # LEONIDA_TEXOFF_FALLBACK=1: texel offsets without maintenance8 |
| 40 | from check import gpu_test_timeout, timed_out # per-program time limit (LEONIDA_GPU_TEST_TIMEOUT) | 40 | from check import gpu_test_timeout, timed_out # per-program time limit (LEONIDA_GPU_TEST_TIMEOUT) |
| 41 | from check import run_readback | ||
| 41 | from check import MESH_COMPUTE, mesh_env # LEONIDA_MESH_COMPUTE=1: mesh shaders as compute + a generated VS | 42 | from check import MESH_COMPUTE, mesh_env # LEONIDA_MESH_COMPUTE=1: mesh shaders as compute + a generated VS |
| 42 | from check import (WAVE32_LANE_DUMPS, WAVE32_LANE_ENV, bitmask_perm_narrow_skip, narrow_subgroup_skip, | 43 | from check import (WAVE32_LANE_DUMPS, WAVE32_LANE_ENV, bitmask_perm_narrow_skip, narrow_subgroup_skip, |
| 43 | unpinned_subgroup_skip, vcmpx_forms_narrow_skip, wave32_lane_skip) # as in check.py | 44 | unpinned_subgroup_skip, vcmpx_forms_narrow_skip, wave32_lane_skip) # as in check.py |
| @@ -566,7 +567,7 @@ def check_clip_half(raw_path: str, want_b: float, want_a: float) -> tuple[bool, | |||
| 566 | # checker runs them: the test program that owns them judges them. | 567 | # checker runs them: the test program that owns them judges them. |
| 567 | OTHER_HARNESS = {"ps_m15": "d3d12_translated_draw_test", "vs_m15": "d3d12_translated_draw_test", | 568 | OTHER_HARNESS = {"ps_m15": "d3d12_translated_draw_test", "vs_m15": "d3d12_translated_draw_test", |
| 568 | "ps_m2": "d3d12_m2_textured_test", "vs_m2": "d3d12_m2_textured_test", "ps_m2_uoff": "d3d12_m2_textured_test", | 569 | "ps_m2": "d3d12_m2_textured_test", "vs_m2": "d3d12_m2_textured_test", "ps_m2_uoff": "d3d12_m2_textured_test", |
| 569 | "ps_m2_array": "d3d12_m2_formats_test", | 570 | "ps_m2_literal": "d3d12_m2_textured_test", "ps_m2_array": "d3d12_m2_formats_test", |
| 570 | "ps_m3": "d3d12_m3_frame_test", "vs_m3": "d3d12_m3_frame_test", | 571 | "ps_m3": "d3d12_m3_frame_test", "vs_m3": "d3d12_m3_frame_test", |
| 571 | "ps_m3_post": "d3d12_m3_frame_test", "ps_m3_query": "d3d12_m3_frame_test", | 572 | "ps_m3_post": "d3d12_m3_frame_test", "ps_m3_query": "d3d12_m3_frame_test", |
| 572 | "cs_m4_fill": "d3d12_m4_compute_test", "cs_m4_indirect": "d3d12_m4_compute_test", | 573 | "cs_m4_fill": "d3d12_m4_compute_test", "cs_m4_indirect": "d3d12_m4_compute_test", |
| @@ -576,6 +577,7 @@ OTHER_HARNESS = {"ps_m15": "d3d12_translated_draw_test", "vs_m15": "d3d12_transl | |||
| 576 | # Shaders a selected test draws with, built even when the filter leaves them out (#192). | 577 | # Shaders a selected test draws with, built even when the filter leaves them out (#192). |
| 577 | DRAWN_WITH = {GATHER_LOD_TEST: "vs_ids.asm", "ps_flat": "vs_ids.asm", "ps_texture_sample": "vs_ids.asm", "ps_cube_sample": "vs_ids.asm", | 578 | DRAWN_WITH = {GATHER_LOD_TEST: "vs_ids.asm", "ps_flat": "vs_ids.asm", "ps_texture_sample": "vs_ids.asm", "ps_cube_sample": "vs_ids.asm", |
| 578 | "ps_texture_sample_d16": "vs_ids.asm", "ps_sample_c_lz": "vs_ids.asm", "ps_sample_c_lz_a16": "vs_ids.asm", | 579 | "ps_texture_sample_d16": "vs_ids.asm", "ps_sample_c_lz": "vs_ids.asm", "ps_sample_c_lz_a16": "vs_ids.asm", |
| 580 | "ps_sample_c": "vs_ids.asm", "ps_sample_c_b": "vs_ids.asm", | ||
| 579 | **{name: "vs_ids.asm" for name in TEXTURE_CONSTANTS}, "ps_ssharp": "vs_ids.asm", "ps_imgatomic": "vs_ids.asm", | 581 | **{name: "vs_ids.asm" for name in TEXTURE_CONSTANTS}, "ps_ssharp": "vs_ids.asm", "ps_imgatomic": "vs_ids.asm", |
| 580 | **{name: "vs_ids.asm" for name in GRADIENT_TESTS}, "vs_clip": "ps_clip_color.asm", | 582 | **{name: "vs_ids.asm" for name in GRADIENT_TESTS}, "vs_clip": "ps_clip_color.asm", |
| 581 | "ps_interp_f16_high": "vs_f16_pack.asm", "ms_f16_pack": "ps_interp_f16_high.asm", | 583 | "ps_interp_f16_high": "vs_f16_pack.asm", "ms_f16_pack": "ps_interp_f16_high.asm", |
| @@ -616,6 +618,31 @@ def find_test_programs(build: str, ext: str) -> str | None: | |||
| 616 | return None | 618 | return None |
| 617 | 619 | ||
| 618 | 620 | ||
| 621 | def native_folder(path: str, ansi: str = "mbcs") -> str | None: | ||
| 622 | """`path` spelled so that the native programs this runner starts can open files under it, or None. | ||
| 623 | |||
| 624 | On Windows the test programs and the Vulkan SDK tools (spirv-val, spirv-as) read their command line in the ANSI | ||
| 625 | code page, so a character outside it, as in a Cyrillic or CJK user name under %TEMP%, reaches them as '?'. Such a | ||
| 626 | folder is replaced by its 8.3 short name, which is plain ASCII, when the volume keeps one. Elsewhere, and for a | ||
| 627 | path the code page holds, `path` comes back as it is. `ansi` is the codec of that code page (a parameter so a | ||
| 628 | test can pick a narrow one). | ||
| 629 | """ | ||
| 630 | def fits(p: str) -> bool: | ||
| 631 | try: | ||
| 632 | p.encode(ansi) | ||
| 633 | return True | ||
| 634 | except UnicodeEncodeError: | ||
| 635 | return False | ||
| 636 | |||
| 637 | if os.name != "nt" or fits(path): | ||
| 638 | return path | ||
| 639 | import ctypes | ||
| 640 | buf = ctypes.create_unicode_buffer(32768) | ||
| 641 | n = ctypes.windll.kernel32.GetShortPathNameW(path, buf, len(buf)) | ||
| 642 | short = buf.value if 0 < n < len(buf) else "" | ||
| 643 | return short if short and fits(short) else None | ||
| 644 | |||
| 645 | |||
| 619 | def main() -> int: | 646 | def main() -> int: |
| 620 | ap = argparse.ArgumentParser() | 647 | ap = argparse.ArgumentParser() |
| 621 | ap.add_argument("--llvm-mc", default=os.environ.get("LLVM_MC", "llvm-mc"), | 648 | ap.add_argument("--llvm-mc", default=os.environ.get("LLVM_MC", "llvm-mc"), |
| @@ -659,7 +686,14 @@ def main() -> int: | |||
| 659 | 686 | ||
| 660 | work = a.work or tempfile.mkdtemp(prefix="leonida_gpu_tests_") | 687 | work = a.work or tempfile.mkdtemp(prefix="leonida_gpu_tests_") |
| 661 | try: | 688 | try: |
| 662 | return run_suite(a, work) | 689 | os.makedirs(work, exist_ok=True) |
| 690 | native = native_folder(work) | ||
| 691 | if native is None: | ||
| 692 | print(f"error: the work folder {ascii(work)} has characters outside this PC's ANSI code page and no 8.3 " | ||
| 693 | "short name, so the test programs and the Vulkan SDK tools can't open files in it. Pass --work " | ||
| 694 | "with a folder whose path they can, such as C:\\leonida_gpu_work.", file=sys.stderr) | ||
| 695 | return 2 | ||
| 696 | return run_suite(a, native) | ||
| 663 | finally: | 697 | finally: |
| 664 | if a.work is None: | 698 | if a.work is None: |
| 665 | shutil.rmtree(work, ignore_errors=True) | 699 | shutil.rmtree(work, ignore_errors=True) |
| @@ -747,7 +781,7 @@ def run_suite(a, work: str) -> int: | |||
| 747 | cmd.append("--mesh-compute") | 781 | cmd.append("--mesh-compute") |
| 748 | if pc_tail_ubo(): # 128 push-constant bytes; heap base and code base from a uniform block at set 1 | 782 | if pc_tail_ubo(): # 128 push-constant bytes; heap base and code base from a uniform block at set 1 |
| 749 | cmd.append("--pc-tail-ubo") | 783 | cmd.append("--pc-tail-ubo") |
| 750 | if os.environ.get("LEONIDA_FMA") in ("glsl", "khr"): # fused multiply-add: GLSL Fma or OpFmaKHR (docs/design.md) | 784 | if os.environ.get("LEONIDA_FMA") in ("glsl", "khr", "exact"): # GLSL Fma, OpFmaKHR or emulated (docs/design.md) |
| 751 | cmd += ["--fma", os.environ["LEONIDA_FMA"]] | 785 | cmd += ["--fma", os.environ["LEONIDA_FMA"]] |
| 752 | rc, out = run_cmd(cmd, gpu=False) | 786 | rc, out = run_cmd(cmd, gpu=False) |
| 753 | print("=== rdna2spirv.py ===") | 787 | print("=== rdna2spirv.py ===") |
| @@ -834,7 +868,7 @@ def run_suite(a, work: str) -> int: | |||
| 834 | ok = None if isinstance(problem, Skip) else not problem | 868 | ok = None if isinstance(problem, Skip) else not problem |
| 835 | results.append((name, ok, problem or f"4096 pixels in each of {len(GET_LOD_TESTS[name])} draw(s): the " | 869 | results.append((name, ok, problem or f"4096 pixels in each of {len(GET_LOD_TESTS[name])} draw(s): the " |
| 836 | "clamped and the calculated LOD within 1/16")) | 870 | "clamped and the calculated LOD within 1/16")) |
| 837 | 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", | 871 | elif name in ("cs_bounds", "cs_smem_bounds", "cs_smem_stride_align", "cs_smem_sload_neg", "cs_smem_sconst_off", "cs_buf_tail", "cs_oob_select", "cs_oob_tail", |
| 838 | "cs_buf_swizzle", "cs_cmpx_class_f32", "cs_cvt_pk_u8", "cs_buf_load_sub", "cs_buf_fmt8"): | 872 | "cs_buf_swizzle", "cs_cmpx_class_f32", "cs_cvt_pk_u8", "cs_buf_load_sub", "cs_buf_fmt8"): |
| 839 | # num_records bounds check (cs_bounds.asm): the out-of-bounds store is dropped and the out-of-bounds | 873 | # num_records bounds check (cs_bounds.asm): the out-of-bounds store is dropped and the out-of-bounds |
| 840 | # load reads 0, so thread 0's four output words are fixed. One thread, no wave64 requirement. | 874 | # load reads 0, so thread 0's four output words are fixed. One thread, no wave64 requirement. |
| @@ -849,6 +883,8 @@ def run_suite(a, work: str) -> int: | |||
| 849 | # never run with a translator that zero-extends the s_load immediate (reads 4 GiB past the heap) | 883 | # never run with a translator that zero-extends the s_load immediate (reads 4 GiB past the heap) |
| 850 | "cs_smem_sload_neg": [0x5EED0004, 0x5EED0000, 0x5EED0004, 0x5EED0004, 0x5EED0008, 0x5EED000C, | 884 | "cs_smem_sload_neg": [0x5EED0004, 0x5EED0000, 0x5EED0004, 0x5EED0004, 0x5EED0008, 0x5EED000C, |
| 851 | 0xEEEEEEEE, 0xEEEEEEEE], | 885 | 0xEEEEEEEE, 0xEEEEEEEE], |
| 886 | # SHADER-328: a constant SGPR offset gives what the run-time one gives (no 32-bit wrap) | ||
| 887 | "cs_smem_sconst_off": [0, 0x5EED0018, 0x5EED0018, 0x5EED0014], | ||
| 852 | "cs_buf_tail": [0, 0x5EED000C, 0x5EED0008, 0x5EED000C, 0, 0, 0x5EED0010, 0], | 888 | "cs_buf_tail": [0, 0x5EED000C, 0x5EED0008, 0x5EED000C, 0, 0, 0x5EED0010, 0], |
| 853 | "cs_oob_select": [0x5EED000C, 0, 0x5EED0014, 0, 0x5EED0018, 0xEEEEEEEE, 0, 0], | 889 | "cs_oob_select": [0x5EED000C, 0, 0x5EED0014, 0, 0x5EED0018, 0xEEEEEEEE, 0, 0], |
| 854 | "cs_oob_tail": [0, 0, 0x5EED0010, 0, 0xBEEF0000, 0xEEEEEEEE, 0, 0x5EED0010], | 890 | "cs_oob_tail": [0, 0, 0x5EED0010, 0, 0xBEEF0000, 0xEEEEEEEE, 0, 0x5EED0010], |
| @@ -1099,22 +1135,22 @@ def run_suite(a, work: str) -> int: | |||
| 1099 | ok = None if isinstance(problem, Skip) else not problem | 1135 | ok = None if isinstance(problem, Skip) else not problem |
| 1100 | results.append((name, ok, problem or "4096 RGBA pixels matched")) | 1136 | results.append((name, ok, problem or "4096 RGBA pixels matched")) |
| 1101 | elif name in ("ps_texture_sample", "ps_cube_sample", "ps_texture_sample_d16", "ps_sample_c_lz", | 1137 | elif name in ("ps_texture_sample", "ps_cube_sample", "ps_texture_sample_d16", "ps_sample_c_lz", |
| 1102 | "ps_sample_c_lz_a16"): | 1138 | "ps_sample_c_lz_a16", "ps_sample_c", "ps_sample_c_b"): |
| 1103 | # Bindless texture tests: vk_texture_test finds vs_ids.spv and the shader in its working directory. | 1139 | # Bindless texture tests: vk_texture_test finds vs_ids.spv and the shader in its working directory. |
| 1104 | tool = os.path.join(a.build, "vk_texture_test" + ext) | 1140 | tool = os.path.join(a.build, "vk_texture_test" + ext) |
| 1105 | raw = os.path.join(raw_dir, f"{name}.raw") | 1141 | raw = os.path.join(raw_dir, f"{name}.raw") |
| 1106 | if name == "ps_texture_sample_d16": | 1142 | if name == "ps_texture_sample_d16": |
| 1107 | Path(raw).unlink(missing_ok=True) | ||
| 1108 | cmd = [tool, os.path.join(spirv_dir, "vs_ids.spv"), spv, raw, "0", "0", "0", "0", "0"] | 1143 | cmd = [tool, os.path.join(spirv_dir, "vs_ids.spv"), spv, raw, "0", "0", "0", "0", "0"] |
| 1109 | else: | 1144 | else: |
| 1110 | mode = {"ps_cube_sample": ["cube"], "ps_sample_c_lz": ["dref"], | 1145 | mode = {"ps_cube_sample": ["cube"], "ps_sample_c_lz": ["dref"], |
| 1111 | "ps_sample_c_lz_a16": ["dref_a16"]}.get(name, []) | 1146 | "ps_sample_c_lz_a16": ["dref_a16"], "ps_sample_c": ["dref_c"], |
| 1147 | "ps_sample_c_b": ["dref_c_b"]}.get(name, []) | ||
| 1112 | cmd = [tool, *mode, raw] | 1148 | cmd = [tool, *mode, raw] |
| 1113 | rc, msg = run_cmd(cmd, cwd=spirv_dir) | 1149 | rc, msg = run_readback(raw, run_cmd, cmd, cwd=spirv_dir) |
| 1114 | if rc == UNSUPPORTED: # e.g. fewer push constant bytes than the texture tests need | 1150 | if rc == UNSUPPORTED: # e.g. fewer push constant bytes than the texture tests need |
| 1115 | results.append((name, None, unsupported_skip(msg))) | 1151 | results.append((name, None, unsupported_skip(msg))) |
| 1116 | elif name == "ps_texture_sample_d16" and rc == 0: | 1152 | elif name == "ps_texture_sample_d16" and rc == 0: |
| 1117 | ok, detail = check_d16_texture(raw) if os.path.isfile(raw) else (False, "missing RGBA32F readback") | 1153 | ok, detail = check_d16_texture(raw) |
| 1118 | results.append((name, ok, detail)) | 1154 | results.append((name, ok, detail)) |
| 1119 | else: | 1155 | else: |
| 1120 | results.append((name, rc == 0 and "PASSED" in msg, msg.splitlines()[-1] if msg else "")) | 1156 | results.append((name, rc == 0 and "PASSED" in msg, msg.splitlines()[-1] if msg else "")) |
| @@ -1122,8 +1158,8 @@ def run_suite(a, work: str) -> int: | |||
| 1122 | expected = TEXTURE_CONSTANTS[name] | 1158 | expected = TEXTURE_CONSTANTS[name] |
| 1123 | tool = os.path.join(a.build, "vk_texture_test" + ext) | 1159 | tool = os.path.join(a.build, "vk_texture_test" + ext) |
| 1124 | raw = os.path.join(raw_dir, f"{name}.raw") | 1160 | raw = os.path.join(raw_dir, f"{name}.raw") |
| 1125 | rc, msg = run_cmd([tool, os.path.join(spirv_dir, "vs_ids.spv"), spv, raw, "0", "92", "c00000", | 1161 | rc, msg = run_readback(raw, run_cmd, [tool, os.path.join(spirv_dir, "vs_ids.spv"), spv, raw, "0", "92", |
| 1126 | "14500000", "0"], cwd=spirv_dir) | 1162 | "c00000", "14500000", "0"], cwd=spirv_dir) |
| 1127 | bad = 4096 | 1163 | bad = 4096 |
| 1128 | if rc == 0 and os.path.isfile(raw): | 1164 | if rc == 0 and os.path.isfile(raw): |
| 1129 | data = Path(raw).read_bytes() | 1165 | data = Path(raw).read_bytes() |
| @@ -1154,8 +1190,8 @@ def run_suite(a, work: str) -> int: | |||
| 1154 | # Texel offsets: needs vk_texture_test's texture, sampler and descriptor table (vk_harness binds none), | 1190 | # Texel offsets: needs vk_texture_test's texture, sampler and descriptor table (vk_harness binds none), |
| 1155 | # and VK_KHR_maintenance8 for the non-constant Offset; the tool exits 77 without it. | 1191 | # and VK_KHR_maintenance8 for the non-constant Offset; the tool exits 77 without it. |
| 1156 | raw = os.path.join(raw_dir, f"{name}.raw") | 1192 | raw = os.path.join(raw_dir, f"{name}.raw") |
| 1157 | rc, msg = run_cmd([os.path.join(a.build, "vk_texture_test" + ext), vs_tri, spv, raw, *TEXOFF_ARGS], | 1193 | rc, msg = run_readback(raw, run_cmd, [os.path.join(a.build, "vk_texture_test" + ext), vs_tri, spv, raw, |
| 1158 | env=texoff_env()) | 1194 | *TEXOFF_ARGS], env=texoff_env()) |
| 1159 | if rc == UNSUPPORTED: | 1195 | if rc == UNSUPPORTED: |
| 1160 | results.append((name, None, unsupported_skip(msg))) | 1196 | results.append((name, None, unsupported_skip(msg))) |
| 1161 | elif rc != 0: | 1197 | elif rc != 0: |
| @@ -1180,7 +1216,7 @@ def run_suite(a, work: str) -> int: | |||
| 1180 | bary_gs = os.path.join(spirv_dir, f"{name}.bary_gs.spv") | 1216 | bary_gs = os.path.join(spirv_dir, f"{name}.bary_gs.spv") |
| 1181 | if bary_fallback() and os.path.isfile(bary_gs): # --bary-fallback PS: barycentrics from this GS | 1217 | if bary_fallback() and os.path.isfile(bary_gs): # --bary-fallback PS: barycentrics from this GS |
| 1182 | env = dict(env or os.environ, VKH_GS=bary_gs, VKH_GS_HELPER="1") | 1218 | env = dict(env or os.environ, VKH_GS=bary_gs, VKH_GS_HELPER="1") |
| 1183 | rc, msg = run_cmd([vk_harness, vs, spv, raw], env=env) | 1219 | rc, msg = run_readback(raw, run_cmd, [vk_harness, vs, spv, raw], env=env) |
| 1184 | if rc == 77: # vk_harness: the device lacks a feature this shader needs (e.g. barycentrics) | 1220 | if rc == 77: # vk_harness: the device lacks a feature this shader needs (e.g. barycentrics) |
| 1185 | results.append((name, None, unsupported_skip(msg))) | 1221 | results.append((name, None, unsupported_skip(msg))) |
| 1186 | continue | 1222 | continue |
| @@ -1231,6 +1267,7 @@ def run_suite(a, work: str) -> int: | |||
| 1231 | "ps_fnan_fract": (0x3F7FFFFF, 0x00003BFF, 0xC0200000, 0xC0200000), | 1267 | "ps_fnan_fract": (0x3F7FFFFF, 0x00003BFF, 0xC0200000, 0xC0200000), |
| 1232 | # TEST-175: docs/design.md rules that were checked on the CPU only (derivations in the .asm headers) | 1268 | # TEST-175: docs/design.md rules that were checked on the CPU only (derivations in the .asm headers) |
| 1233 | "ps_cmp_nlg": (0x40000037, 0x40000007, 0x40000001, 0x3F800000), | 1269 | "ps_cmp_nlg": (0x40000037, 0x40000007, 0x40000001, 0x3F800000), |
| 1270 | "ps_far_branch": (0x00000007, 0x00000013, 0x00000051, 0x0000000B), # far branches (.asm header) | ||
| 1234 | "ps_vcmp_f16": (0x48A12080, 0x4CE9B1A2, 0x4BA72C98, 0x4FEFBDBA), # 16-bit float v_cmp e32 (.asm header) | 1271 | "ps_vcmp_f16": (0x48A12080, 0x4CE9B1A2, 0x4BA72C98, 0x4FEFBDBA), # 16-bit float v_cmp e32 (.asm header) |
| 1235 | "ps_vcmp_f16_e64": (0x44C11100, 0x4CF171C1, 0x47C71D18, 0x4FF77DD9), # same, e64 with swapped operands | 1272 | "ps_vcmp_f16_e64": (0x44C11100, 0x4CF171C1, 0x47C71D18, 0x4FF77DD9), # same, e64 with swapped operands |
| 1236 | "ps_vcmpx_f16": (0x68A12080, 0x6CE9B1A2, 0x6BA72C98, 0x6FEFBDBA), # 16-bit float v_cmpx e32 (.asm header) | 1273 | "ps_vcmpx_f16": (0x68A12080, 0x6CE9B1A2, 0x6BA72C98, 0x6FEFBDBA), # 16-bit float v_cmpx e32 (.asm header) |
| @@ -1278,9 +1315,8 @@ def run_suite(a, work: str) -> int: | |||
| 1278 | problem = ij_computed_problem(list(struct.iter_unpack("<4I", source.read()))) | 1315 | problem = ij_computed_problem(list(struct.iter_unpack("<4I", source.read()))) |
| 1279 | ok, detail = not problem, problem or "computed I/J pair words and v/2 within 1e-6" | 1316 | ok, detail = not problem, problem or "computed I/J pair words and v/2 within 1e-6" |
| 1280 | elif name == "ps_mandelbrot": | 1317 | elif name == "ps_mandelbrot": |
| 1281 | with open(raw, "rb") as source: | 1318 | px = read_raw_u32(raw) if os.path.isfile(raw) else [] |
| 1282 | px = list(struct.iter_unpack("<4I", source.read())) | 1319 | problem = frame_problem(px) or mandelbrot_problem(px) |
| 1283 | problem = mandelbrot_problem(px) | ||
| 1284 | ok, detail = not problem, problem or f"{len(px)}/{len(px)} iteration counts match the float32 model" | 1320 | ok, detail = not problem, problem or f"{len(px)}/{len(px)} iteration counts match the float32 model" |
| 1285 | else: | 1321 | else: |
| 1286 | ok, detail = False, "no checker defined" | 1322 | ok, detail = False, "no checker defined" |
| @@ -1288,7 +1324,7 @@ def run_suite(a, work: str) -> int: | |||
| 1288 | elif name == "gs_tri": | 1324 | elif name == "gs_tri": |
| 1289 | raw = os.path.join(raw_dir, f"{name}.raw") | 1325 | raw = os.path.join(raw_dir, f"{name}.raw") |
| 1290 | env = dict(gfx_env or os.environ, VKH_GS=spv) | 1326 | env = dict(gfx_env or os.environ, VKH_GS=spv) |
| 1291 | rc, msg = run_cmd([vk_harness, vs_tri, fs_loc1, raw], env=env) | 1327 | rc, msg = run_readback(raw, run_cmd, [vk_harness, vs_tri, fs_loc1, raw], env=env) |
| 1292 | if rc == UNSUPPORTED: | 1328 | if rc == UNSUPPORTED: |
| 1293 | results.append((name, None, unsupported_skip(msg))) | 1329 | results.append((name, None, unsupported_skip(msg))) |
| 1294 | elif rc != 0: | 1330 | elif rc != 0: |
| @@ -1307,7 +1343,7 @@ def run_suite(a, work: str) -> int: | |||
| 1307 | elif name in ("ms_tri", "ms_w64x_ballot", "ms_wave_info_s3"): | 1343 | elif name in ("ms_tri", "ms_w64x_ballot", "ms_wave_info_s3"): |
| 1308 | raw = os.path.join(raw_dir, f"{name}.raw") | 1344 | raw = os.path.join(raw_dir, f"{name}.raw") |
| 1309 | env = mesh_env(spirv_dir, name, gfx_env) | 1345 | env = mesh_env(spirv_dir, name, gfx_env) |
| 1310 | rc, msg = run_cmd([vk_harness, spv, fs_passthru, raw], env=env) | 1346 | rc, msg = run_readback(raw, run_cmd, [vk_harness, spv, fs_passthru, raw], env=env) |
| 1311 | # ms_w64x_ballot needs exact wave64 (a 64-wide subgroup, or --wave64-emulate): skip it elsewhere, as | 1347 | # ms_w64x_ballot needs exact wave64 (a 64-wide subgroup, or --wave64-emulate): skip it elsewhere, as |
| 1312 | # the wave64 compute dumps are. | 1348 | # the wave64 compute dumps are. |
| 1313 | no64 = (name == "ms_w64x_ballot" and not w64_emulated() and | 1349 | no64 = (name == "ms_w64x_ballot" and not w64_emulated() and |
| @@ -1328,7 +1364,7 @@ def run_suite(a, work: str) -> int: | |||
| 1328 | if bary_fallback() and not f16_interp_fallback(): | 1364 | if bary_fallback() and not f16_interp_fallback(): |
| 1329 | results.append((name, None, "SKIP (per-vertex f16 interpolants need barycentrics)")) | 1365 | results.append((name, None, "SKIP (per-vertex f16 interpolants need barycentrics)")) |
| 1330 | continue | 1366 | continue |
| 1331 | rc, msg = run_cmd([vk_harness, spv, fs, raw], env=env) | 1367 | rc, msg = run_readback(raw, run_cmd, [vk_harness, spv, fs, raw], env=env) |
| 1332 | if rc == UNSUPPORTED: | 1368 | if rc == UNSUPPORTED: |
| 1333 | results.append((name, None, unsupported_skip(msg))) | 1369 | results.append((name, None, unsupported_skip(msg))) |
| 1334 | elif rc != 0: | 1370 | elif rc != 0: |
| @@ -1340,7 +1376,7 @@ def run_suite(a, work: str) -> int: | |||
| 1340 | elif name == "ms_clip": | 1376 | elif name == "ms_clip": |
| 1341 | raw = os.path.join(raw_dir, f"{name}.raw") | 1377 | raw = os.path.join(raw_dir, f"{name}.raw") |
| 1342 | env = mesh_env(spirv_dir, name, gfx_env) | 1378 | env = mesh_env(spirv_dir, name, gfx_env) |
| 1343 | rc, msg = run_cmd([vk_harness, spv, fs_passthru, raw], env=env) | 1379 | rc, msg = run_readback(raw, run_cmd, [vk_harness, spv, fs_passthru, raw], env=env) |
| 1344 | if rc == UNSUPPORTED: | 1380 | if rc == UNSUPPORTED: |
| 1345 | results.append((name, None, unsupported_skip(msg))) | 1381 | results.append((name, None, unsupported_skip(msg))) |
| 1346 | elif rc != 0: | 1382 | elif rc != 0: |
| @@ -1353,7 +1389,7 @@ def run_suite(a, work: str) -> int: | |||
| 1353 | # ps_flat must still see vertex 0 of instance 0 (0x101), as check.py checks. | 1389 | # ps_flat must still see vertex 0 of instance 0 (0x101), as check.py checks. |
| 1354 | raw = os.path.join(raw_dir, f"{name}.raw") | 1390 | raw = os.path.join(raw_dir, f"{name}.raw") |
| 1355 | env = dict(gfx_env or os.environ, VKH_DRAW="16,7") | 1391 | env = dict(gfx_env or os.environ, VKH_DRAW="16,7") |
| 1356 | rc, msg = run_cmd([vk_harness, spv, os.path.join(spirv_dir, "ps_flat.spv"), raw], env=env) | 1392 | rc, msg = run_readback(raw, run_cmd, [vk_harness, spv, os.path.join(spirv_dir, "ps_flat.spv"), raw], env=env) |
| 1357 | if rc == UNSUPPORTED: | 1393 | if rc == UNSUPPORTED: |
| 1358 | results.append((name, None, unsupported_skip(msg))) | 1394 | results.append((name, None, unsupported_skip(msg))) |
| 1359 | elif rc != 0: | 1395 | elif rc != 0: |