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 <noreply@anthropic.com>
This commit is contained in:
MoonEyes
2026-12-01 13:09:06 +01:00
parent c60ce461af
commit 8ceb5ef4b3
2 changed files with 19 additions and 2 deletions

View File

@ -280,6 +280,21 @@ class ChainCheckTest(unittest.TestCase):
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 @@ class ChainCheckTest(unittest.TestCase):
"%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)"],

View File

@ -107,7 +107,8 @@ TABLE_FORCED = re.compile(r"\[rt\] d3d12: descriptor table: (plain|tagged) \(LEO
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