Repository navigation
fix(ci): make the weekly performance gate tolerate runner and network noise - #337
Conversation
… noise
compare_performance.py gated the 3-iteration mean, which one slow iteration
inflates, and treated recommend/outdated (dominated by live Homebrew API
calls) like local work. The scheduled run failed 3 of the last 6 weeks with
no runtime change; on 2026-10-18 (run 39174628747) apps +30%, recommend
+24%, outdated +90% against the 2026-10-11 baseline, while best-of-3 was
apps +8%, recommend +26%, outdated +61% — the network-bound commands are
slower even at their best, i.e. the network, not the code.
- Gate on best-of-N (min_time) when both files have it; fall back to
avg_time for older result files.
- recommend/outdated time regressions are reported as warnings
("network-bound, not gated"); their memory and apps time stay gated.
- tests/test_compare_performance.py: 6 tests, including a replay of the
2026-10-18 numbers (passes with two warnings); all 6 fail on the old
script.
Full suite: 2839 passed, 16 skipped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Reviewer's GuideThe PR makes the scheduled performance gate resilient to runner and Homebrew network noise by comparing best-of-N timings when available, downgrading known network-bound timing regressions to warnings, and retaining gates for local timing and memory regressions. New tests validate the behavior—including a replay of the historical failure—and the changelog documents the fix. Flow diagram for the resilient performance regression gateflowchart TD
A[Load current and baseline results] --> B{Both results have min_time?}
B -->|Yes| C[Compare min_time]
B -->|No| D[Compare avg_time]
C --> E[Check time and memory deltas]
D --> E
E --> F{Regression exceeds threshold?}
F -->|No| G[Pass]
F -->|Yes| H{Network-bound time regression?}
H -->|Yes| I[Report WARNING; do not fail]
H -->|No| J[Report REGRESSION; fail gate]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
🔒 Security Analysis ReportSecurity Analysis ReportGenerated: Mon Oct 19 09:18:00 UTC 2026 Bandit Security ScanPip-Audit Results |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
#337 switched the gate to best-of-N and warned only on the network-bound benchmarks, but the first post-merge run (39243572918) still failed: `apps` (system_profiler) measured +104% best-of-3 against the 2026-10-11 baseline, after +8% on 2026-10-18, with no runtime change. Wall-clock on shared macOS runners cannot tell a regression from runner noise. - Relative time changes are warnings ("time is advisory"). - The gate fails on what noise cannot produce: a memory regression beyond 20%, or a benchmark whose best iteration (min_time, else avg_time) exceeds the 30 s ceiling — also enforced when there is no baseline. - tests/test_compare_performance.py: 8 tests incl. replays of the 10-18 and 10-19 runs; 6 of them fail on the #337 version. - tests/test_project_consistency.py: locate the regression-check step by its `python scripts/compare_performance.py` invocation, not its display name (the step label now states the new rule). Full suite: 2841 passed, 16 skipped. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Summary
The weekly scheduled performance gate (
performance.yml→scripts/compare_performance.py) fails on runner and network noise, not code. It failed 3 of the last 6 weeks (09-13, 09-27, 10-18) with no runtime change; noversiontracker/commits landed between the passing 10-11 baseline and the 10-18 failure.Two causes, measured on the uploaded result artifacts of run 38182609131 (baseline, 2026-10-11) and run 39174628747 (2026-10-18, attempt 2):
apps(local)recommend(Homebrew API)outdated(Homebrew API)appsis within threshold.recommendandoutdatedare dominated by live Homebrew API calls. They're slower even at their best on an unchanged codebase, so that gate measures the network.The full benchmark only runs on
scheduleandworkflow_dispatch. On PRs the required "Performance Testing" job is skipped, so PRs were never blocked; only the weekly run failed.Changes
scripts/compare_performance.py:min_time(best-of-N) when both files have it, falling back toavg_timefor older result files.recommendandoutdated(NETWORK_BOUND) time regressions are reported asWARNING … network-bound, not gated.appstime, stay gated.tests/test_compare_performance.py: 6 tests (there were none), covering:avg_timefallback;CHANGELOG.md: Unreleased → Fixed.Verification
ruff check,ruff format --check,mypyand the pre-commit hooks are clean.gh workflow run performance.ymlonce to confirm the next real run on a macOS runner.🤖 Generated with Claude Code
Summary by Sourcery
Prevent false weekly performance failures by using noise-resistant timing comparisons and excluding network-bound time regressions from the blocking gate.
Bug Fixes:
Enhancements:
Tests: