Skip to content

Commit aed3c22

Browse files
test: tighten post-fix macOS performance budgets (Fixes #507) (#508)
## Summary Recalibrate macOS P95 regression budgets now that #506 removed the deterministic 30-second interpreter-probe tail. The new limits preserve 4-6x observed hosted-runner variance while blocking multi-second drift that the old baseline-era limits allowed. ## Changes - tighten startup P95 from 10,000ms to 750ms absolute headroom - tighten full-refresh P95 from 5,000ms/25% to 1,000ms/50% - tighten time-to-first P95 from 10,000ms to 750ms absolute headroom - prove the worst observed post-fix run remains within budget - prove 1.5s/2.5s/1.5s synthetic regressions now fail - document calibration from three unchanged-content runs and the exact merged baseline ## Validation - `python -m unittest discover -s scripts/tests -p 'test_*.py' -v` (22 passed) - worst observed macOS artifact passes against merged baseline `f0c62d9` Fixes #507 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f0c62d9 commit aed3c22

3 files changed

Lines changed: 31 additions & 8 deletions

File tree

docs/QUALITY_SNAPSHOTS.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ 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

24-
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.
24+
Each cell is `absolute / relative`. The Linux and Windows budgets plus the macOS P50 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.
25+
26+
The macOS P95 budget recalibration is tracked by issue #507 and follows PR #506's fix for issue #504. It uses three unchanged-content pull-request runs and the exact merged baseline at `f0c62d9`; the resulting absolute headroom is four to six times the observed post-fix run-to-run range.
2527

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

@@ -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 PR #506 (tracked in 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)