upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorVonsek <45567075+Vonsek@users.noreply.github.com>2026-11-22 19:53:30 +0100
committerVonsek <45567075+Vonsek@users.noreply.github.com>2026-11-22 19:53:30 +0100
commit161fdf545a44ced100d37c44d81f2be6753e9bb1 (patch)
tree7878d6f0c4d5c72d122e0c2355e36fe4127ae375 /scripts
parent162821017ea3c286c8bec860f3ff94f037912061 (diff)
fix(test): verify the barycentric fixture gradient
Collapsed interpolation could satisfy the comparison between the raw and interpolated results. Use the known full-screen triangle gradient to verify their agreement is meaningful.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/run_gpu_tests.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index 3a23250fc..13cfbbad9 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -40,6 +40,7 @@ from check import MESH_COMPUTE, mesh_env # LEONIDA_MESH_COMPUTE=1: mesh shader
40from check import (WAVE32_LANE_DUMPS, WAVE32_LANE_ENV, bitmask_perm_narrow_skip, narrow_subgroup_skip, 40from check import (WAVE32_LANE_DUMPS, WAVE32_LANE_ENV, bitmask_perm_narrow_skip, narrow_subgroup_skip,
41 vcmpx_forms_narrow_skip, wave32_lane_skip) # as in check.py 41 vcmpx_forms_narrow_skip, wave32_lane_skip) # as in check.py
42from check import PIXEL_VERTEX, interp_f16_high_problem, ij_computed_problem, mandelbrot_problem # pixel producers and checks 42from check import PIXEL_VERTEX, interp_f16_high_problem, ij_computed_problem, mandelbrot_problem # pixel producers and checks
43from check import barycentric_problem
43from check import GET_LOD_TESTS, STORE_WORDS, get_lod_test, store_words_problem # TEST-184: image atomics and queries 44from check import GET_LOD_TESTS, STORE_WORDS, get_lod_test, store_words_problem # TEST-184: image atomics and queries
44from check import wide_pixel_skip # ps_w64x_readlane: judged only where the fragment stage was required 64-wide 45from check import wide_pixel_skip # ps_w64x_readlane: judged only where the fragment stage was required 64-wide
45 46
@@ -349,17 +350,8 @@ def frame_problem(px) -> str:
349 350
350 351
351def check_bary(raw_path: str) -> tuple[bool, str]: 352def check_bary(raw_path: str) -> tuple[bool, str]:
352 px = read_raw_rgba32f(raw_path) 353 problem = barycentric_problem(read_raw_rgba32f(raw_path), 1e-4)
353 if problem := frame_problem(px): 354 return not problem, problem or "4096/4096 pixels match"
354 return False, problem
355 bad = 0
356 first = ""
357 for i, (ax, ay, bi, bj) in enumerate(px):
358 if abs(ax * 0.5 - bi) > 1e-4 or abs(ay * 0.5 - bj) > 1e-4:
359 if not bad:
360 first = f"at ({i%64},{i//64}): attr/2=({ax*0.5:.5f},{ay*0.5:.5f}) raw=({bi:.5f},{bj:.5f})"
361 bad += 1
362 return (bad == 0), (first if bad else "4096/4096 pixels exact")
363 355
364 356
365def check_bitmask_perm(raw_path: str, msg: str = "") -> tuple[bool | None, str]: 357def check_bitmask_perm(raw_path: str, msg: str = "") -> tuple[bool | None, str]: