From 6a19a13668c61e486a580fd178d7c2f84bd9cf57 Mon Sep 17 00:00:00 2001 From: alpz1000 <88530489+alpz1000@users.noreply.github.com> Date: Tue, 24 Nov 2026 10:55:58 -0600 Subject: [PATCH 1/2] Scripts: reject smoke comparisons with zero baseline frames --- scripts/pr_check.py | 4 +++- scripts/test_pr_check.py | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/scripts/pr_check.py b/scripts/pr_check.py index cb0ef3ef9e..b6f2c1e966 100644 --- a/scripts/pr_check.py +++ b/scripts/pr_check.py @@ -155,7 +155,9 @@ def check(body, head, files, is_main_ancestor, *, test_only=False): problems.append("the main and PR regression runs are not of the same title for the same time") else: pf, mf = number(pr.get("frames shown")), number(m.get("frames shown")) - if mf and (pf is None or pf < FRAMES_KEPT * mf): + if mf == 0: + problems.append("the main regression run shows zero frames; rerun it with a title that presents frames") + elif mf and (pf is None or pf < FRAMES_KEPT * mf): problems.append(f"the PR's run shows fewer frames than main's ({pf} against {mf})") pc, mc = number(pr.get("peak commit")), number(m.get("peak commit")) if pc and mc and pc > COMMIT_GROWTH * mc: diff --git a/scripts/test_pr_check.py b/scripts/test_pr_check.py index 8cc45d5d06..0fec34862f 100644 --- a/scripts/test_pr_check.py +++ b/scripts/test_pr_check.py @@ -102,6 +102,19 @@ def test_non_numeric_frames_shown_fails(self): self.assertIn("the PR's regression run (`xcl-smoke` block of commit 1234567890) " "has a non-numeric `frames shown`: many", problems) + def test_zero_baseline_frames_fail_the_comparison(self): + baseline = "title: G\nseconds: 60\ndevice removals: 0\ncrashes: 0\n" + for frames in (0, 100): + with self.subTest(pr_frames=frames): + problems = self.smoke_problems( + baseline + "frames shown: 0 (PresentX 0)\n", + baseline + f"frames shown: {frames}\n", + ) + self.assertEqual( + ["the main regression run shows zero frames; rerun it with a title that presents frames"], + problems, + ) + class TemplatePlaceholderTests(unittest.TestCase): def test_untouched_pr_template_fails_all_required_sections(self): From d96114c7665879b995a149859ce37bfcd8d0311a Mon Sep 17 00:00:00 2001 From: alpz1000 <88530489+alpz1000@users.noreply.github.com> Date: Tue, 24 Nov 2026 17:56:34 -0600 Subject: [PATCH 2/2] Allow crash fixes when main shows no frames --- scripts/pr_check.py | 4 ++-- scripts/test_pr_check.py | 27 ++++++++++++++++----------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/scripts/pr_check.py b/scripts/pr_check.py index b6f2c1e966..913b32ab9f 100644 --- a/scripts/pr_check.py +++ b/scripts/pr_check.py @@ -155,8 +155,8 @@ def check(body, head, files, is_main_ancestor, *, test_only=False): problems.append("the main and PR regression runs are not of the same title for the same time") else: pf, mf = number(pr.get("frames shown")), number(m.get("frames shown")) - if mf == 0: - problems.append("the main regression run shows zero frames; rerun it with a title that presents frames") + if mf == 0 and pf == 0: + problems.append("both regression runs show zero frames; rerun them with a title that presents frames") elif mf and (pf is None or pf < FRAMES_KEPT * mf): problems.append(f"the PR's run shows fewer frames than main's ({pf} against {mf})") pc, mc = number(pr.get("peak commit")), number(m.get("peak commit")) diff --git a/scripts/test_pr_check.py b/scripts/test_pr_check.py index 0fec34862f..644a72fbdd 100644 --- a/scripts/test_pr_check.py +++ b/scripts/test_pr_check.py @@ -102,18 +102,23 @@ def test_non_numeric_frames_shown_fails(self): self.assertIn("the PR's regression run (`xcl-smoke` block of commit 1234567890) " "has a non-numeric `frames shown`: many", problems) - def test_zero_baseline_frames_fail_the_comparison(self): + def test_both_runs_with_zero_frames_fail(self): baseline = "title: G\nseconds: 60\ndevice removals: 0\ncrashes: 0\n" - for frames in (0, 100): - with self.subTest(pr_frames=frames): - problems = self.smoke_problems( - baseline + "frames shown: 0 (PresentX 0)\n", - baseline + f"frames shown: {frames}\n", - ) - self.assertEqual( - ["the main regression run shows zero frames; rerun it with a title that presents frames"], - problems, - ) + problems = self.smoke_problems( + baseline + "frames shown: 0 (PresentX 0)\n", + baseline + "frames shown: 0 (PresentX 0)\n", + ) + self.assertEqual( + ["both regression runs show zero frames; rerun them with a title that presents frames"], + problems, + ) + + def test_zero_baseline_allows_a_pr_that_presents_frames(self): + baseline = "title: G\nseconds: 60\ndevice removals: 0\ncrashes: 0\n" + self.assertEqual([], self.smoke_problems( + baseline + "frames shown: 0\n", + baseline + "frames shown: 100\n", + )) class TemplatePlaceholderTests(unittest.TestCase):