Skip to content

ci: the daily performance run reports regressions, improvements and a ratchet - #798

Merged
szibis merged 1 commit into
ci/perf-daily-skip-unchangedfrom
ci/perf-daily-alerts
Oct 21, 2026
Merged

szibis merged 1 commit into
ci/perf-daily-skip-unchangedfrom
ci/perf-daily-alerts

Conversation

@szibis

@szibis szibis commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #796 (daily-PR skip). Merge #796 first; this PR then retargets to main.

The daily performance run now reports what changed since the previous run, and turns red on a regression:

  • Regressions:
    • a result that goes from same as Loki to different;
    • a status that goes from 200 to an error;
    • a slowdown that holds two runs in a row, or that the same run's release comparison also shows.
  • Improvements: the reverse moves.
  • Ratchet losses: a row that was at least as fast as Loki (Loki's cold computed, not cache-served) and had Loki's result, and lost that.

Each alert names the commit range to bisect. The alerts go at the top of the daily PR body and into the job summary. A final step fails the run when there are regressions or ratchet losses, so GitHub notifies the maintainer. No issues are opened and no labels are added.

Changes

  • bench/ab/history.py:
    • a loki_cold_computed history column, derived from cold_cache_served and Loki's cache counters, so old lines read as unknown;
    • an alerts subcommand (pure function alerts()), plus ratchet.json (add-only, sorted).
    • Rules:
      • a slowdown counts only if it held two runs, or the same run's verdict vs the release is slower;
      • a cold ratchet loss needs two runs;
      • parity and status losses are immediate;
      • only sets the run wrote are evaluated, so a one-set manual dispatch does not re-report other sets;
      • warm p50 is never ratcheted, because Loki's warm answer comes from its results cache.
  • bench/ab/daily.py: computes alerts after history is appended, updates ratchet.json, and writes alerts.md and alerts.json under --out.
  • perf-daily.yaml:
    • the alerts go first in the PR body and in the job summary;
    • a Fail on regressions step runs after the PR and arm-auto-merge steps, with values passed through the environment;
    • alerts.md is uploaded with the run artifacts.
  • bench/ab/README.md and a CHANGELOG entry under CI.

Proofs

  • bench/ab/tests: 124 pass, including 24 alert tests. They cover each regression, improvement and ratchet rule, the two-run requirements, the cache-served and unknown Loki colds that never ratchet, old lines without the new column, the commit ranges, stable markdown, and the CLI writing its files.
  • Script tests: scripts/ci/tests: 77 pass, including the pinned-uses test.
  • Committed history: alerts reports no regressions and no improvements. The ratchet starts empty, because committed lines lack the new column; it fills from the first daily run after merge.
  • trend.md, performance.md, gaps.md: regenerate with no diff.
  • Linting and gates: actionlint (pinned and local) and zizmor 1.30.1 (pinned) report no findings; the conformance and changelog gates pass.

Not applicable: no proxy code changes, so e2e vs Loki, the Grafana range matrix, visual proof, A/B, benchstat and the load test do not apply.

@github-actions github-actions Bot added size/XL Extra large change scope/ci CI/CD scope/docs Documentation maintenance Maintenance labels Oct 21, 2026
… ratchet

The daily run only recorded numbers, so a result that started differing
from Loki or a query that started failing waited for someone to read the
trend. `history.py alerts` compares each set's newest history line with the
previous valid one and reports transitions, not the state many rows are
already in:

- regression: result same -> differs; status 200 -> an error Loki does not
  give; warm p50 slower beyond the 25% / 50 ms noise rule that held for two
  runs (both worse than the run before them, range starting at that run) or
  that the same run's verdict against the release also calls slower
- improvement: the reverse of the first two, or faster beyond the noise rule
- every alert names its commit range

A new history column, loki_cold_computed, records from Loki's cache
counters whether Loki computed its cold run (true), its results cache
answered it (false) or nothing is known (null, on every older line, which
carry their own cols). bench/ab/history/ratchet.json lists rows with the
same result as Loki, status 200 and a cold run no slower than a computed
Loki cold run; the run only adds to it, rows leave by hand, and a ratcheted
row that differs or fails, or is slower than Loki's computed cold in two runs in a row, is a loss.

daily.py writes alerts.md and alerts.json next to the run's files (not
committed: they describe one run), only for the sets it just wrote. The
workflow puts them at the top of the daily pull request and in the job
summary, and a final step fails the job on a regression or a ratchet loss.
The pull request validation shows them and does not fail on them.
@szibis
szibis force-pushed the ci/perf-daily-skip-unchanged branch from 3a3ab7d to a6312cd Compare October 21, 2026 17:58
@szibis
szibis force-pushed the ci/perf-daily-alerts branch from d0c6315 to e1f5faa Compare October 21, 2026 17:59
@github-actions github-actions Bot added size/XL Extra large change and removed size/XL Extra large change labels Oct 21, 2026
@szibis
szibis merged commit 6012e2b into ci/perf-daily-skip-unchanged Oct 21, 2026
1 check passed
@szibis
szibis deleted the ci/perf-daily-alerts branch October 21, 2026 18:00
szibis added a commit that referenced this pull request Oct 21, 2026
…796)

* ci: skip the daily performance run when nothing it measures changed

* ci: the daily performance run reports regressions, improvements and a ratchet (#798)

The daily run only recorded numbers, so a result that started differing
from Loki or a query that started failing waited for someone to read the
trend. `history.py alerts` compares each set's newest history line with the
previous valid one and reports transitions, not the state many rows are
already in:

- regression: result same -> differs; status 200 -> an error Loki does not
  give; warm p50 slower beyond the 25% / 50 ms noise rule that held for two
  runs (both worse than the run before them, range starting at that run) or
  that the same run's verdict against the release also calls slower
- improvement: the reverse of the first two, or faster beyond the noise rule
- every alert names its commit range

A new history column, loki_cold_computed, records from Loki's cache
counters whether Loki computed its cold run (true), its results cache
answered it (false) or nothing is known (null, on every older line, which
carry their own cols). bench/ab/history/ratchet.json lists rows with the
same result as Loki, status 200 and a cold run no slower than a computed
Loki cold run; the run only adds to it, rows leave by hand, and a ratcheted
row that differs or fails, or is slower than Loki's computed cold in two runs in a row, is a loss.

daily.py writes alerts.md and alerts.json next to the run's files (not
committed: they describe one run), only for the sets it just wrote. The
workflow puts them at the top of the daily pull request and in the job
summary, and a final step fails the job on a regression or a ratchet loss.
The pull request validation shows them and does not fail on them.

Co-authored-by: szibis <szibis@users.noreply.github.com>

---------

Co-authored-by: szibis <szibis@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Maintenance scope/ci CI/CD scope/docs Documentation size/XL Extra large change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant