Repository navigation
feat(skills): add codspeed-write-benchmarks skill - #621
not-matthias wants to merge 4 commits into
Conversation
[Low impact] The PR appears safe to merge; no new actionable issues were found. SummaryAdds
Reviews (2) · Last reviewed commit: "docs(plugin): mention benchmark writing ..." · Reviewed by Greptile |
Merging this PR will not alter performance2 warnings
Comparing Footnotes
|
aee0b29 to
32c1427
Compare
|
|
||
| 1. Read the benchmark against the rules. | ||
| 2. If the CodSpeed CLI is installed and authenticated, run the benchmark once and check: | ||
| - `get_run` reports no issue on it. | ||
| - The value is plausible and scales with input size the way the operation should, for example flat for a hash lookup and linear for a scan. | ||
| - `query_flamegraph` shows the function under test, not setup code, as the main cost. | ||
| 3. Only when stability is in question, run it again without any change. | ||
| - Simulation and memory results should be nearly identical. A visible difference means the benchmark breaks rule 4 or 5. | ||
| - Local walltime results vary with the machine. Use them to rank suspects only. Judge stability from CI runs on macro runners, where `get_benchmark_result` shows the spread across rounds and the outliers. | ||
|
|
||
| If the CLI is not available, report the findings from step 1 and state that nothing was measured. |
There was a problem hiding this comment.
I think you meant MCP rather than CLI
If the CodSpeed CLI is installed and authenticated
If the CLI is not available,
|
daily: make sure to sync the docs as well |
Agents writing or editing CodSpeed benchmarks had no guidance on what makes a benchmark valid: the existing skills cover harness setup and optimization, not benchmark design. The skill lists language-agnostic rules (measure only the code under test, keep inputs constant, isolate state, size per instrument, keep names stable), a tiered verify step (static review, one CodSpeed run checked through the MCP tools, reruns only for noisy benchmarks), maintenance tasks for renames and code changes, and short notes for Rust, Node.js, Python and the exec harness. Details link to the CodSpeed docs.
Both skills triggered on requests like 'create a benchmark', and setup-harness repeated a shorter version of the benchmark-writing rules. Narrow its description to first-time setup and replace Step 4 with workload selection plus a pointer to codspeed-write-benchmarks, so the rules live in one place.
Optimizing against a noisy or invalid benchmark produces gains that are not real. Tell the optimize skill to fix such benchmarks with codspeed-write-benchmarks before starting the loop.
List the new codspeed-write-benchmarks skill among the included skills in the plugin long description.
32c1427 to
28f6463
Compare
TLDR: Agents had no guidance on writing valid CodSpeed benchmarks. This adds a compact skill with rules, a verify step and maintenance tasks, and points the existing skills at it.
New skill
codspeed-write-benchmarksExisting skills and plugin
codspeed-setup-harness: description narrowed to first-time setup, so both skills no longer trigger on "create a benchmark". Its benchmark-writing step now points to the new skill.codspeed-optimize: fix noisy or invalid benchmarks with the new skill before optimizing.plugin.json: long description mentions the new skill.Review notes
Fixes COD-4129