testperformance

package
v0.43.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package testperformance owns qualification records for verification-performance evidence.

Index

Constants

View Source
const Version = 2

Version is the supported qualification-record schema version.

Variables

This section is empty.

Functions

func HasComponentRegressions

func HasComponentRegressions(report Report) bool

HasComponentRegressions reports whether deterministic qualification failed.

func MatchEnvironment

func MatchEnvironment(reference, candidate Environment) error

MatchEnvironment refuses comparison unless every identity field matches.

func Validate

func Validate(r Record) error

Validate checks the complete qualification contract without comparing unlike environments.

func WriteHuman

func WriteHuman(w io.Writer, report Report)

WriteHuman renders a report without changing its source record.

Types

type Aggregate

type Aggregate struct {
	Workload    string      `json:"workload"`
	Environment string      `json:"environment"`
	Cache       string      `json:"cache"`
	Samples     int         `json:"samples"`
	Seconds     float64     `json:"seconds"`
	Components  []Component `json:"components"`
}

Aggregate summarizes same-workload, same-environment observations.

func Aggregates

func Aggregates(r Record) []Aggregate

Aggregates produces stable median timing evidence while retaining every component identity.

type Baseline

type Baseline struct {
	Workload    string      `json:"workload"`
	Environment string      `json:"environment"`
	Seconds     float64     `json:"seconds"`
	Components  []Component `json:"components"`
}

Baseline records landed evidence for one like-for-like workload.

type Budget

type Budget struct {
	Workload              string      `json:"workload"`
	Environment           string      `json:"environment"`
	Qualification         string      `json:"qualification"`
	MaximumSeconds        float64     `json:"maximum_seconds"`
	StrongerTargetSeconds float64     `json:"stronger_target_seconds"`
	ComponentMaximums     []Component `json:"component_maximums"`
}

Budget records threshold and component targets for one workload.

type Component

type Component struct {
	Stage   string  `json:"stage"`
	Package string  `json:"package"`
	Test    string  `json:"test"`
	Seconds float64 `json:"seconds"`
}

Component keeps the stage, package, and test timing identity intact.

type Delta

type Delta struct {
	Workload        string  `json:"workload"`
	Environment     string  `json:"environment"`
	Cache           string  `json:"cache"`
	Sample          int     `json:"sample"`
	EvidenceClass   string  `json:"evidence_class"`
	Result          string  `json:"result"`
	Component       string  `json:"component,omitempty"`
	BaselineSeconds float64 `json:"baseline_seconds"`
	ObservedSeconds float64 `json:"observed_seconds"`
	DeltaSeconds    float64 `json:"delta_seconds"`
	DeltaPercent    float64 `json:"delta_percent"`
}

Delta reports like-for-like achieved evidence without turning it into a budget claim.

func Deltas

func Deltas(r Record) []Delta

Deltas compares only exact workload, environment, and component identities. Diagnostic and widened evidence remains visibly classified and never enters qualification aggregates.

type Environment

type Environment struct {
	ID           string `json:"id"`
	Kind         string `json:"kind"`
	CPU          string `json:"cpu"`
	OS           string `json:"os"`
	Architecture string `json:"architecture"`
	Filesystem   string `json:"filesystem"`
	Memory       string `json:"memory"`
	RunnerImage  string `json:"runner_image"`
	Toolchain    string `json:"toolchain"`
}

Environment identifies one local or hosted measurement machine completely.

type Evaluation

type Evaluation struct {
	Workload             string   `json:"workload"`
	Environment          string   `json:"environment"`
	WallTime             string   `json:"wall_time"`
	MaximumSeconds       float64  `json:"maximum_seconds"`
	ObservedSeconds      float64  `json:"observed_seconds"`
	MeetsMaximum         bool     `json:"meets_maximum"`
	ComponentRegressions []string `json:"component_regressions,omitempty"`
}

Evaluation classifies aggregate evidence against a declared budget.

func Evaluate

func Evaluate(r Record, aggregates []Aggregate) []Evaluation

Evaluate deterministically classifies timing evidence and component budget regressions.

type Observation

type Observation struct {
	Workload      string      `json:"workload"`
	Environment   Environment `json:"environment"`
	Cache         string      `json:"cache"`
	Sample        int         `json:"sample"`
	EvidenceClass string      `json:"evidence_class"`
	Result        string      `json:"result"`
	Seconds       float64     `json:"seconds"`
	Components    []Component `json:"components"`
}

Observation records one measured sample and its component evidence.

type Record

type Record struct {
	Version      int           `json:"version"`
	Workloads    []Workload    `json:"workloads"`
	Environments []Environment `json:"environments"`
	SampleMethod SampleMethod  `json:"sample_method"`
	Baselines    []Baseline    `json:"baselines"`
	Budgets      []Budget      `json:"budgets"`
	Observations []Observation `json:"observations"`
}

Record is the versioned, canonical qualification evidence for test performance.

func Load

func Load(path string) (Record, error)

Load reads and strictly validates one qualification record.

func Parse

func Parse(data []byte) (Record, error)

Parse strictly decodes and validates canonical-record data.

type Report

type Report struct {
	RecordVersion int           `json:"record_version"`
	Workloads     []Workload    `json:"workloads"`
	Environments  []Environment `json:"environments"`
	SampleMethod  SampleMethod  `json:"sample_method"`
	Baselines     []Baseline    `json:"baselines"`
	Budgets       []Budget      `json:"budgets"`
	Observations  []Observation `json:"observations"`
	Aggregates    []Aggregate   `json:"aggregates"`
	Deltas        []Delta       `json:"deltas"`
	Evaluations   []Evaluation  `json:"evaluations"`
}

Report is the shared input for human and machine renderings.

func BuildReport

func BuildReport(r Record) Report

BuildReport creates human and machine output from one observation set.

type SampleMethod

type SampleMethod struct {
	CachePreparation []string `json:"cache_preparation"`
	WarmSamples      int      `json:"warm_samples"`
	ColdSamples      int      `json:"cold_samples"`
	Aggregation      string   `json:"aggregation"`
	WallTime         string   `json:"wall_time"`
}

SampleMethod describes reproducible cache and sampling treatment.

type Workload

type Workload struct {
	ID          string `json:"id"`
	Kind        string `json:"kind"`
	Mutation    string `json:"mutation"`
	Description string `json:"description"`
}

Workload identifies one independently qualified verification workload.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL