Skip to content

feat(paired): same-runner base-vs-PR comparison#3

Merged
pedromvgomes merged 1 commit into
mainfrom
feature/paired
Jul 19, 2026
Merged

feat(paired): same-runner base-vs-PR comparison#3
pedromvgomes merged 1 commit into
mainfrom
feature/paired

Conversation

@pedromvgomes

Copy link
Copy Markdown
Contributor

Summary

Add paired same-runner comparison — re-bench the base commit on the same
runner as the PR and compare the two directly, instead of diffing against a
stored baseline recorded on a different runner at a different time. Stored
baselines carry too much machine-to-machine variance to trust for small deltas;
paired cancels it.

What

  • CLI: cubit compare --baseline-criterion-dir <dir> — ingest a second
    criterion output as the baseline. Precedence: --baseline file >
    --baseline-criterion-dir > --baseline-ref. An empty/failed base run
    degrades to "all new" (comment still posts).
  • Action: paired: true — on pull_request, after the Run benchmarks
    step produces the PR head's criterion, snapshot it, check out the base commit
    (requires the caller's checkout fetch-depth: 0), re-run bench-command, and
    compare the two. Falls back to an empty baseline if the base can't be checked
    out. Record (default-branch) runs are unaffected.

Cost

Paired ~doubles the bench time per PR (two compiles + runs on one runner) — the
accepted trade for trustworthy, variance-free deltas.

Verification

  • go build/vet/test/gofmt clean; action.yml parses.
  • --baseline-criterion-dir verified: same dir → 0% deltas; missing dir →
    graceful "all new".

Merge Commit Message

feat(paired): same-runner base-vs-PR comparison

Add cubit compare --baseline-criterion-dir and an action paired mode that re-benches the base commit on the same runner as the PR, cancelling the machine-to-machine variance a stored baseline can't.

https://claude.ai/code/session_016pTq6aVBJvTtXmwTgKw2Yh

A stored baseline (recorded on a different runner at a different time) carries
too much machine-to-machine variance to trust for small deltas. Paired mode
re-benches the base commit on the SAME runner as the PR, cancelling that.

- `cubit compare --baseline-criterion-dir <dir>`: use a second criterion output
  as the baseline (precedence: --baseline file > --baseline-criterion-dir >
  --baseline-ref). An empty/failed base run degrades to "all new" so the comment
  still posts.
- action.yml `paired: true`: on pull_request, after the "Run benchmarks" step
  produces the PR head's criterion, snapshot it, check out the base commit
  (needs the caller's fetch-depth: 0), re-run bench-command, and compare the two
  directly. Falls back to an empty baseline if the base can't be checked out.
  Record runs are unaffected.

Claude-Session: https://claude.ai/code/session_016pTq6aVBJvTtXmwTgKw2Yh
@pedromvgomes
pedromvgomes merged commit d068457 into main Jul 19, 2026
2 checks passed
@pedromvgomes
pedromvgomes deleted the feature/paired branch July 19, 2026 19:55
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.

1 participant