bench

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package bench defines the required floor measurement evidence and its gate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUFactor

type CPUFactor struct {
	Factor            float64 `json:"factor"`
	CalibrationCommit *string `json:"calibration_commit"`
	CalibrationDate   *string `json:"calibration_date"`
}

type Derating

type Derating struct {
	Schema         string               `json:"schema"`
	PolicyDate     string               `json:"policy_date"`
	Authority      string               `json:"authority"`
	MemoryFactor   float64              `json:"memory_factor"`
	CPU            map[string]CPUFactor `json:"cpu"`
	Interpretation string               `json:"interpretation"`
}

type Evidence

type Evidence struct {
	Schema            string             `json:"schema"`
	Status            string             `json:"status"`
	StartedAt         time.Time          `json:"started_at"`
	Architecture      string             `json:"architecture"`
	OS                string             `json:"os"`
	CPU               int                `json:"cpu"`
	MemoryLimit       int64              `json:"memory_limit_bytes"`
	Swap              int64              `json:"swap_bytes"`
	MemoryPeak        int64              `json:"memory_peak_bytes"`
	OOMEvents         int                `json:"oom_events"`
	OOMKills          int                `json:"oom_kills"`
	PhysicalPi        bool               `json:"physical_pi"`
	Raw               bool               `json:"raw"`
	Provenance        Provenance         `json:"provenance"`
	BootMS            float64            `json:"boot_ms"`
	IdleRSS           int64              `json:"idle_rss_bytes"`
	IdleSampleSeconds int                `json:"idle_sample_seconds"`
	ArgonMS           float64            `json:"argon2_four_ms"`
	AdmissionMiB      int                `json:"admission_mib"`
	ArgonMemoryKiB    uint32             `json:"argon_memory_kib"`
	ArgonTime         uint32             `json:"argon_time"`
	ArgonParallelism  uint8              `json:"argon_parallelism"`
	ArgonConcurrent   int                `json:"argon_concurrent"`
	ArgonCompleted    int                `json:"argon_completed"`
	Publish           Publish            `json:"publish"`
	Reencrypt         Reencrypt          `json:"reencrypt"`
	Scanner           scanbench.Result   `json:"scanner"`
	ScannerRun        ScannerRun         `json:"scanner_run"`
	Operator          Operator           `json:"operator"`
	Derating          Derating           `json:"derating"`
	Estimates         map[string]float64 `json:"cpu_estimates_ms"`
	Interpretation    string             `json:"interpretation"`
}

func (*Evidence) Validate

func (e *Evidence) Validate() error

Validate checks measurements, provenance and declared bounds. There is no passing path for an absent metric, a raw calibration run or stale operator evidence. CPU estimates with no declared latency bound remain informational.

type Operator

type Operator struct {
	Schema           string `json:"schema"`
	SourceCommit     string `json:"source_commit"`
	SourceDiffSHA256 string `json:"source_diff_sha256"`
	BinarySHA256     string `json:"operator_binary_sha256"`
	Architecture     string `json:"architecture"`
	OuterCPU         int    `json:"outer_cpu"`
	OuterMemory      int64  `json:"outer_memory_bytes"`
	CPU              int    `json:"operator_cpu_millicores"`
	MemoryLimit      int64  `json:"operator_memory_limit_bytes"`
	MemoryPeak       int64  `json:"operator_memory_peak_bytes"`
	RSSPeak          int64  `json:"operator_rss_peak_bytes"`
	RSSMeasurement   struct {
		Process struct {
			PID          uint64 `json:"node_pid"`
			StartTime    uint64 `json:"start_time_ticks"`
			ContainerID  string `json:"container_id"`
			BinarySHA256 string `json:"executable_sha256"`
			RSS          int64  `json:"rss_bytes"`
			PeakRSS      int64  `json:"rss_peak_bytes"`
		} `json:"process"`
	} `json:"rss_measurement"`
	Swap   int64 `json:"swap_bytes"`
	Passed bool  `json:"passed"`
}

type Provenance

type Provenance struct {
	SourceCommit     string            `json:"source_commit"`
	SourceDirty      bool              `json:"source_dirty"`
	SourceDiffSHA256 string            `json:"source_diff_sha256"`
	RunURL           string            `json:"run_url"`
	BinarySHA256     map[string]string `json:"binary_sha256"`
	Image            string            `json:"image"`
}

type Publish

type Publish struct {
	ElapsedMS        float64   `json:"elapsed_ms"`
	SamplesMS        []float64 `json:"samples_ms"`
	Cells            int       `json:"cells"`
	Environments     int       `json:"environments"`
	Keys             int       `json:"keys"`
	Operation        string    `json:"operation"`
	ReadbackVerified bool      `json:"readback_verified"`
}

type Reencrypt

type Reencrypt struct {
	ElapsedMS            float64 `json:"elapsed_ms"`
	ValueRows            int     `json:"value_rows"`
	RowsMoved            int     `json:"rows_moved"`
	ChunkRows            int     `json:"chunk_rows"`
	CommittedProgression []int   `json:"committed_progression"`
	MinimumIntervalMS    float64 `json:"minimum_interchunk_interval_ms"`
	ConfiguredPauseMS    int     `json:"configured_pause_ms"`
	ReadbackVerified     bool    `json:"readback_verified"`
}

type ScannerRun

type ScannerRun struct {
	Image      string   `json:"image"`
	Entrypoint []string `json:"entrypoint"`
	Status     string   `json:"status"`
	ExitCode   int      `json:"exit_code"`
	OOMKilled  bool     `json:"oom_killed"`
	NanoCPUs   int64    `json:"nano_cpus"`
	Memory     int64    `json:"memory"`
	MemorySwap int64    `json:"memory_swap"`
}

ScannerRun binds the scanner's direct process launch to the same image and floor limits. A separate launch avoids inherited pre-exec RSS from the KDF parent's large address space contaminating Getrusage's high-water mark.

Jump to

Keyboard shortcuts

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