feat(cu-benchmark): reusable CU benchmark report action#17
Open
dev-jodee wants to merge 1 commit into
Open
Conversation
Woody4618
approved these changes
Jun 8, 2026
830cd55 to
5b09a0d
Compare
Woody4618
approved these changes
Jun 8, 2026
Composite action that diffs a freshly generated compute-unit report against a committed baseline, posts an upsert PR comment with per- instruction Avg deltas vs main, and optionally refreshes the baseline. - comment-only by default (needs pull-requests: write); commit-baseline is opt-in and needs contents: write (gated to same-repo PRs, forks skip) - inputs: report-path, baseline-path, commit-baseline - base=main, head/pr/token derived from the github context in-step - header-indexed markdown parse, robust to column changes
5b09a0d to
c25d348
Compare
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.
What
A composite action that turns a freshly generated compute-unit (CU) report from a Solana program's tests into a PR comment with per-instruction Avg CU deltas vs
main, and can optionally keep a committed baseline in sync.Useful for any program repo that wants visible CU regressions on every PR without extra tooling.
Behavior
cu_report.mdin the checkout (fails loud on 0 or >1;report-pathoverrides). Baseline = its siblingcu_baseline.md.main; diff the fresh report against it.Δ Avg vs maincolumn (🔺/🔻/–/🆕/🗑), deduped by a hidden marker.GITHUB_TOKENdon't re-trigger workflows). Fork PRs skip.base=
main; head ref / PR number / token are derived from thegithubcontext in-step — not inputs.Inputs
report-path""(auto-discover)cu_report.mdcommit-baselinefalsecontents: write+ a same-repo checkPermission profiles
Comment-only (default) — needs only
pull-requests: write. Deltas work against a committed baseline; with no baseline, every instruction shows🆕.Auto-refresh baseline (opt-in) — add
contents: writeand setcommit-baselineto the same-repo check.Example caller workflow
Verification
Diff/render tested against
tabled-style tables (increase, decrease, unchanged, new, removed, empty baseline, mismatched columns). Auto-discovery tested for 0 / 1 / multiple matches + override. Portable bash (no bash-4mapfile).Notes
main: stacked / release-branch PRs diff vs main, not the parent branch.cu_report.jsoncompanion could make diffing format-agnostic.