k4bench.results.reliability_evidence¶
k4bench.results.reliability_evidence ¶
Build reliability evidence from benchmark data and evaluate run verdicts.
Bridges the raw per-run artifacts (machine_info.json, per-config results
DataFrames) to the dependency-free evaluator in
:mod:k4bench.results.reliability. Kept separate from that module on purpose:
these helpers need pandas, while reliability.py is intentionally
dependency-free. Shared by the dashboard (dashboard/tabs/_reliability.py)
and the nightly regression report, so it must not import Streamlit.
ctx_switch_baseline ¶
ctx_switch_baseline(trend_results_df: DataFrame | None, platform: str | None = None) -> float | None
Median involuntary context switches per CPU-second across prior runs.
Computed from the historical per-config results so the threshold adapts to
the host's normal scheduler behaviour. Normalising by total CPU time makes it
robust to run length and core count. When platform is given the pool is
restricted to runs on that platform, since context-switch rates are
host-specific. Returns None (criterion stays advisory) when too few
samples exist to form a stable baseline.
A median is used deliberately: it is unaffected by the occasional contaminated run in the window, so a few noisy runs cannot inflate the baseline and mask real interference.
Source code in k4bench/results/reliability_evidence.py
reliability_evidence ¶
reliability_evidence(machine_info: dict, results: DataFrame | None, ctx_switch_baseline_per_cpu_s: float | None = None) -> dict
Collect the inputs :func:evaluate_reliability needs from this run.
Per-config metrics (CPU efficiency, context switches, total CPU) are averaged
across the run's configs; machine-condition signals come straight from
machine_info. Missing values are left as None so the evaluator treats
them as unknown rather than failing on them. ctx_switch_baseline_per_cpu_s
is the historical baseline from :func:ctx_switch_baseline, or None to
keep the context-switch criterion advisory.
Source code in k4bench/results/reliability_evidence.py
reliability_verdict ¶
reliability_verdict(machine_info: dict, results: DataFrame | None, ctx_switch_baseline_per_cpu_s: float | None = None) -> ReliabilityVerdict
Build the conservative pass/fail verdict for the selected run.
Source code in k4bench/results/reliability_evidence.py
run_reliability_map ¶
run_reliability_map(trend_results_df: DataFrame | None, trend_machine_df: DataFrame | None) -> dict[str, bool | None]
Compute the conservative reliability verdict for every run in the trends.
Reliability is a per-run property: one machine_info.json describes the
host condition for the whole run, so the same verdict applies to all of that
run's configs. This joins the per-run machine conditions in
trend_machine_df with the per-config metrics in trend_results_df (on
run_id) and returns {run_id: reliable}, where reliable is the
:attr:ReliabilityVerdict.reliable tri-state (True/False/None).
The context-switch baseline is left unset here (advisory only, so it never changes the pass/fail verdict), keeping this independent of run history.