8000 Improve nightly benchmark regression detection with repeat filtering by adityamukho · Pull Request #401 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

Improve nightly benchmark regression detection with repeat filtering - #401

Merged
adityamukho merged 1 commit into
mainfrom
claude/nifty-shannon-bvm6f8
Sep 26, 2026
Merged

adityamukho merged 1 commit into
mainfrom
claude/nifty-shannon-bvm6f8

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Summary

Enhance the nightly benchmark regression detection workflow to reduce false positives from noisy shared CI runners. The workflow now:

  1. Filters repeated alerts: Only reports benchmarks that alerted in both the current run and the previous run, avoiding single-run noise from slow runners
  2. Preserves visibility: Adds comments to existing regression issues instead of skipping them, ensuring later alerts remain visible
  3. Handles API errors gracefully: Reports immediately if Bencher fails without listing alerts (likely API/upload error), preventing silent failures
  4. Improves reliability: Adds set -o pipefail to catch Bencher command failures and captures output for alert parsing

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change (requires migration or version bump)
  • Documentation / tests only

Changes

  • .github/workflows/bench.yml:
    • Added actions: read permission to allow reading previous workflow run logs
    • Modified Bencher step to capture output with tee and add set -o pipefail
    • Rewrote "Report regression" step to:
      • Parse Bencher alerts from output using regex
      • Query GitHub Actions API for the previous completed run
      • Extract and parse alerts from the previous run's job logs
      • Compare current alerts against previous alerts
      • Only report benchmarks that alerted on two consecutive runs
      • Add comments to existing regression issues instead of skipping
      • Report immediately if Bencher fails without alerts (API error case)

Notes for reviewer

The key insight is that shared CI runners are inherently noisy—a single alert often indicates a slow runner, not a real regression. By requiring alerts to repeat across two consecutive nightly runs, we filter out transient noise while still catching real regressions. The regex pattern - (\S+) \(Latency\): https://bencher\.dev/console/projects/[^/\s]+/alerts/ specifically targets Bencher's alert format in the output.

The change to add comments instead of silently skipping when an issue exists ensures that if a regression persists across multiple nights, all alerts remain visible in the issue thread for investigation.

https://claude.ai/code/session_019dotPmboGEcQoQWSngbceY

Shared runners make single-night Bencher alerts mostly noise. From
Jul 1 to Sep 25, 31 of 87 nightly runs raised alerts, and none were
real regressions (see #301).

The report step now:
- saves the Bencher output and reads the alerted benchmark names
- reads the same suite's alerts from the previous completed run
- reports only benchmarks that alerted on both runs
- comments on an open regression issue instead of skipping it, so an
  old open issue no longer hides new alerts
- still reports at once when Bencher fails without listing alerts

Adds the actions: read permission to read the previous run's job logs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019dotPmboGEcQoQWSngbceY
@codecov
codecov Bot commented Sep 26, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit 525c2a9 into main Sep 26, 2026
17 checks passed
@adityamukho
adityamukho deleted the claude/nifty-shannon-bvm6f8 branch September 26, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0