Skip to content

Commit 9f438e6

Browse files
karthiknadigCopilot
andcommitted
test: tighten post-fix macOS performance budgets (Fixes #507)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f0c62d9 commit 9f438e6

3 files changed

Lines changed: 30 additions & 7 deletions

File tree

‎docs/QUALITY_SNAPSHOTS.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ A metric blocks when it exceeds both its absolute and relative budget:
1515
| Metric | Linux | Windows | macOS |
1616
| --- | ---: | ---: | ---: |
1717
| Server startup P50 | 5 ms / 100% | 10 ms / 50% | 100 ms / 50% |
18-
| Server startup P95 | 50 ms / 200% | 50 ms / 100% | 10,000 ms / 100% |
18+
| Server startup P95 | 50 ms / 200% | 50 ms / 100% | 750 ms / 100% |
1919
| Full refresh P50 | 25 ms / 30% | 50 ms / 30% | 100 ms / 50% |
20-
| Full refresh P95 | 1,000 ms / 100% | 5,000 ms / 100% | 5,000 ms / 25% |
20+
| Full refresh P95 | 1,000 ms / 100% | 5,000 ms / 100% | 1,000 ms / 50% |
2121
| Time to first environment P50 | 20 ms / 100% | 25 ms / 50% | 150 ms / 50% |
22-
| Time to first environment P95 | 250 ms / 100% | 500 ms / 100% | 10,000 ms / 100% |
22+
| Time to first environment P95 | 250 ms / 100% | 500 ms / 100% | 750 ms / 100% |
2323

2424
Each cell is `absolute / relative`. The budgets reflect observed GitHub-hosted runner variance from 11 consecutive main-branch baselines. Tighten them when a noisy path is fixed rather than normalizing a known regression into the baseline.
2525

26+
The macOS P95 budgets were recalibrated after #504 using three unchanged-content pull-request runs and the exact merged baseline. Their absolute headroom is four to six times the observed post-fix run-to-run range.
27+
2628
The dual budget avoids failing on tiny percentage changes while still blocking material latency regressions. Tail metrics remain mandatory; a healthy median does not excuse a degraded P95.
2729

2830
## Coverage gate
@@ -50,4 +52,4 @@ Phase and locator telemetry is collected in separate, untimed refreshes so diagn
5052

5153
## Known investigations
5254

53-
The macOS cold-refresh tail is tracked by issue #504. Phase and locator distributions plus privacy-safe interpreter timeout counts verify that the tail does not recur.
55+
The macOS cold-refresh tail fixed by issue #504 remains guarded by phase and locator distributions plus privacy-safe interpreter timeout counts.

‎scripts/quality_snapshot.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ def regressed(self) -> bool:
8080
),
8181
'macos': (
8282
RegressionBudget(100, 50),
83-
RegressionBudget(10_000, 100),
83+
RegressionBudget(750, 100),
8484
RegressionBudget(100, 50),
85-
RegressionBudget(5_000, 25),
85+
RegressionBudget(1_000, 50),
8686
RegressionBudget(150, 50),
87-
RegressionBudget(10_000, 100),
87+
RegressionBudget(750, 100),
8888
),
8989
}
9090
COVERAGE_BUDGET_PERCENTAGE_POINTS = 0.01

‎scripts/tests/test_quality_snapshot.py‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,27 @@ def test_p95_regression_fails_even_when_p50_is_unchanged(self):
6464
_, failures = compare_performance(current, performance_snapshot(refresh_p95=500), 'Windows')
6565
self.assertTrue(any('Full refresh P95' in failure for failure in failures))
6666

67+
def test_post_fix_macos_tail_variance_passes(self):
68+
baseline = performance_snapshot(startup_p95=621, refresh_p95=1_343, first_p95=649)
69+
current = performance_snapshot(startup_p95=691, refresh_p95=1_435, first_p95=745)
70+
71+
_, failures = compare_performance(current, baseline, 'macOS')
72+
73+
self.assertEqual(failures, [])
74+
75+
def test_tightened_macos_tail_budgets_reject_multi_second_regressions(self):
76+
baseline = performance_snapshot(startup_p95=621, refresh_p95=1_343, first_p95=649)
77+
current = performance_snapshot(startup_p95=1_500, refresh_p95=2_500, first_p95=1_500)
78+
79+
_, failures = compare_performance(current, baseline, 'macOS')
80+
81+
for label in (
82+
'Server startup P95',
83+
'Full refresh P95',
84+
'Time to first environment P95',
85+
):
86+
self.assertTrue(any(label in failure for failure in failures))
87+
6788
def test_noise_inside_absolute_budget_passes(self):
6889
current = performance_snapshot(refresh_p50=140)
6990
_, failures = compare_performance(current, performance_snapshot(refresh_p50=100), 'Windows')

0 commit comments

Comments
 (0)