Repository navigation
bench: check recordings and memory on a PR when it gets the bench label - #32
Conversation
Adding the `bench` label to a PR builds the PR and its base on a Blacksmith macOS runner and runs the new `ci` suite. It fails on broken recordings or a peak memory increase over 2% and 1 MB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
| concurrency: | ||
| group: bench-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true |
There was a problem hiding this comment.
Adding an unrelated label while a benchmark runs can cancel it. Every labeled event shares this workflow-level concurrency group. Cancellation happens before the job-level bench check skips the new run, leaving the PR without benchmark results.
Move concurrency into the gated job, or include the label in the group.
| const gates = | ||
| options.suite === "ci" | ||
| ? evaluateCiGates( | ||
| profile, | ||
| expectedDimensions, | ||
| candidateRuns, | ||
| reference ? referenceRuns : undefined, | ||
| ) |
There was a problem hiding this comment.
Slow displays fail healthy recordings
If the VM display cannot sustain 50 fps, the new ci suite fails even when output and memory pass. Every measured run still uses runStableCapture. Its unconditional unstableMeasurement check adds an error after three attempts below 50 fps, and statusFromGates fails the profile despite passing gates.
Skip this frame-rate prerequisite for ci so the check measures only output and memory.
| ): Gate[] => [ | ||
| ...outputGates(profile, expectedDimensions, candidateRuns), | ||
| regressionGate( |
There was a problem hiding this comment.
evaluateCiGates can pass a movie with zero decoded frames. decode.swift can return an empty frames array with the track's codec and dimensions, including when reading stops before yielding a frame. deriveObserved treats the empty timestamp list as ordered and reports no stimulus rate, so retries do not reject it. The CI gates then pass if memory is unchanged, even though no frame decoded.
Require at least one decoded frame and make the decoder reject a failed read.
ProofThis PR, labeled Throwaway #33, deliberately broken: fail. Run 38186336705. #33 mapped |
- Keep the label name in the concurrency group so other labels can't cancel a running bench. - Fail the ci suite when a recording decodes to zero frames. - Don't retry or fail ci runs over a stimulus just under 50 fps, since the ci suite doesn't gate fps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follows up on Priyansh's idea in #31 (comment). No issue to close.
What this does
Add the
benchlabel to a PR and a Blacksmith macOS runner builds the PR and its base branch, then records with both builds. Nothing runs unless someone with write access adds the label. To run it again after new commits, remove the label and add it back.It fails if:
It skips fps, CPU, and latency. The runner is a VM, so those numbers only measure the VM. Peak memory moved under 0.25% between two copies of the same binary on it, so memory is the one number worth checking there.
Changes
bun run bench ci: new suite. It records balanced 1080p HEVC and H.264 for 5 s, 3 times per build, and checks output and memory only..github/workflows/bench.yml: the label-triggered job. It reuses the Screen Recording grant from the probe branch.Proof
CI runs are linked in the comments below.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.