From 8ceb5ef4b326b3ff88d6a081d38df9a7f90fda7b Mon Sep 17 00:00:00 2001 From: MoonEyes <14891700+MoonEyes@users.noreply.github.com> Date: Tue, 1 Dec 2026 13:09:06 +0100 Subject: [PATCH] chain_check: read the slow compute pipeline line as the runtime prints it now The line says where the pipeline came from since 7acf84d38, so the pin in tests/test_chain_check.py failed on main. Only a compile counts as a build. Co-Authored-By: Claude Opus 5.5 --- tests/test_chain_check.py | 18 +++++++++++++++++- tools/chain_check.py | 3 ++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/test_chain_check.py b/tests/test_chain_check.py index 38a0dad9b7..635b46123d 100644 --- a/tests/test_chain_check.py +++ b/tests/test_chain_check.py @@ -280,6 +280,21 @@ def test_descriptor_table_lines(self): self.assertEqual(block(chain_check.check(work, log, probe=False), "runtime")["descriptor_table"], expected) + def test_only_compiles_count_as_slow_builds(self): + work = make_work(os.path.join(self.root, "w")) + name = "[rt] d3d12: compute pipeline library/aaaa took 4.2 s to " + cases = (("build (100 B SPIR-V)", 1), + ("obtain from a compile (100 B SPIR-V; hit 0, seeded 0, written 1)", 1), + ("obtain from the shared cache (100 B SPIR-V; hit 1, seeded 0, written 0)", 0), + ("obtain from its journal file (100 B SPIR-V; hit 1, seeded 1, written 0)", 0)) + for line, expected in cases: + with self.subTest(line=line): + base = runtime_log(os.path.join(self.root, "b.log")) + log = runtime_log(os.path.join(self.root, "t.log"), extra=(name + line,)) + slow = [block(chain_check.check(work, x, probe=False), "runtime")["slow_compute_builds"] + for x in (base, log)] + self.assertEqual(slow[1] - slow[0], expected) + def test_runtime_sources_still_print_what_the_regexes_read(self): # Every runtime line the report counts, pinned to the source that prints it: a reworded message would make # its count fall to 0 and the runtime block pass in silence. @@ -291,7 +306,8 @@ def test_runtime_sources_still_print_what_the_regexes_read(self): "%zu fspx_gfx, %zu bvh, %zu exe) from %s", "[rt] d3d12: no translated compute shader for %s sha256", "[rt] d3d12: compute pipeline %s (%zu B SPIR-V, %s) build starts at t=", - "[rt] d3d12: compute pipeline %s took %.1f s to build", + "[rt] d3d12: compute pipeline %s took %.1f s to obtain from %s (%zu B SPIR-V; hit %d,", + 'out.journal_hit ? "its journal file" : out.from_shared ? "the shared cache" : "a compile"', "[rt] d3d12: descriptor table: %s (all %zu modules)", "[rt] d3d12: descriptor table: %zu tagged / %zu plain modules; using %s", "[rt] d3d12: descriptor table: %s (LEONIDA_DESCRIPTOR_TABLE; %zu tagged / %zu plain modules)"], diff --git a/tools/chain_check.py b/tools/chain_check.py index 7cbe834a8a..5405e8f506 100644 --- a/tools/chain_check.py +++ b/tools/chain_check.py @@ -107,7 +107,8 @@ SLOT_FAIL = re.compile(r"\[rt\] d3d12_xs: slot (\d+) call \d+ failed with (0x[0-9a-fA-F]{8})") NO_COMPUTE = re.compile(r"\[rt\] d3d12: no translated compute shader for ") BUILD_START = re.compile(r"\[rt\] d3d12: compute pipeline \S+ \(\d+ B SPIR-V, [^)]*\) build starts") -BUILD_SLOW = re.compile(r"\[rt\] d3d12: compute pipeline \S+ took [0-9.]+ s to build") +# "to build" is the line of older logs. The line now names where the pipeline came from, and only a compile is a build. +BUILD_SLOW = re.compile(r"\[rt\] d3d12: compute pipeline \S+ took [0-9.]+ s to (?:build|obtain from a compile) ") TRACE = re.compile(r"\[d3d12-trace\] #\d+ (.+) (failed|unsupported|refused|partial)\s*$") GATE = re.compile(r"\[rt\] submit-lock: thread \d+ is waiting at the compile gate") STALL = re.compile(r"\[rt\] device-fault: submitted dispatch ") # also printed for a plain stall