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:
authorVonsek <45567075+Vonsek@users.noreply.github.com>2026-11-22 17:04:37 +0100
committerVonsek <45567075+Vonsek@users.noreply.github.com>2026-11-22 17:04:37 +0100
commit21d01a9570ddd3ba45154b1c0b87fb15d012672b (patch)
tree2cd8643b48c9835b35ff61ffe1b7042b9fe3a968 /scripts/run_gpu_tests.py
parent4eb6155d3ac4f9d3fadb0d095c4ce13e76783615 (diff)
fix(tests): enforce the GPU timeout for texture cases
The texture harness needs a shader working directory, so two branches launched it directly and bypassed the configured deadline. Pass the working directory through the shared launcher so those cases time out and the suite can continue.
Diffstat (limited to 'scripts/run_gpu_tests.py')
-rw-r--r--scripts/run_gpu_tests.py21
1 files changed, 6 insertions, 15 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index 025504fb8..a7b097b1f 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -238,12 +238,13 @@ def unsupported_skip(msg: str) -> str:
238 return f"SKIP ({m.group(0) if m else 'unsupported device'})" 238 return f"SKIP ({m.group(0) if m else 'unsupported device'})"
239 239
240 240
241def run_cmd(cmd: list[str], env: dict | None = None, gpu: bool = True) -> tuple[int, str]: 241def run_cmd(cmd: list[str], env: dict | None = None, gpu: bool = True, *,
242 cwd: str | None = None) -> tuple[int, str]:
242 # A hung GPU test program fails its test instead of stalling the suite (check.py, LEONIDA_GPU_TEST_TIMEOUT). 243 # A hung GPU test program fails its test instead of stalling the suite (check.py, LEONIDA_GPU_TEST_TIMEOUT).
243 # gpu=False (the translator over the whole suite) runs without a limit. 244 # gpu=False (the translator over the whole suite) runs without a limit.
244 limit = gpu_test_timeout() if gpu else None 245 limit = gpu_test_timeout() if gpu else None
245 try: 246 try:
246 p = subprocess.run(cmd, capture_output=True, text=True, env=env, timeout=limit) 247 p = subprocess.run(cmd, capture_output=True, text=True, env=env, timeout=limit, cwd=cwd)
247 except subprocess.TimeoutExpired: 248 except subprocess.TimeoutExpired:
248 return 1, timed_out(cmd[0], limit) 249 return 1, timed_out(cmd[0], limit)
249 except OSError as e: # e.g. Smart App Control blocked a fresh build: fail this test, keep running the others 250 except OSError as e: # e.g. Smart App Control blocked a fresh build: fail this test, keep running the others
@@ -1020,13 +1021,7 @@ def run_suite(a, work: str) -> int:
1020 mode = {"ps_cube_sample": ["cube"], "ps_sample_c_lz": ["dref"], 1021 mode = {"ps_cube_sample": ["cube"], "ps_sample_c_lz": ["dref"],
1021 "ps_sample_c_lz_a16": ["dref_a16"]}.get(name, []) 1022 "ps_sample_c_lz_a16": ["dref_a16"]}.get(name, [])
1022 cmd = [tool, *mode, raw] 1023 cmd = [tool, *mode, raw]
1023 try: 1024 rc, msg = run_cmd(cmd, cwd=spirv_dir)
1024 p = subprocess.run(cmd, capture_output=True, text=True, cwd=spirv_dir)
1025 rc, msg = p.returncode, (p.stdout + "\n" + p.stderr).strip()
1026 except FileNotFoundError:
1027 rc, msg = 1, f"missing {tool}"
1028 except OSError as e:
1029 rc, msg = 1, start_failure(tool, e)
1030 if rc == UNSUPPORTED: # e.g. fewer push constant bytes than the texture tests need 1025 if rc == UNSUPPORTED: # e.g. fewer push constant bytes than the texture tests need
1031 results.append((name, None, unsupported_skip(msg))) 1026 results.append((name, None, unsupported_skip(msg)))
1032 elif name == "ps_texture_sample_d16" and rc == 0: 1027 elif name == "ps_texture_sample_d16" and rc == 0:
@@ -1038,12 +1033,8 @@ def run_suite(a, work: str) -> int:
1038 expected = TEXTURE_CONSTANTS[name] 1033 expected = TEXTURE_CONSTANTS[name]
1039 tool = os.path.join(a.build, "vk_texture_test" + ext) 1034 tool = os.path.join(a.build, "vk_texture_test" + ext)
1040 raw = os.path.join(raw_dir, f"{name}.raw") 1035 raw = os.path.join(raw_dir, f"{name}.raw")
1041 try: 1036 rc, msg = run_cmd([tool, os.path.join(spirv_dir, "vs_ids.spv"), spv, raw, "0", "92", "c00000",
1042 p = subprocess.run([tool, os.path.join(spirv_dir, "vs_ids.spv"), spv, raw, "0", "92", "c00000", 1037 "14500000", "0"], cwd=spirv_dir)
1043 "14500000", "0"], capture_output=True, text=True, cwd=spirv_dir)
1044 rc, msg = p.returncode, (p.stdout + "\n" + p.stderr).strip()
1045 except FileNotFoundError:
1046 rc, msg = 1, f"missing {tool}"
1047 bad = 4096 1038 bad = 4096
1048 if rc == 0 and os.path.isfile(raw): 1039 if rc == 0 and os.path.isfile(raw):
1049 data = Path(raw).read_bytes() 1040 data = Path(raw).read_bytes()