Expand description
Shared types for perfgate.
Design goal: versioned, explicit, boring. These structs are used for receipts, PR comments, and (eventually) long-term baselines.
Part of the perfgate workspace.
§Examples
Round-trip a ToolInfo through JSON:
use perfgate_types::ToolInfo;
let tool = ToolInfo { name: "perfgate".into(), version: "1.0.0".into() };
let json = serde_json::to_string(&tool).unwrap();
let back: ToolInfo = serde_json::from_str(&json).unwrap();
assert_eq!(tool, back);§Feature Flags
arbitrary: EnablesArbitraryderive for structure-aware fuzzing with cargo-fuzz.
Re-exports§
pub use validation::BENCH_NAME_MAX_LEN;pub use validation::BENCH_NAME_PATTERN;pub use validation::ValidationError as BenchNameValidationError;pub use validation::validate_bench_name;pub use error::ConfigValidationError;pub use error::PerfgateError;
Modules§
- baseline_
service - Baseline service wire contracts.
- config
- Configuration file helpers and re-exports.
- error
- Unified error types for the perfgate ecosystem.
- fingerprint
- Deterministic SHA-256 fingerprints for perfgate receipts and findings.
- validation
- Validation functions for benchmark names and configuration.
Structs§
- Aggregate
Input - Aggregate
Receipt - Aggregate
Runner Meta - Aggregate
Verdict - Baseline
Server Config - Configuration for the baseline server connection.
- Bench
Config File - Bench
Meta - Budget
- Budget
Override - Capability
- A capability with its status and optional reason.
- Changed
Files Summary - Compare
Receipt - A versioned receipt comparing baseline vs current (
perfgate.compare.v1). - Compare
Ref - Complexity
Gate Result - Optional complexity-gating result attached to reports.
- Config
File - Top-level configuration file (
perfgate.toml). - Decision
Artifact Index - A manifest for the artifacts produced by
perfgate decision evaluate. - Decision
Bundle Artifact - One artifact embedded in a portable decision bundle.
- Decision
Bundle Metadata - Metadata captured when exporting a portable decision bundle.
- Decision
Bundle Receipt - A portable receipt bundle for structured performance decisions.
- Decision
Policy Config - Policy for automated structured decisions.
- Defaults
Config - Delta
- F64Summary
- Fail
IfNOfM - Finding
Data - Data associated with a metric finding.
- Host
Info - Host
Mismatch Info - Details about a detected host mismatch between baseline and current runs.
- Noise
Diagnostics - Diagnostics about noise in paired benchmark measurements.
- Otel
Span Identifiers - Paired
Bench Meta - Paired
Diff Summary - Paired
RunReceipt - Paired
Sample - Paired
Sample Half - Paired
Stats - Perfgate
Report - A performance report wrapping compare results in a cockpit-compatible envelope.
- Probe
Compare Observation - Comparison evidence for one named probe.
- Probe
Compare Receipt - A versioned receipt for named probe deltas (
perfgate.probe_compare.v1). - Probe
Metric Value - A numeric metric observed for a named probe.
- Probe
Observation - One named probe observation from external instrumentation.
- Probe
Receipt - A versioned receipt for named probe observations (
perfgate.probe.v1). - Ratchet
Change - Per-metric ratchet change.
- Ratchet
Config - Configuration for conservative automated budget ratcheting.
- Ratchet
Receipt - Machine-readable ratchet artifact.
- Repair
Context Receipt - A machine-readable failure package for automated triage.
- Repair
GitMetadata - Repair
Metric Breach - Report
Finding - A single finding from the performance check.
- Report
Summary - Summary counts and key metrics for the report.
- RunMeta
- RunReceipt
- A versioned receipt from a single benchmark run (
perfgate.run.v1). - Sample
- Scaling
Config - Configuration for computational complexity validation.
- Scenario
Component - A scenario component such as one benchmark, phase, or probe group.
- Scenario
Config File - Weighted scenario definition for workload-level evaluation.
- Scenario
Meta - Scenario definition captured in a scenario evaluation receipt.
- Scenario
Receipt - A versioned receipt for weighted workload scenarios (
perfgate.scenario.v1). - Sensor
Artifact - An artifact produced by the sensor.
- Sensor
Capabilities - Capabilities available to the sensor.
- Sensor
Finding - A finding from the sensor.
- Sensor
Report - The sensor.report.v1 envelope for cockpit integration.
- Sensor
RunMeta - Run metadata for the sensor report.
- Sensor
Verdict - Verdict for the sensor report.
- Sensor
Verdict Counts - Verdict counts for the sensor report.
- Significance
- Significance
Policy - Policy for statistical significance testing.
- Stats
- Aggregated statistics for a benchmark run.
- Tool
Info - Tradeoff
Allowance - A local regression allowance used by a tradeoff rule.
- Tradeoff
Allowance Outcome - Evaluation result for one local regression allowance.
- Tradeoff
Decision - Final structured tradeoff decision.
- Tradeoff
Probe Outcome - Probe-level tradeoff evidence.
- Tradeoff
Receipt - A versioned receipt explaining accepted or rejected tradeoffs (
perfgate.tradeoff.v1). - Tradeoff
Requirement - A required improvement used by a tradeoff rule.
- Tradeoff
Requirement Outcome - Evaluation result for one tradeoff requirement.
- Tradeoff
Rule - A structured tradeoff rule for explicit, auditable budget downgrades.
- Tradeoff
Rule Outcome - Evaluation result for one named tradeoff rule.
- U64Summary
- Verdict
- Overall verdict for a comparison, with pass/warn/fail counts.
- Verdict
Counts
Enums§
- Aggregate
Weight Mode - Weighting mode for runner-aware aggregate verdicts.
- Aggregation
Policy - Fleet-level aggregation policy for matrix CI gating.
- Capability
Status - Capability status for “No Green By Omission” principle.
- Complexity
Gate Status - Complexity gate status produced by scaling validation.
- Decision
Bundle Artifact Content - Embedded artifact content.
- Decision
Bundle Artifact Kind - Kind of artifact embedded in a portable decision bundle.
- Direction
- Host
Mismatch Policy - Policy for handling host mismatches when comparing receipts from different machines.
- Metric
- Metric
Statistic - Metric
Status - Missing
Noise Policy - How to handle missing noise evidence when low-noise tradeoff acceptance is required.
- Noise
Level - Noise level classification for paired benchmark results.
- Noise
Policy - Probe
Scope - Scope of a named performance probe inside a workload.
- Ratchet
Mode - How ratcheting should update budgets.
- Read
Json Error - Error returned by
read_json_file. - Sensor
Severity - Severity level for sensor findings (cockpit vocabulary).
- Sensor
Verdict Status - Verdict status for the sensor report.
- Severity
- Severity level for a finding.
- Significance
Test - Tradeoff
Decision Status - Outcome of a tradeoff policy decision.
- Tradeoff
Downgrade - Target status when a tradeoff rule is satisfied.
- Verdict
Status
Constants§
- AGGREGATE_
SCHEMA_ V1 - BASELINE_
REASON_ NO_ BASELINE - BASELINE_
SCHEMA_ V1 - CHECK_
ID_ BASELINE - CHECK_
ID_ BUDGET - CHECK_
ID_ COMPLEXITY - CHECK_
ID_ HOST - CHECK_
ID_ TOOL_ RUNTIME - CHECK_
ID_ TOOL_ TRUNCATION - COMPARE_
SCHEMA_ V1 - CONFIG_
SCHEMA_ V1 - DECISION_
BUNDLE_ SCHEMA_ V1 - DECISION_
INDEX_ SCHEMA_ V1 - ERROR_
KIND_ EXEC - ERROR_
KIND_ IO - ERROR_
KIND_ PARSE - FINDING_
CODE_ BASELINE_ MISSING - FINDING_
CODE_ COMPLEXITY_ FAIL - FINDING_
CODE_ COMPLEXITY_ INCONCLUSIVE - FINDING_
CODE_ HOST_ MISMATCH - FINDING_
CODE_ METRIC_ FAIL - FINDING_
CODE_ METRIC_ WARN - FINDING_
CODE_ RUNTIME_ ERROR - FINDING_
CODE_ TRUNCATED - MAX_
FINDINGS_ DEFAULT - PAIRED_
SCHEMA_ V1 - PROBE_
COMPARE_ SCHEMA_ V1 - PROBE_
SCHEMA_ V1 - RATCHET_
SCHEMA_ V1 - REPAIR_
CONTEXT_ SCHEMA_ V1 - REPORT_
SCHEMA_ V1 - RUN_
SCHEMA_ V1 - SCENARIO_
SCHEMA_ V1 - SENSOR_
REPORT_ SCHEMA_ V1 - STAGE_
BASELINE_ RESOLVE - STAGE_
CONFIG_ PARSE - STAGE_
RUN_ COMMAND - STAGE_
WRITE_ ARTIFACTS - TRADEOFF_
SCHEMA_ V1 - VERDICT_
REASON_ COMPLEXITY_ EXPECTED_ EXCEEDED - VERDICT_
REASON_ COMPLEXITY_ FIT_ LOW_ CONFIDENCE - VERDICT_
REASON_ COMPLEXITY_ MEASUREMENT_ INCOMPLETE - VERDICT_
REASON_ HOST_ MISMATCH - VERDICT_
REASON_ NO_ BASELINE - VERDICT_
REASON_ TOOL_ ERROR - VERDICT_
REASON_ TRADEOFF_ MISSING_ REQUIRED_ METRIC - VERDICT_
REASON_ TRADEOFF_ REVIEW_ REQUIRED - VERDICT_
REASON_ TRADEOFF_ RULE_ NOT_ SATISFIED - VERDICT_
REASON_ TRUNCATED
Functions§
- read_
json_ file - Reads a JSON file from disk and deserializes it into
T.