本文へ移動
cccskills
無料GitHub で公開

perf-regression-test

Check a change for performance regression against this machine's recorded baseline - decide whether the diff needs checking, run the deck benchmark under the hygiene wrapper, and attribute any regression to an element. Use before opening a PR that touches the simulation hot path.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md5.5 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Perf regression test

The deciding step is whether to run this at all. Running a two-minute benchmark on a docs PR trains people to skip it entirely; running it on an unquiesced, contended machine produces a "regression" that is really just noise, and one false alarm burns more trust than ten skipped checks would have saved. Read this whole page before running anything.

Never run any of this in CI. GitHub-hosted runners are shared VMs whose run-to-run spread (2-3x) exceeds any regression worth catching — a threshold loose enough not to false-positive there catches nothing. See .claude/notes/perf-tools-not-in-ci.md.

1. Decide whether to run it

Run only when the diff touches:

src/elements/          include/elements/
src/simulation/        include/simulation/
src/tools/             include/tools/math.h
include/tools/fft_convolution.h
include/tools/simd_dispatch.h

Skip for wiki/, examples/, src/user_interface/, src/visualization/, tests/-only and docs-only diffs. Say that it was skipped and why — a silent skip reads as a pass to anyone reading the PR later.

Also skip (for now, re-run later) when:

  • Other builds or agents are active on this machine. Wall-clock measurement under concurrent load is worthless — it will not just be noisy, it will be systematically biased toward "everything got slower." Wait for the machine to go quiet, or say clearly that the check could not be run cleanly.
  • No baseline exists yet for this environment. --check will tell you this itself (exit code 2) — see step 3.

2. Build

cmake --build --preset release --target dnf_composer_deckbench --parallel 4

Use the build-and-test skill for the general build workflow. Let the build finish before timing anything — a build running in the background will contend for CPU exactly like a second agent would.

3. Run under the hygiene wrapper

scripts\bench.ps1 build\release\tests\dnf_composer_deckbench.exe --check
scripts/bench.sh build/release/tests/dnf_composer_deckbench.exe --check

The wrapper pins CPU affinity, raises priority, and fixes clocks where the platform allows it, then records what it actually managed to do into the tool's own JSON output — see .claude/performance-workplan/WP-07-machine-hygiene-scripts.md for why. Running the tool directly (unwrapped) works, but expect a wider noise floor and more [NOISY] / exit-3 results.

4. Read the exit code

CodeMeaningWhat to do
0Every deck within thresholdReport the deltas anyway — they're useful even when nothing regressed
1At least one deck regressedGo to step 5 to attribute it, then decide: real regression, or does the change justify it?
2No baseline for this fingerprint, or a deck's file hash no longer matches the baseline'sDo not compare. Report the check as unverified. --record only ever happens on a known-good tree — see step 6
3Too noisy to concludeInconclusive, not a pass and not a failure. Re-run under the wrapper, or on a quieter machine, or report it as unverified

--check's own table (deck / baseline / current / delta / verdict) prints on every exit code — read it, don't just act on the number.

5. Attribute a regression to an element

build\release\tests\dnf_composer_profiler.exe --deck <the deck that regressed>

Find the deck's path in tests/benchmark/decks.json from the tier name --check printed (small / medium / large-a / large-b). The profiler drives each element's own step() directly — no library instrumentation involved — and prints (and can write as JSON via --json) each element's mean µs and share of the step. Compare against the matching session in tests/profiler/profile.md to see which element's share grew.

Then check the numerics didn't move too. Every deck in decks.json is also a validation fixture with a committed reference CSV (see tests/benchmark/DECKS.md) — run the matching case in dnf_composer_tests (GoldenFieldDynamics* / SpectralGolden2D* depending on which deck). A change that is faster and numerically different is not an optimization; it's a different, unverified algorithm.

6. Updating a baseline

scripts\bench.ps1 build\release\tests\dnf_composer_deckbench.exe --record --force

Only on a tree you already know is correct, and only deliberately — the same rule tests/golden/README.md sets for golden data. State why the number moved in the PR. A baseline quietly re-recorded to turn a red check green is worse than no baseline at all: it launders a real regression into the new normal.

--record refuses on its own if the run is noisy, and refuses to overwrite an existing baseline without --force — both are the tool protecting itself from exactly this failure mode, not obstacles to route around.

What this cannot tell you

This gate catches regressions in the four architectures decks.json covers (1D direct, a 2-term 2D kernel, and the direct/spectral pair straddling kFFTTapThreshold) at the sizes those decks use. It says nothing about an architecture or grid size outside that set. If the change is architecturally novel, note that in the PR rather than treating a clean --check as full coverage.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

autopilot

無料

Orchestrate unattended resolution of open GitHub issues - triage by complexity, dispatch parallel worker agents into isolated worktrees, review their diffs, open PRs, and monitor CI and CodeRabbit until green. Use when asked to work through open issues autonomously or put Claude on auto-pilot.

日本語の概要は準備中です。原文の説明を表示しています。

Jgocunha/dynamic-neural-field-composer172026年10月9日 更新

Configure, build and test dynamic-neural-field-composer. Use whenever you need to compile the library, run the GoogleTest suite, verify a change builds, or reproduce a test failure.

日本語の概要は準備中です。原文の説明を表示しています。

Jgocunha/dynamic-neural-field-composer172026年10月9日 更新

commit

無料

Read the uncommitted diff in dynamic-neural-field-composer and print conventional commit message(s) for it, grouped by logical change. Use when asked to write, suggest or draft a commit message, or "what should I commit this as".

日本語の概要は準備中です。原文の説明を表示しています。

Jgocunha/dynamic-neural-field-composer172026年10月9日 更新

Verify documentation keeps up with a code change in dynamic-neural-field-composer - Doxygen on public API, the matching wiki page, and stale references elsewhere. Use before opening a PR, or when asked whether docs need updating.

日本語の概要は準備中です。原文の説明を表示しています。

Jgocunha/dynamic-neural-field-composer172026年10月9日 更新

pr

無料

Read the branch diff in dynamic-neural-field-composer and print a PR title and description in chat, filling the repo's pull request template. Use when asked to write, draft or suggest a PR title/description, or "what should the PR say".

日本語の概要は準備中です。原文の説明を表示しています。

Jgocunha/dynamic-neural-field-composer172026年10月9日 更新

Review a diff against dynamic-neural-field-composer's own standards - backwards compatibility, Clean Code, tools/ helper reuse, C++20 idiom, hot-path performance, and test coverage. Use before opening a PR or when asked to review a branch or change.

日本語の概要は準備中です。原文の説明を表示しています。

Jgocunha/dynamic-neural-field-composer172026年10月9日 更新

Jgocunha のスキルをすべて見る

このスキルの問題を報告する