upleb.uk

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

summaryrefslogtreecommitdiff
path: root/tests/test_progress_dashboard.py
diff options
context:
space:
mode:
authorthementorswtor <359662566+thementorswtor@users.noreply.github.com>2026-11-22 14:23:53 -0300
committerthementorswtor <359662566+thementorswtor@users.noreply.github.com>2026-11-22 14:23:53 -0300
commit2de7683f43be84ee3c7c70c243d1e5bda8eaf653 (patch)
tree61b12bb6894f70c5f1bdaf98120168a6d058ced1 /tests/test_progress_dashboard.py
parent9a82abceb304b2d04ca6f3699207e2948c397227 (diff)
progress_dashboard: read make_game.py's shaders folder; add a GPU-test panel
- corpus: make_game.py writes <work>/shaders/dxbc and <work>/shaders/spirv; the tool looked for <work>/dxbc and <work>/spirv and found nothing on a real work folder. The shaders folder itself is accepted too. The test now builds that layout. - GPU tests: --gpu-log <file>[=<GPU, driver, OS>] reads the saved output of runtime/test/shaders/check.py, one group per GPU. ok is a pass, SKIP is not counted, anything else is a failure with its one-line detail; a log older than the last commit touching runtime/test/shaders or tools/rdna2spirv.py counts as needing a re-run. Result lines are told from the other lines check.py prints by its {name:20} column. Checked on a real work folder: 26,501 of 26,503 carved shaders pass spirv-val, and none of the 26,503 shader names appears in the page or the JSON.
Diffstat (limited to 'tests/test_progress_dashboard.py')
-rw-r--r--tests/test_progress_dashboard.py37
1 files changed, 33 insertions, 4 deletions
diff --git a/tests/test_progress_dashboard.py b/tests/test_progress_dashboard.py
index d87da9c39..b112e2926 100644
--- a/tests/test_progress_dashboard.py
+++ b/tests/test_progress_dashboard.py
@@ -113,6 +113,34 @@ class Freshness(unittest.TestCase):
113 self.assertEqual(got["test_progress_dashboard.py"], ("verified", "unknown")) 113 self.assertEqual(got["test_progress_dashboard.py"], ("verified", "unknown"))
114 114
115 115
116class GpuLog(unittest.TestCase):
117 LOG = "\n".join([
118 "using runtime/build/RelWithDebInfo",
119 "cs_bounds ok",
120 "ps_texoff SKIP (VK_KHR_maintenance8 missing)",
121 "cs_bpermute32 lane 3: got 0x00000000, want 0x00000007",
122 "2 of 3 pass, 1 skipped",
123 ])
124
125 def test_lines_and_summary(self):
126 rows, summary = pd.parse_gpu_log(self.LOG)
127 self.assertEqual([(n, r) for n, r, _ in rows], [("cs_bounds", "pass"), ("ps_texoff", "skip"), ("cs_bpermute32", "fail")])
128 self.assertIn("want 0x00000007", rows[2][2])
129 self.assertEqual(summary, (2, 3, 1))
130
131 def test_panel_groups_by_gpu_label(self):
132 with tempfile.TemporaryDirectory() as tmp:
133 log = os.path.join(tmp, "check.txt")
134 with open(log, "w", encoding="utf-8", newline="\n") as f:
135 f.write(self.LOG + "\n")
136 col = pd.Collector()
137 pd.collect_gpu(col, [log + "=RTX 4060, 576.02, Windows 11"])
138 self.assertEqual({c["group"] for c in col.components}, {"RTX 4060, 576.02, Windows 11"})
139 self.assertEqual(sorted(c["status"] for c in col.components)[0], "failed")
140 m = next(m for m in col.metrics if m["id"] == "gpu.current")
141 self.assertEqual(m["denominator"], 2) # the skip is not counted
142
143
116class Github(unittest.TestCase): 144class Github(unittest.TestCase):
117 def test_d3d_states(self): 145 def test_d3d_states(self):
118 self.assertEqual(pd.d3d_state("@a", "#291 merged, #819, #831 on main", "")[0], "partial") 146 self.assertEqual(pd.d3d_state("@a", "#291 merged, #819, #831 on main", "")[0], "partial")
@@ -125,12 +153,13 @@ class Corpus(unittest.TestCase):
125 def test_counts_only_never_names(self): 153 def test_counts_only_never_names(self):
126 with tempfile.TemporaryDirectory() as tmp: 154 with tempfile.TemporaryDirectory() as tmp:
127 work = os.path.join(tmp, "work") 155 work = os.path.join(tmp, "work")
128 os.makedirs(os.path.join(work, "dxbc")) 156 sh = os.path.join(work, "shaders") # make_game.py's layout
129 os.makedirs(os.path.join(work, "spirv")) 157 os.makedirs(os.path.join(sh, "dxbc"))
158 os.makedirs(os.path.join(sh, "spirv"))
130 carved = [{"name": f"{SENTINEL}_{i}", "stage": "pixel" if i < 3 else "compute"} for i in range(5)] 159 carved = [{"name": f"{SENTINEL}_{i}", "stage": "pixel" if i < 3 else "compute"} for i in range(5)]
131 with open(os.path.join(work, "dxbc", "index.json"), "w", encoding="utf-8", newline="\n") as f: 160 with open(os.path.join(sh, "dxbc", "index.json"), "w", encoding="utf-8", newline="\n") as f:
132 json.dump(carved, f) 161 json.dump(carved, f)
133 with open(os.path.join(work, "spirv", "index.json"), "w", encoding="utf-8", newline="\n") as f: 162 with open(os.path.join(sh, "spirv", "index.json"), "w", encoding="utf-8", newline="\n") as f:
134 json.dump({f"{SENTINEL}_0": {"stage": "pixel"}, f"{SENTINEL}_3": {"stage": "compute"}, 163 json.dump({f"{SENTINEL}_0": {"stage": "pixel"}, f"{SENTINEL}_3": {"stage": "compute"},
135 f"{SENTINEL}_4": {"error": "x"}}, f) 164 f"{SENTINEL}_4": {"error": "x"}}, f)
136 col = pd.Collector() 165 col = pd.Collector()