pub use super::declaration::{
BENCH_ROW_KEY_TAG, BenchMeasurement, BenchReferences, BenchRow, BenchRowKey, BenchRowRefusal,
BenchTableName, ComplexityClaimRef, ContentionPosture, DeclaredBudgets, DeclaredBudgetsRefusal,
ExactRatio, InputSizeAxis, InputSizeAxisRefusal, PlantedWorseRef, PreflightRef, WorkFormula,
WorkFormulaRefusal, WorkObservationRef, WorkloadRef,
};
pub use super::work::{
BenchAttachment, BenchAttachmentRefusal, BenchCall, SecondaryObservation,
SecondaryObservationRefusal, WorkConclusion, WorkCount, WorkCurve, WorkCurvePoint,
WorkGapStanding, WorkJudge, WorkJudgeBinding, WorkJudgment, WorkJudgmentInput,
WorkQualificationRefusal, WorkRecorder, WorkRecordingRefusal,
};
#[path = "type_guard.rs"]
mod guard;
use crate::clock::HarnessClock;
use crate::descriptor::{NameRefusal, Provenance, TrialTableRefusal};
use crate::report::{TargetBinding, TargetTriple, ToolchainIdentity, TrialReport};
use crate::runner::{Invocation, TrialBinding};
#[derive(Clone)]
pub struct PreflightTrial {
reference: PreflightRef,
binding: TrialBinding,
invocation: Invocation,
}
#[derive(Clone)]
pub struct BenchBinding {
row: BenchRow,
attachment: BenchAttachment,
preflight: PreflightTrial,
}
#[must_use = "a refusal is the reason a benchmark binding was not built"]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum BenchBindingRefusal {
Workload {
row: WorkloadRef,
attachment: WorkloadRef,
},
PlantedWorse {
row: PlantedWorseRef,
attachment: PlantedWorseRef,
},
Preflight {
row: PreflightRef,
trial: PreflightRef,
},
Complexity {
row: ComplexityClaimRef,
judge: ComplexityClaimRef,
},
}
#[derive(Clone)]
pub struct BenchTable {
name: BenchTableName,
provenance: Provenance,
bindings: Vec<BenchBinding>,
}
#[must_use = "a refusal is the reason a benchmark table was not built"]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum BenchTableRefusal {
Empty,
DuplicateRow {
row: BenchRowKey,
first: usize,
duplicate: usize,
},
}
#[must_use = "a refusal is the reason a stamped benchmark table was not built"]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum BenchStampRefusal {
Name(NameRefusal),
InputSizeAxis(InputSizeAxisRefusal),
Budgets(DeclaredBudgetsRefusal),
WorkFormula(WorkFormulaRefusal),
Row(BenchRowRefusal),
Attachment(BenchAttachmentRefusal),
Binding(BenchBindingRefusal),
Preflight(TrialTableRefusal),
Table(BenchTableRefusal),
}
#[derive(Debug, Clone)]
pub struct BenchInvocation {
target: TargetBinding,
clock: HarnessClock,
contention: ContentionPosture,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum BenchTargetMismatch {
Target {
benchmark: TargetTriple,
preflight: TargetTriple,
},
Toolchain {
benchmark: ToolchainIdentity,
preflight: ToolchainIdentity,
},
}
#[must_use = "a refusal is the reason no benchmark report was produced"]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum BenchRunRefusal {
PreflightTargetMismatch {
row: BenchRowKey,
mismatch: BenchTargetMismatch,
},
WorkNotRecorded {
row: BenchRowKey,
phase: PrimaryWorkPhase,
refusal: WorkRecordingRefusal,
},
SecondaryWorkRefused {
row: BenchRowKey,
refusal: SecondaryObservationRefusal,
},
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum PrimaryWorkPhase {
Measured,
PlantedWorse,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum BenchOutcome {
PreflightRefused,
PlantedWorseNotDistinguished {
measured: WorkCurve,
planted_worse: WorkCurve,
judgment: WorkJudgment,
},
PrimaryWorkRefused {
measured: WorkCurve,
planted_worse: WorkCurve,
judgment: WorkJudgment,
},
#[non_exhaustive]
Qualified {
measured: WorkCurve,
planted_worse: WorkCurve,
judgment: WorkJudgment,
secondary: SecondaryObservation,
},
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum BenchStage {
PreflightRefused,
PlantedWorseNotDistinguished,
PrimaryWorkRefused,
Qualified,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct BenchReading {
row: BenchRow,
target: TargetBinding,
preflight: TrialReport,
outcome: BenchOutcome,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct BenchReport {
table: BenchTableName,
provenance: Provenance,
readings: Vec<BenchReading>,
}
#[must_use = "a refusal names the first benchmark row that did not qualify"]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct BenchVerdictRefusal {
row: BenchRowKey,
stage: BenchStage,
}