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 d7d3c2471..90123efc2 100644 --- a/scripts/run_gpu_tests.py +++ b/scripts/run_gpu_tests.py | |||
| @@ -39,6 +39,7 @@ from check import TEXOFF_ARGS, texoff_problem # ps_texoff's expected words and | |||
| 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 failure # "exit <status>: <last lines>", check.py's detail for a program that exited non-zero | 41 | from check import failure # "exit <status>: <last lines>", check.py's detail for a program that exited non-zero |
| 42 | from check import run_readback | ||
| 42 | from check import MESH_COMPUTE, mesh_env # LEONIDA_MESH_COMPUTE=1: mesh shaders as compute + a generated VS | 43 | from check import MESH_COMPUTE, mesh_env # LEONIDA_MESH_COMPUTE=1: mesh shaders as compute + a generated VS |
| 43 | from check import (WAVE32_LANE_DUMPS, WAVE32_LANE_ENV, bitmask_perm_narrow_skip, narrow_subgroup_skip, | 44 | from check import (WAVE32_LANE_DUMPS, WAVE32_LANE_ENV, bitmask_perm_narrow_skip, narrow_subgroup_skip, |
| 44 | unpinned_subgroup_skip, vcmpx_forms_narrow_skip, wave32_lane_skip) # as in check.py | 45 | unpinned_subgroup_skip, vcmpx_forms_narrow_skip, wave32_lane_skip) # as in check.py |
| @@ -575,7 +576,7 @@ def check_clip_half(raw_path: str, want_b: float, want_a: float) -> tuple[bool, | |||
| 575 | # checker runs them: the test program that owns them judges them. | 576 | # checker runs them: the test program that owns them judges them. |
| 576 | OTHER_HARNESS = {"ps_m15": "d3d12_translated_draw_test", "vs_m15": "d3d12_translated_draw_test", | 577 | OTHER_HARNESS = {"ps_m15": "d3d12_translated_draw_test", "vs_m15": "d3d12_translated_draw_test", |
| 577 | "ps_m2": "d3d12_m2_textured_test", "vs_m2": "d3d12_m2_textured_test", "ps_m2_uoff": "d3d12_m2_textured_test", | 578 | "ps_m2": "d3d12_m2_textured_test", "vs_m2": "d3d12_m2_textured_test", "ps_m2_uoff": "d3d12_m2_textured_test", |
| 578 | "ps_m2_array": "d3d12_m2_formats_test", | 579 | "ps_m2_literal": "d3d12_m2_textured_test", "ps_m2_array": "d3d12_m2_formats_test", |
| 579 | "ps_m3": "d3d12_m3_frame_test", "vs_m3": "d3d12_m3_frame_test", | 580 | "ps_m3": "d3d12_m3_frame_test", "vs_m3": "d3d12_m3_frame_test", |
| 580 | "ps_m3_post": "d3d12_m3_frame_test", "ps_m3_query": "d3d12_m3_frame_test", | 581 | "ps_m3_post": "d3d12_m3_frame_test", "ps_m3_query": "d3d12_m3_frame_test", |
| 581 | "cs_m4_fill": "d3d12_m4_compute_test", "cs_m4_indirect": "d3d12_m4_compute_test", | 582 | "cs_m4_fill": "d3d12_m4_compute_test", "cs_m4_indirect": "d3d12_m4_compute_test", |
| @@ -585,6 +586,7 @@ OTHER_HARNESS = {"ps_m15": "d3d12_translated_draw_test", "vs_m15": "d3d12_transl | |||
| 585 | # Shaders a selected test draws with, built even when the filter leaves them out (#192). | 586 | # Shaders a selected test draws with, built even when the filter leaves them out (#192). |
| 586 | 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", | 587 | 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", |
| 587 | "ps_texture_sample_d16": "vs_ids.asm", "ps_sample_c_lz": "vs_ids.asm", "ps_sample_c_lz_a16": "vs_ids.asm", | 588 | "ps_texture_sample_d16": "vs_ids.asm", "ps_sample_c_lz": "vs_ids.asm", "ps_sample_c_lz_a16": "vs_ids.asm", |
| 589 | "ps_sample_c": "vs_ids.asm", "ps_sample_c_b": "vs_ids.asm", | ||
| 588 | **{name: "vs_ids.asm" for name in TEXTURE_CONSTANTS}, "ps_ssharp": "vs_ids.asm", "ps_imgatomic": "vs_ids.asm", | 590 | **{name: "vs_ids.asm" for name in TEXTURE_CONSTANTS}, "ps_ssharp": "vs_ids.asm", "ps_imgatomic": "vs_ids.asm", |
| 589 | **{name: "vs_ids.asm" for name in GRADIENT_TESTS}, "vs_clip": "ps_clip_color.asm", | 591 | **{name: "vs_ids.asm" for name in GRADIENT_TESTS}, "vs_clip": "ps_clip_color.asm", |
| 590 | "ps_interp_f16_high": "vs_f16_pack.asm", "ms_f16_pack": "ps_interp_f16_high.asm", | 592 | "ps_interp_f16_high": "vs_f16_pack.asm", "ms_f16_pack": "ps_interp_f16_high.asm", |
| @@ -625,6 +627,31 @@ def find_test_programs(build: str, ext: str) -> str | None: | |||
| 625 | return None | 627 | return None |
| 626 | 628 | ||
| 627 | 629 | ||
| 630 | def native_folder(path: str, ansi: str = "mbcs") -> str | None: | ||
| 631 | """`path` spelled so that the native programs this runner starts can open files under it, or None. | ||
| 632 | |||
| 633 | On Windows the test programs and the Vulkan SDK tools (spirv-val, spirv-as) read their command line in the ANSI | ||
| 634 | code page, so a character outside it, as in a Cyrillic or CJK user name under %TEMP%, reaches them as '?'. Such a | ||
| 635 | folder is replaced by its 8.3 short name, which is plain ASCII, when the volume keeps one. Elsewhere, and for a | ||
| 636 | path the code page holds, `path` comes back as it is. `ansi` is the codec of that code page (a parameter so a | ||
| 637 | test can pick a narrow one). | ||
| 638 | """ | ||
| 639 | def fits(p: str) -> bool: | ||
| 640 | try: | ||
| 641 | p.encode(ansi) | ||
| 642 | return True | ||
| 643 | except UnicodeEncodeError: | ||
| 644 | return False | ||
| 645 | |||
| 646 | if os.name != "nt" or fits(path): | ||
| 647 | return path | ||
| 648 | import ctypes | ||
| 649 | buf = ctypes.create_unicode_buffer(32768) | ||
| 650 | n = ctypes.windll.kernel32.GetShortPathNameW(path, buf, len(buf)) | ||
| 651 | short = buf.value if 0 < n < len(buf) else "" | ||
| 652 | return short if short and fits(short) else None | ||
| 653 | |||
| 654 | |||
| 628 | def main() -> int: | 655 | def main() -> int: |
| 629 | ap = argparse.ArgumentParser() | 656 | ap = argparse.ArgumentParser() |
| 630 | ap.add_argument("--llvm-mc", default=os.environ.get("LLVM_MC", "llvm-mc"), | 657 | ap.add_argument("--llvm-mc", default=os.environ.get("LLVM_MC", "llvm-mc"), |
| @@ -668,7 +695,14 @@ def main() -> int: | |||
| 668 | 695 | ||
| 669 | work = a.work or tempfile.mkdtemp(prefix="leonida_gpu_tests_") | 696 | work = a.work or tempfile.mkdtemp(prefix="leonida_gpu_tests_") |
| 670 | try: | 697 | try: |
| 671 | return run_suite(a, work) | 698 | os.makedirs(work, exist_ok=True) |
| 699 | native = native_folder(work) | ||
| 700 | if native is None: | ||
| 701 | print(f"error: the work folder {ascii(work)} has characters outside this PC's ANSI code page and no 8.3 " | ||
| 702 | "short name, so the test programs and the Vulkan SDK tools can't open files in it. Pass --work " | ||
| 703 | "with a folder whose path they can, such as C:\\leonida_gpu_work.", file=sys.stderr) | ||
| 704 | return 2 | ||
| 705 | return run_suite(a, native) | ||
| 672 | finally: | 706 | finally: |
| 673 | if a.work is None: | 707 | if a.work is None: |
| 674 | shutil.rmtree(work, ignore_errors=True) | 708 | shutil.rmtree(work, ignore_errors=True) |
| @@ -756,7 +790,7 @@ def run_suite(a, work: str) -> int: | |||
| 756 | cmd.append("--mesh-compute") | 790 | cmd.append("--mesh-compute") |
| 757 | if pc_tail_ubo(): # 128 push-constant bytes; heap base and code base from a uniform block at set 1 | 791 | if pc_tail_ubo(): # 128 push-constant bytes; heap base and code base from a uniform block at set 1 |
| 758 | cmd.append("--pc-tail-ubo") | 792 | cmd.append("--pc-tail-ubo") |
| 759 | if os.environ.get("LEONIDA_FMA") in ("glsl", "khr"): # fused multiply-add: GLSL Fma or OpFmaKHR (docs/design.md) | 793 | if os.environ.get("LEONIDA_FMA") in ("glsl", "khr", "exact"): # GLSL Fma, OpFmaKHR or emulated (docs/design.md) |
| 760 | cmd += ["--fma", os.environ["LEONIDA_FMA"]] | 794 | cmd += ["--fma", os.environ["LEONIDA_FMA"]] |
| 761 | rc, out = run_cmd(cmd, gpu=False) | 795 | rc, out = run_cmd(cmd, gpu=False) |
| 762 | print("=== rdna2spirv.py ===") | 796 | print("=== rdna2spirv.py ===") |
| @@ -843,7 +877,7 @@ def run_suite(a, work: str) -> int: | |||
| 843 | ok = None if isinstance(problem, Skip) else not problem | 877 | ok = None if isinstance(problem, Skip) else not problem |
| 844 | results.append((name, ok, problem or f"4096 pixels in each of {len(GET_LOD_TESTS[name])} draw(s): the " | 878 | results.append((name, ok, problem or f"4096 pixels in each of {len(GET_LOD_TESTS[name])} draw(s): the " |
| 845 | "clamped and the calculated LOD within 1/16")) | 879 | "clamped and the calculated LOD within 1/16")) |
| 846 | 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", | 880 | 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", |
| 847 | "cs_buf_swizzle", "cs_cmpx_class_f32", "cs_cvt_pk_u8", "cs_buf_load_sub", "cs_buf_fmt8"): | 881 | "cs_buf_swizzle", "cs_cmpx_class_f32", "cs_cvt_pk_u8", "cs_buf_load_sub", "cs_buf_fmt8"): |
| 848 | # num_records bounds check (cs_bounds.asm): the out-of-bounds store is dropped and the out-of-bounds | 882 | # num_records bounds check (cs_bounds.asm): the out-of-bounds store is dropped and the out-of-bounds |
| 849 | # load reads 0, so thread 0's four output words are fixed. One thread, no wave64 requirement. | 883 | # load reads 0, so thread 0's four output words are fixed. One thread, no wave64 requirement. |
| @@ -858,6 +892,8 @@ def run_suite(a, work: str) -> int: | |||
| 858 | # never run with a translator that zero-extends the s_load immediate (reads 4 GiB past the heap) | 892 | # never run with a translator that zero-extends the s_load immediate (reads 4 GiB past the heap) |
| 859 | "cs_smem_sload_neg": [0x5EED0004, 0x5EED0000, 0x5EED0004, 0x5EED0004, 0x5EED0008, 0x5EED000C, | 893 | "cs_smem_sload_neg": [0x5EED0004, 0x5EED0000, 0x5EED0004, 0x5EED0004, 0x5EED0008, 0x5EED000C, |
| 860 | 0xEEEEEEEE, 0xEEEEEEEE], | 894 | 0xEEEEEEEE, 0xEEEEEEEE], |
| 895 | # SHADER-328: a constant SGPR offset gives what the run-time one gives (no 32-bit wrap) | ||
| 896 | "cs_smem_sconst_off": [0, 0x5EED0018, 0x5EED0018, 0x5EED0014], | ||
| 861 | "cs_buf_tail": [0, 0x5EED000C, 0x5EED0008, 0x5EED000C, 0, 0, 0x5EED0010, 0], | 897 | "cs_buf_tail": [0, 0x5EED000C, 0x5EED0008, 0x5EED000C, 0, 0, 0x5EED0010, 0], |
| 862 | "cs_oob_select": [0x5EED000C, 0, 0x5EED0014, 0, 0x5EED0018, 0xEEEEEEEE, 0, 0], | 898 | "cs_oob_select": [0x5EED000C, 0, 0x5EED0014, 0, 0x5EED0018, 0xEEEEEEEE, 0, 0], |
| 863 | "cs_oob_tail": [0, 0, 0x5EED0010, 0, 0xBEEF0000, 0xEEEEEEEE, 0, 0x5EED0010], | 899 | "cs_oob_tail": [0, 0, 0x5EED0010, 0, 0xBEEF0000, 0xEEEEEEEE, 0, 0x5EED0010], |
| @@ -1108,22 +1144,22 @@ def run_suite(a, work: str) -> int: | |||
| 1108 | ok = None if isinstance(problem, Skip) else not problem | 1144 | ok = None if isinstance(problem, Skip) else not problem |
| 1109 | results.append((name, ok, problem or "4096 RGBA pixels matched")) | 1145 | results.append((name, ok, problem or "4096 RGBA pixels matched")) |
| 1110 | elif name in ("ps_texture_sample", "ps_cube_sample", "ps_texture_sample_d16", "ps_sample_c_lz", | 1146 | elif name in ("ps_texture_sample", "ps_cube_sample", "ps_texture_sample_d16", "ps_sample_c_lz", |
| 1111 | "ps_sample_c_lz_a16"): | 1147 | "ps_sample_c_lz_a16", "ps_sample_c", "ps_sample_c_b"): |
| 1112 | # Bindless texture tests: vk_texture_test finds vs_ids.spv and the shader in its working directory. | 1148 | # Bindless texture tests: vk_texture_test finds vs_ids.spv and the shader in its working directory. |
| 1113 | tool = os.path.join(a.build, "vk_texture_test" + ext) | 1149 | tool = os.path.join(a.build, "vk_texture_test" + ext) |
| 1114 | raw = os.path.join(raw_dir, f"{name}.raw") | 1150 | raw = os.path.join(raw_dir, f"{name}.raw") |
| 1115 | if name == "ps_texture_sample_d16": | 1151 | if name == "ps_texture_sample_d16": |
| 1116 | Path(raw).unlink(missing_ok=True) | ||
| 1117 | cmd = [tool, os.path.join(spirv_dir, "vs_ids.spv"), spv, raw, "0", "0", "0", "0", "0"] | 1152 | cmd = [tool, os.path.join(spirv_dir, "vs_ids.spv"), spv, raw, "0", "0", "0", "0", "0"] |
| 1118 | else: | 1153 | else: |
| 1119 | mode = {"ps_cube_sample": ["cube"], "ps_sample_c_lz": ["dref"], | 1154 | mode = {"ps_cube_sample": ["cube"], "ps_sample_c_lz": ["dref"], |
| 1120 | "ps_sample_c_lz_a16": ["dref_a16"]}.get(name, []) | 1155 | "ps_sample_c_lz_a16": ["dref_a16"], "ps_sample_c": ["dref_c"], |
| 1156 | "ps_sample_c_b": ["dref_c_b"]}.get(name, []) | ||
| 1121 | cmd = [tool, *mode, raw] | 1157 | cmd = [tool, *mode, raw] |
| 1122 | rc, msg = run_cmd(cmd, cwd=spirv_dir) | 1158 | rc, msg = run_readback(raw, run_cmd, cmd, cwd=spirv_dir) |
| 1123 | if rc == UNSUPPORTED: # e.g. fewer push constant bytes than the texture tests need | 1159 | if rc == UNSUPPORTED: # e.g. fewer push constant bytes than the texture tests need |
| 1124 | results.append((name, None, unsupported_skip(msg))) | 1160 | results.append((name, None, unsupported_skip(msg))) |
| 1125 | elif name == "ps_texture_sample_d16" and rc == 0: | 1161 | elif name == "ps_texture_sample_d16" and rc == 0: |
| 1126 | ok, detail = check_d16_texture(raw) if os.path.isfile(raw) else (False, "missing RGBA32F readback") | 1162 | ok, detail = check_d16_texture(raw) |
| 1127 | results.append((name, ok, detail)) | 1163 | results.append((name, ok, detail)) |
| 1128 | else: | 1164 | else: |
| 1129 | results.append((name, rc == 0 and "PASSED" in msg, verdict_line(rc, msg))) | 1165 | results.append((name, rc == 0 and "PASSED" in msg, verdict_line(rc, msg))) |
| @@ -1131,8 +1167,8 @@ def run_suite(a, work: str) -> int: | |||
| 1131 | expected = TEXTURE_CONSTANTS[name] | 1167 | expected = TEXTURE_CONSTANTS[name] |
| 1132 | tool = os.path.join(a.build, "vk_texture_test" + ext) | 1168 | tool = os.path.join(a.build, "vk_texture_test" + ext) |
| 1133 | raw = os.path.join(raw_dir, f"{name}.raw") | 1169 | raw = os.path.join(raw_dir, f"{name}.raw") |
| 1134 | rc, msg = run_cmd([tool, os.path.join(spirv_dir, "vs_ids.spv"), spv, raw, "0", "92", "c00000", | 1170 | rc, msg = run_readback(raw, run_cmd, [tool, os.path.join(spirv_dir, "vs_ids.spv"), spv, raw, "0", "92", |
| 1135 | "14500000", "0"], cwd=spirv_dir) | 1171 | "c00000", "14500000", "0"], cwd=spirv_dir) |
| 1136 | bad = 4096 | 1172 | bad = 4096 |
| 1137 | if rc == 0 and os.path.isfile(raw): | 1173 | if rc == 0 and os.path.isfile(raw): |
| 1138 | data = Path(raw).read_bytes() | 1174 | data = Path(raw).read_bytes() |
| @@ -1165,8 +1201,8 @@ def run_suite(a, work: str) -> int: | |||
| 1165 | # Texel offsets: needs vk_texture_test's texture, sampler and descriptor table (vk_harness binds none), | 1201 | # Texel offsets: needs vk_texture_test's texture, sampler and descriptor table (vk_harness binds none), |
| 1166 | # and VK_KHR_maintenance8 for the non-constant Offset; the tool exits 77 without it. | 1202 | # and VK_KHR_maintenance8 for the non-constant Offset; the tool exits 77 without it. |
| 1167 | raw = os.path.join(raw_dir, f"{name}.raw") | 1203 | raw = os.path.join(raw_dir, f"{name}.raw") |
| 1168 | rc, msg = run_cmd([os.path.join(a.build, "vk_texture_test" + ext), vs_tri, spv, raw, *TEXOFF_ARGS], | 1204 | rc, msg = run_readback(raw, run_cmd, [os.path.join(a.build, "vk_texture_test" + ext), vs_tri, spv, raw, |
| 1169 | env=texoff_env()) | 1205 | *TEXOFF_ARGS], env=texoff_env()) |
| 1170 | if rc == UNSUPPORTED: | 1206 | if rc == UNSUPPORTED: |
| 1171 | results.append((name, None, unsupported_skip(msg))) | 1207 | results.append((name, None, unsupported_skip(msg))) |
| 1172 | elif rc != 0: | 1208 | elif rc != 0: |
| @@ -1191,7 +1227,7 @@ def run_suite(a, work: str) -> int: | |||
| 1191 | bary_gs = os.path.join(spirv_dir, f"{name}.bary_gs.spv") | 1227 | bary_gs = os.path.join(spirv_dir, f"{name}.bary_gs.spv") |
| 1192 | if bary_fallback() and os.path.isfile(bary_gs): # --bary-fallback PS: barycentrics from this GS | 1228 | if bary_fallback() and os.path.isfile(bary_gs): # --bary-fallback PS: barycentrics from this GS |
| 1193 | env = dict(env or os.environ, VKH_GS=bary_gs, VKH_GS_HELPER="1") | 1229 | env = dict(env or os.environ, VKH_GS=bary_gs, VKH_GS_HELPER="1") |
| 1194 | rc, msg = run_cmd([vk_harness, vs, spv, raw], env=env) | 1230 | rc, msg = run_readback(raw, run_cmd, [vk_harness, vs, spv, raw], env=env) |
| 1195 | if rc == 77: # vk_harness: the device lacks a feature this shader needs (e.g. barycentrics) | 1231 | if rc == 77: # vk_harness: the device lacks a feature this shader needs (e.g. barycentrics) |
| 1196 | results.append((name, None, unsupported_skip(msg))) | 1232 | results.append((name, None, unsupported_skip(msg))) |
| 1197 | continue | 1233 | continue |
| @@ -1242,6 +1278,7 @@ def run_suite(a, work: str) -> int: | |||
| 1242 | "ps_fnan_fract": (0x3F7FFFFF, 0x00003BFF, 0xC0200000, 0xC0200000), | 1278 | "ps_fnan_fract": (0x3F7FFFFF, 0x00003BFF, 0xC0200000, 0xC0200000), |
| 1243 | # TEST-175: docs/design.md rules that were checked on the CPU only (derivations in the .asm headers) | 1279 | # TEST-175: docs/design.md rules that were checked on the CPU only (derivations in the .asm headers) |
| 1244 | "ps_cmp_nlg": (0x40000037, 0x40000007, 0x40000001, 0x3F800000), | 1280 | "ps_cmp_nlg": (0x40000037, 0x40000007, 0x40000001, 0x3F800000), |
| 1281 | "ps_far_branch": (0x00000007, 0x00000013, 0x00000051, 0x0000000B), # far branches (.asm header) | ||
| 1245 | "ps_vcmp_f16": (0x48A12080, 0x4CE9B1A2, 0x4BA72C98, 0x4FEFBDBA), # 16-bit float v_cmp e32 (.asm header) | 1282 | "ps_vcmp_f16": (0x48A12080, 0x4CE9B1A2, 0x4BA72C98, 0x4FEFBDBA), # 16-bit float v_cmp e32 (.asm header) |
| 1246 | "ps_vcmp_f16_e64": (0x44C11100, 0x4CF171C1, 0x47C71D18, 0x4FF77DD9), # same, e64 with swapped operands | 1283 | "ps_vcmp_f16_e64": (0x44C11100, 0x4CF171C1, 0x47C71D18, 0x4FF77DD9), # same, e64 with swapped operands |
| 1247 | "ps_vcmpx_f16": (0x68A12080, 0x6CE9B1A2, 0x6BA72C98, 0x6FEFBDBA), # 16-bit float v_cmpx e32 (.asm header) | 1284 | "ps_vcmpx_f16": (0x68A12080, 0x6CE9B1A2, 0x6BA72C98, 0x6FEFBDBA), # 16-bit float v_cmpx e32 (.asm header) |
| @@ -1289,9 +1326,8 @@ def run_suite(a, work: str) -> int: | |||
| 1289 | problem = ij_computed_problem(list(struct.iter_unpack("<4I", source.read()))) | 1326 | problem = ij_computed_problem(list(struct.iter_unpack("<4I", source.read()))) |
| 1290 | ok, detail = not problem, problem or "computed I/J pair words and v/2 within 1e-6" | 1327 | ok, detail = not problem, problem or "computed I/J pair words and v/2 within 1e-6" |
| 1291 | elif name == "ps_mandelbrot": | 1328 | elif name == "ps_mandelbrot": |
| 1292 | with open(raw, "rb") as source: | 1329 | px = read_raw_u32(raw) if os.path.isfile(raw) else [] |
| 1293 | px = list(struct.iter_unpack("<4I", source.read())) | 1330 | problem = frame_problem(px) or mandelbrot_problem(px) |
| 1294 | problem = mandelbrot_problem(px) | ||
| 1295 | ok, detail = not problem, problem or f"{len(px)}/{len(px)} iteration counts match the float32 model" | 1331 | ok, detail = not problem, problem or f"{len(px)}/{len(px)} iteration counts match the float32 model" |
| 1296 | else: | 1332 | else: |
| 1297 | ok, detail = False, "no checker defined" | 1333 | ok, detail = False, "no checker defined" |
| @@ -1299,7 +1335,7 @@ def run_suite(a, work: str) -> int: | |||
| 1299 | elif name == "gs_tri": | 1335 | elif name == "gs_tri": |
| 1300 | raw = os.path.join(raw_dir, f"{name}.raw") | 1336 | raw = os.path.join(raw_dir, f"{name}.raw") |
| 1301 | env = dict(gfx_env or os.environ, VKH_GS=spv) | 1337 | env = dict(gfx_env or os.environ, VKH_GS=spv) |
| 1302 | rc, msg = run_cmd([vk_harness, vs_tri, fs_loc1, raw], env=env) | 1338 | rc, msg = run_readback(raw, run_cmd, [vk_harness, vs_tri, fs_loc1, raw], env=env) |
| 1303 | if rc == UNSUPPORTED: | 1339 | if rc == UNSUPPORTED: |
| 1304 | results.append((name, None, unsupported_skip(msg))) | 1340 | results.append((name, None, unsupported_skip(msg))) |
| 1305 | elif rc != 0: | 1341 | elif rc != 0: |
| @@ -1318,7 +1354,7 @@ def run_suite(a, work: str) -> int: | |||
| 1318 | elif name in ("ms_tri", "ms_w64x_ballot", "ms_wave_info_s3"): | 1354 | elif name in ("ms_tri", "ms_w64x_ballot", "ms_wave_info_s3"): |
| 1319 | raw = os.path.join(raw_dir, f"{name}.raw") | 1355 | raw = os.path.join(raw_dir, f"{name}.raw") |
| 1320 | env = mesh_env(spirv_dir, name, gfx_env) | 1356 | env = mesh_env(spirv_dir, name, gfx_env) |
| 1321 | rc, msg = run_cmd([vk_harness, spv, fs_passthru, raw], env=env) | 1357 | rc, msg = run_readback(raw, run_cmd, [vk_harness, spv, fs_passthru, raw], env=env) |
| 1322 | # ms_w64x_ballot needs exact wave64 (a 64-wide subgroup, or --wave64-emulate): skip it elsewhere, as | 1358 | # ms_w64x_ballot needs exact wave64 (a 64-wide subgroup, or --wave64-emulate): skip it elsewhere, as |
| 1323 | # the wave64 compute dumps are. | 1359 | # the wave64 compute dumps are. |
| 1324 | no64 = (name == "ms_w64x_ballot" and not w64_emulated() and | 1360 | no64 = (name == "ms_w64x_ballot" and not w64_emulated() and |
| @@ -1339,7 +1375,7 @@ def run_suite(a, work: str) -> int: | |||
| 1339 | if bary_fallback() and not f16_interp_fallback(): | 1375 | if bary_fallback() and not f16_interp_fallback(): |
| 1340 | results.append((name, None, "SKIP (per-vertex f16 interpolants need barycentrics)")) | 1376 | results.append((name, None, "SKIP (per-vertex f16 interpolants need barycentrics)")) |
| 1341 | continue | 1377 | continue |
| 1342 | rc, msg = run_cmd([vk_harness, spv, fs, raw], env=env) | 1378 | rc, msg = run_readback(raw, run_cmd, [vk_harness, spv, fs, raw], env=env) |
| 1343 | if rc == UNSUPPORTED: | 1379 | if rc == UNSUPPORTED: |
| 1344 | results.append((name, None, unsupported_skip(msg))) | 1380 | results.append((name, None, unsupported_skip(msg))) |
| 1345 | elif rc != 0: | 1381 | elif rc != 0: |
| @@ -1351,7 +1387,7 @@ def run_suite(a, work: str) -> int: | |||
| 1351 | elif name == "ms_clip": | 1387 | elif name == "ms_clip": |
| 1352 | raw = os.path.join(raw_dir, f"{name}.raw") | 1388 | raw = os.path.join(raw_dir, f"{name}.raw") |
| 1353 | env = mesh_env(spirv_dir, name, gfx_env) | 1389 | env = mesh_env(spirv_dir, name, gfx_env) |
| 1354 | rc, msg = run_cmd([vk_harness, spv, fs_passthru, raw], env=env) | 1390 | rc, msg = run_readback(raw, run_cmd, [vk_harness, spv, fs_passthru, raw], env=env) |
| 1355 | if rc == UNSUPPORTED: | 1391 | if rc == UNSUPPORTED: |
| 1356 | results.append((name, None, unsupported_skip(msg))) | 1392 | results.append((name, None, unsupported_skip(msg))) |
| 1357 | elif rc != 0: | 1393 | elif rc != 0: |
| @@ -1364,7 +1400,7 @@ def run_suite(a, work: str) -> int: | |||
| 1364 | # ps_flat must still see vertex 0 of instance 0 (0x101), as check.py checks. | 1400 | # ps_flat must still see vertex 0 of instance 0 (0x101), as check.py checks. |
| 1365 | raw = os.path.join(raw_dir, f"{name}.raw") | 1401 | raw = os.path.join(raw_dir, f"{name}.raw") |
| 1366 | env = dict(gfx_env or os.environ, VKH_DRAW="16,7") | 1402 | env = dict(gfx_env or os.environ, VKH_DRAW="16,7") |
| 1367 | rc, msg = run_cmd([vk_harness, spv, os.path.join(spirv_dir, "ps_flat.spv"), raw], env=env) | 1403 | rc, msg = run_readback(raw, run_cmd, [vk_harness, spv, os.path.join(spirv_dir, "ps_flat.spv"), raw], env=env) |
| 1368 | if rc == UNSUPPORTED: | 1404 | if rc == UNSUPPORTED: |
| 1369 | results.append((name, None, unsupported_skip(msg))) | 1405 | results.append((name, None, unsupported_skip(msg))) |
| 1370 | elif rc != 0: | 1406 | elif rc != 0: |