k4bench.regression.report_builder¶
k4bench.regression.report_builder ¶
Assemble the nightly regression report from the EOS run history.
Walks every (detector, platform, sample) triple found under the WebEOS
data URL (the same hierarchy the dashboard's sidebar cascades through — these
triples have independent baselines and are never pooled), pulls a trailing
window of runs into the local cache, rebuilds the trend frames with
:mod:k4bench.analysis.trend, attaches per-run reliability verdicts with
:mod:k4bench.results.reliability_evidence, and runs the step detector in
:mod:k4bench.regression.engine over every metric series.
workload_map ¶
{run_id: random_seed} for every run that recorded one.
A run absent from this map has an unknown workload (see
:data:~k4bench.regression.engine.WORKLOAD_UNKNOWN) — it drew a fresh
event mix, or predates the seed being recorded. The engine re-anchors its
baseline when this value changes, so the map only has to say what was
recorded, never why.
Source code in k4bench/regression/report_builder.py
unjudged_value_verdicts ¶
unjudged_value_verdicts(*, detector: str, platform: str, sample: str, results_df: DataFrame | None, event_df: DataFrame | None, tonight: str, already: set[tuple[str, str]]) -> list[MetricVerdict]
Raw metric values for tonight's run as unjudged UNKNOWN verdicts.
Two different things end up here. The engine skips unreliable runs (they
must not pollute baselines or flags), so their metrics get no verdict and
their values would never reach the report the dashboard's Overview tab
reads — leaving that tab unable to plot them even with "Exclude unreliable
runs" off. And :data:REPORTED_ONLY_METRICS are never judged on any night
by design, but are still worth being able to look up.
Either way this records tonight's raw value for every (label, metric)
not already judged, marked UNKNOWN (never a flag), so the value is
preserved for display. A normally-judged run is already covered.
Source code in k4bench/regression/report_builder.py
evaluate_group_series ¶
evaluate_group_series(*, detector: str, platform: str, sample: str, results_df: DataFrame | None, event_df: DataFrame | None, reliability: dict[str, bool | None], hosts: dict[str, HostFact] | None = None) -> dict[SeriesId, list[MetricVerdict]]
Run the step detector over every run/event metric series of one run group. Region timings are not walked.
Returns the full verdict series per :class:SeriesId — the nightly
report takes each series' verdict for the report night, while the
dashboard drill-down and the retrospective threshold validation consume
the whole walk.
hosts (from :func:~k4bench.regression.history.host_facts) names the
machine behind each run, and only reaches the history tails attached to
confirmed verdicts; it never enters the judgement itself. Omitted, the tails
simply carry no host.
Where a run group has enough configurations to support it, each metric is
first decomposed into a group-wide common mode and per-config residuals
(:mod:k4bench.regression.common_mode). Both halves are walked: the shift
as one group-level series under
:data:~k4bench.regression.common_mode.COMMON_MODE_LABEL, and each config
on what is left after it. A night where the whole group moved together
therefore produces one finding instead of one per config, without the move
going unjudged.
Source code in k4bench/regression/report_builder.py
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 | |
build_group_report ¶
build_group_report(data_url: str, cache_dir: str | None, detector: str, platform: str, sample: str, *, fetch_window_runs: int = FETCH_WINDOW_RUNS, as_of: str | None = None) -> RunGroupReport | None
Build one triple's report from its trailing run window, or None
when the triple has no fetchable runs at all.
as_of (a YYYY-MM-DD night) truncates the run history to runs on or
before that night before the trailing window is taken, reproducing the
report that night's runs would have produced — the seam the historical
backfill drives. None judges the full history (the nightly CI case).
Source code in k4bench/regression/report_builder.py
group_report_from_run_dirs ¶
group_report_from_run_dirs(detector: str, platform: str, sample: str, run_dirs: tuple[str, ...]) -> RunGroupReport | None
Build one triple's report from already-local run directories (ordered oldest → newest; each directory's name is its nightly date).
Source code in k4bench/regression/report_builder.py
build_nightly_report ¶
build_nightly_report(data_url: str, cache_dir: str | None = None, *, fetch_window_runs: int = FETCH_WINDOW_RUNS, as_of: str | None = None) -> NightlyReport
Build the cross-detector report for the most recent nightly.
The report night is the newest run date seen across all triples. A triple
dated earlier is still reported normally when its CI run says it came from
the report night's own batch, whatever the gap between the two dates (see
:func:_same_batch); for a night whose runs carry no CI run at all, a lag
of up to :data:SAME_BATCH_LAG_DAYS stands in for that. Anything else gets
a missing run job failure (a hard crash uploads nothing, so absence is
itself the failure signal) — unless it is stale by more than
:data:MISSING_RUN_GRACE_DAYS, in which case it is treated as retired and
dropped.
as_of truncates every triple's history to runs on or before that night
(see :func:build_group_report), making the report night the newest run
≤ as_of — the historical-backfill seam.
Source code in k4bench/regression/report_builder.py
build_nightly_report_local ¶
build_nightly_report_local(data_dir: str, *, fetch_window_runs: int = FETCH_WINDOW_RUNS, as_of: str | None = None) -> NightlyReport
Like :func:build_nightly_report, but over a local directory tree with
the same {detector}/{platform}/{stack}/{sample}/{date} layout as EOS
(used by the integration test and for offline dry-runs; no network).
as_of truncates each sample's runs the same way.