Rust Performance Verification
Use this skill when the changed owner is latency-sensitive, throughput-sensitive,
allocation-sensitive, parser-heavy, renderer-heavy, async/concurrent, or on a
hot path.
The harness does not run benchmarks itself. It plans an obligation for an
external Agent skill and accepts a receipt or waiver for the current
fingerprint.
If the compact task line already contains skill=rust-verification-performance
or another configured performance skill id, do not reload this file just to
learn the contract. Use the structured JSON task or the project-owned adapter
configuration. This file is fallback guidance for configuration or repair.
Trigger Signals
- The owner profile includes
RustOwnerResponsibility::LatencySensitive.
- The task changes parser loops, render loops, snapshot generation, dependency
graph traversal, module discovery, config planning, async execution, cache
behavior, or allocation-heavy collection logic.
- The user asks about performance, regression, p50/p99/p999, throughput,
allocations, profiling, benchmark stability, or runtime degradation.
- A policy change increases the amount of code or project shape the harness must
scan per run.
Evidence Contract
A RustVerificationTaskKind::Performance receipt must report these evidence
keys for the task fingerprint:
benchmark_command: the exact command that was run.
baseline: the comparison point, such as main branch, previous release, saved
benchmark baseline, or explicit historical measurement.
regression_threshold: the allowed change before the SLA is considered
broken.
latency_or_throughput: the measured latency, throughput, or both.
allocation_profile: allocation count, bytes, allocator profile, or a clear
statement that allocations are not part of this owner's contract.
profile_artifact: path or link to a flamegraph, profiler report, benchmark
report, or other retained artifact.
If one key is not applicable, the receipt still needs a concrete explanation for
that key. Empty prose does not clear the task.
Recommended Rust Tooling
- Prefer the project-owned benchmark command when one exists.
- Use
cargo bench for native benchmark entrypoints.
- Use Criterion when statistical comparison and saved baselines matter.
- Use Divan when the project wants lightweight Rust benchmark functions.
- Use iai-callgrind when deterministic instruction/cache-style evidence is more
useful for CI than wall-clock timing.
- Use flamegraph or another profiler when the task is about the bottleneck,
allocation source, lock contention, or CPU hot path rather than benchmark
score alone.
Agent Workflow
- Identify the owner path and task fingerprint from the verification plan.
- Select the narrowest benchmark/profiling command that exercises that owner.
- Run after unit tests pass unless the contract says otherwise.
- Compare against the declared baseline and threshold.
- Emit a
RustVerificationReceipt::passed(...) only when every required
evidence key is present.
- Use
RustVerificationWaiver only when the task is intentionally out of scope;
include owner, reason, and expiry.
Do not turn this into a Clippy-style optimization lint. The harness only asks
for performance evidence when project structure, responsibility config, or
parser facts say that evidence matters.
1---2name: rust-verification-performance3description: Use when a rust-lang-project-harness task touches latency, throughput, allocation behavior, parser/render loops, or Rust performance verification contracts.4---56# Rust Performance Verification78Use this skill when the changed owner is latency-sensitive, throughput-sensitive,9allocation-sensitive, parser-heavy, renderer-heavy, async/concurrent, or on a10hot path.1112The harness does not run benchmarks itself. It plans an obligation for an13external Agent skill and accepts a receipt or waiver for the current14fingerprint.1516If the compact task line already contains `skill=rust-verification-performance`17or another configured performance skill id, do not reload this file just to18learn the contract. Use the structured JSON task or the project-owned adapter19configuration. This file is fallback guidance for configuration or repair.2021## Trigger Signals2223- The owner profile includes `RustOwnerResponsibility::LatencySensitive`.24- The task changes parser loops, render loops, snapshot generation, dependency25 graph traversal, module discovery, config planning, async execution, cache26 behavior, or allocation-heavy collection logic.27- The user asks about performance, regression, p50/p99/p999, throughput,28 allocations, profiling, benchmark stability, or runtime degradation.29- A policy change increases the amount of code or project shape the harness must30 scan per run.3132## Evidence Contract3334A `RustVerificationTaskKind::Performance` receipt must report these evidence35keys for the task fingerprint:3637- `benchmark_command`: the exact command that was run.38- `baseline`: the comparison point, such as main branch, previous release, saved39 benchmark baseline, or explicit historical measurement.40- `regression_threshold`: the allowed change before the SLA is considered41 broken.42- `latency_or_throughput`: the measured latency, throughput, or both.43- `allocation_profile`: allocation count, bytes, allocator profile, or a clear44 statement that allocations are not part of this owner's contract.45- `profile_artifact`: path or link to a flamegraph, profiler report, benchmark46 report, or other retained artifact.4748If one key is not applicable, the receipt still needs a concrete explanation for49that key. Empty prose does not clear the task.5051## Recommended Rust Tooling5253- Prefer the project-owned benchmark command when one exists.54- Use `cargo bench` for native benchmark entrypoints.55- Use Criterion when statistical comparison and saved baselines matter.56- Use Divan when the project wants lightweight Rust benchmark functions.57- Use iai-callgrind when deterministic instruction/cache-style evidence is more58 useful for CI than wall-clock timing.59- Use flamegraph or another profiler when the task is about the bottleneck,60 allocation source, lock contention, or CPU hot path rather than benchmark61 score alone.6263## Agent Workflow64651. Identify the owner path and task fingerprint from the verification plan.662. Select the narrowest benchmark/profiling command that exercises that owner.673. Run after unit tests pass unless the contract says otherwise.684. Compare against the declared baseline and threshold.695. Emit a `RustVerificationReceipt::passed(...)` only when every required70 evidence key is present.716. Use `RustVerificationWaiver` only when the task is intentionally out of scope;72 include owner, reason, and expiry.7374Do not turn this into a Clippy-style optimization lint. The harness only asks75for performance evidence when project structure, responsibility config, or76parser facts say that evidence matters.