feat(paired): same-runner base-vs-PR comparison#3
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
cubit compare --baseline-criterion-dir <dir>— ingest a secondcriterion output as the baseline. Precedence:
--baselinefile >--baseline-criterion-dir>--baseline-ref. An empty/failed base rundegrades to "all new" (comment still posts).
paired: true— onpull_request, after theRun benchmarksstep produces the PR head's criterion, snapshot it, check out the base commit
(requires the caller's checkout
fetch-depth: 0), re-runbench-command, andcompare 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/gofmtclean;action.ymlparses.--baseline-criterion-dirverified: 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-dirand an actionpairedmode 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