Module record

Module record 

Source
Expand description

2026-09-26: The committed shape of one gate run, the baseline shapes it is judged against, and reading both.

Owner: bench gate (records). Invariants:

  • GateRecord::from_run never builds a record with an empty git_sha or from a Running frame.

Structs§

Bound
2026-09-26: One metric’s threshold: min alone is a floor, max alone a ceiling, both a range, and equal values an exact pin (scoring::compare).
GateBaseline
2026-09-26: The thresholds a benchmark’s gate records must meet, assembled by super::bench from the measured entries in every kernels/<hw>/<model>/BENCH.toml. Keyed hardware, then model, and check_record scores a record only against its own pair. The records themselves live under .benchmarks/<id>/.
GateRecord
2026-09-26: One run record, as committed under .benchmarks/<id>/.
HardwareBaseline
2026-09-26: Every measured model on one box class, and which one to serve by default.
ModelBaseline
2026-09-26: One (hardware, model) pair’s thresholds, and the recipe that serves the model.

Functions§

date_of
2026-09-26: YYYY-MM-DD (UTC) from unix seconds.
merge_serve_overrides
2026-09-26: Baseline pins first; the operator’s --serve-override wins on a clash.
now_secs
2026-09-26: Unix seconds now; 0 when the clock reads before the epoch.
read_baseline
2026-09-26: The benchmark’s baseline, assembled from the BENCH.toml files.
read_record
2026-09-26: Read and parse one record file.
record_path
2026-09-26: .benchmarks/<id>/YYYY-MM-DD-<sha>.json under root.
record_path_for
2026-09-26: Where record is written: <date>-<sha><shard>.json for its hardware’s default model, or when no baseline with hardware entries resolves; otherwise <date>-<sha>-<variant slug><shard>.json. A record whose hardware has no entry counts as default when it is any hardware’s default.
resolve_perf_env
2026-09-26: Resolve PERF_CONTROLS through lookup, substituting each default for an unset, empty or whitespace-only value. Takes lookup so tests need not set process environment variables.
variant_slug
2026-09-26: A file-name-safe slug of a checkpoint id: ASCII alphanumerics and . kept and lowercased, each run of other characters one -, edge - trimmed. Two ids can share a slug.
write_record
2026-09-26: Write one gate record and return its path. Creates the parent directory; commits nothing. The path is record_path_for unless that file holds a FAIL, in which case it is the re-run name. Errors when the re-run name holds a FAIL too, or when either file exists but is not a readable record.