Crate metrale_bench

Crate metrale_bench 

Source
Expand description

2026-09-26: Metrale Engine plugins, and the benchmark suite the met serve TUI and met benchmark drive.

Plugin is the general abstraction: Plugin::load receives a PluginHandle (status, log, progress and glow events, the artifact store, the target endpoint and a cancellation flag). Benchmark specialises it into a drivable state machine: the implementor does one step per Benchmark::next, and Benchmark::run streams the BenchmarkResult frames.

impl Stream and async fn in a trait are not dyn-compatible, so DynBenchmark carries the same contract with boxed futures and is blanket-implemented for every Benchmark; executor::drive consumes it.

Owner: bench. Invariants: none beyond the types.

Re-exports§

pub use artifacts::ArtifactStore;
pub use benchmark::Benchmark;
pub use benchmark::BenchmarkDescriptor;
pub use coherence::CoherencePolicy;
pub use dynamic::DynBenchmark;
pub use executor::BenchmarkExecutor;
pub use executor::ExecutorMessage;
pub use executor::RunHandle;
pub use hardware::Hardware;
pub use hardware::HardwareState;
pub use hardware::HardwareStateReport;
pub use hardware::Sensitivity;
pub use history::RunRecord;
pub use history::RunSource;
pub use metadata::PluginMetadata;
pub use params::ParamKind;
pub use params::ParamSpec;
pub use params::ParamValue;
pub use params::ParamValues;
pub use plugin::Plugin;
pub use plugin::PluginEvent;
pub use plugin::PluginHandle;
pub use plugin::TargetEndpoint;
pub use result::Align;
pub use result::BenchmarkResult;
pub use result::Cell;
pub use result::CellStyle;
pub use result::Column;
pub use result::LogLevel;
pub use result::LogLine;
pub use result::ResultTable;
pub use result::RunStatus;
pub use result::Stat;
pub use result::Verdict;
pub use result::VerdictKind;

Modules§

artifacts
2026-09-26: The Metrale Engine home (ArtifactStore): the per-plugin artifact and per-benchmark run directories, plus write-if-changed assets and provisioning stamps.
benchmark
2026-09-26: The Benchmark trait, a Plugin driven one step at a time, and BenchmarkDescriptor, its static identity.
benchmarks
2026-09-26: The benchmark drivers, and the text helpers they share.
coherence
2026-09-26: A known-answer probe of the endpoint, run by the executor before a benchmark loads.
dynamic
2026-09-26: DynBenchmark, the object-safe form of Benchmark.
executor
2026-09-26: drive, the loop that turns a benchmark into a stream of frames, and BenchmarkExecutor, which runs a benchmark’s lifecycle as a task on a given tokio runtime.
gate
2026-09-26: The pull-request gate: benchmark records committed beside the code they measured.
hardware
2026-09-26: The hardware fingerprint: which box a benchmark number was measured on, and the box-class key gate baselines are indexed by.
headless
2026-09-26: Driving a benchmark without a terminal: start it on the executor, drain its messages until it finishes, build the run record and save it with crate::history::save, as the dashboard also does.
history
2026-09-26: Run history: RunRecords written by save and read by load, load_all and find, under the artifact store’s runs/<benchmark> directory. A record built by RunRecord::new carries every parameter, the target, the source and the engine version beside the terminal frame. The headless driver and the TUI both save through save.
http
2026-09-26: A minimal OpenAI-compatible client over raw HTTP/1.1 on tokio::net::TcpStream, with no TLS: one streaming chat call, measured (chat_stream), plus the blocking, GET, gap and failure helpers in the submodules. Chunked transfer-encoding is decoded by the private reader module before SSE lines are split, so a chunk boundary inside a data: line does not lose a token.
metadata
2026-09-26: Plugin provenance: who wrote a plugin, where it came from, where to report it. Returned by crate::Plugin::metadata.
param_text
2026-09-26: Text ↔ ParamValues: the conversions a run record (history.rs) and a --param flag need.
params
2026-09-26: Parameter schema: what a benchmark exposes for editing before it runs.
plugin
2026-09-26: Plugin, the abstraction a crate::Benchmark specialises, with its PluginHandle and the TargetEndpoint it drives.
python
2026-09-26: Subprocess runner, Python preflight and venv provisioning. BFCL provisions its venv with these during load(); run is also used to call other tools.
registry
2026-09-26: The benchmark suite, in the order the Benchmarks pane lists it, and lookup by id.
result
2026-09-26: What a benchmark emits on every next(): the frame the TUI renders.
serve_env
2026-09-26: The METRALE_* environment a gate’s server is measured under.
serve_identity
2026-09-26: What makes one met serve “the same server” as another: the bytes of the binary, the arguments it was started with, and its METRALE_* serve levers.