From 284e0dfd51a01ca7456c906eb988147c19ef39b8 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Tue, 3 Nov 2026 15:37:13 -0800 Subject: [PATCH] :bug: Gate the bench's numbers on bench.m's hash alone The bench's metrics were tied to one hash of the sweep's sources and bench.m together, though bench.m builds alone. Car 9 changed only sweep_ca.m, so its draws.10k fall of 61.7% against car 8 went ungated as 'its tool changed since the baseline'. tools.txt now records bench.m's own hash, and a run recorded before it falls back to the combined one. --- scripts/internal/lane-gate.sh | 1 + scripts/internal/lane-gate/report.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/internal/lane-gate.sh b/scripts/internal/lane-gate.sh index c3e52011f..67394de61 100755 --- a/scripts/internal/lane-gate.sh +++ b/scripts/internal/lane-gate.sh @@ -247,6 +247,7 @@ do_guest_build() { grep -rqs IOGVAHEVCDecode guest/kext/src && echo hevc true; } > "$ART/tip-codecs.txt" { for f in guest/bundle/tools/sweep/*.[mh] guest/bundle/tools/bench/bench.m; do shasum "$f"; done | shasum | echo "sweep+bench $(cut -c1-16)" + echo "bench $(shasum < guest/bundle/tools/bench/bench.m | cut -c1-16)" # bench.m builds alone echo "present_probe $(shasum < "$(tool_src guest/bundle/tools/present_probe.m)" | cut -c1-16)" echo "decode_md5 $(shasum < "$(tool_src guest/bundle/tools/decode_md5.m)" | cut -c1-16)" [[ ! -f $o/oracle_icb.m ]] || echo "oracle_icb $(cat "$o/oracle_icb.m" "$o/oracle_icb.metal" "$o/oracle_common.h" | shasum | cut -c1-16)" diff --git a/scripts/internal/lane-gate/report.py b/scripts/internal/lane-gate/report.py index da8beda80..40471423e 100755 --- a/scripts/internal/lane-gate/report.py +++ b/scripts/internal/lane-gate/report.py @@ -836,14 +836,21 @@ def noise_from(bdirs_root): # The tool whose numbers a metric is: where its source differs from the baseline's, the metric is # shown but not gated, as the measuring stick moved. -TOOL_OF = [(r"bench\..*", "sweep+bench"), (r"present\..*", "present_probe"), (r"decode\..*", "decode_md5"), +TOOL_OF = [(r"bench\..*", "bench"), (r"present\..*", "present_probe"), (r"decode\..*", "decode_md5"), (r"(drag\.|[a-z]+_cpu\.drag\.).*", "drag")] +# A tool whose hash a run recorded before the tool had its own: bench.m's was the sweep's and +# bench.m's together, so a sweep change kept the bench's numbers from being gated. +OLDER_TOOL = {"bench": "sweep+bench"} + + def tool_changed(name, meta, base_meta): for rx, tool in TOOL_OF: if re.fullmatch(rx, name): a, b = meta.get("tools", {}).get(tool), base_meta.get("tools", {}).get(tool) + if (a is None or b is None) and tool in OLDER_TOOL: + a, b = (m.get("tools", {}).get(OLDER_TOOL[tool]) for m in (meta, base_meta)) return a is not None and b is not None and a != b return False