diff --git a/.github/workflows/dashboard-preview.yml b/.github/workflows/dashboard-preview.yml
new file mode 100644
index 0000000..8b1dea0
--- /dev/null
+++ b/.github/workflows/dashboard-preview.yml
@@ -0,0 +1,270 @@
+name: Dashboard preview
+
+# PR-only preview of the benchmark dashboard, published as a GitHub Actions
+# artifact. Reviewers can inspect the dashboard generated from the pull
+# request's own code and the real stored results WITHOUT touching the
+# production Pages site.
+#
+# Why this exists: Pages (.github/workflows/pages.yml) runs only on manual
+# dispatch and pushes to main, so an open PR has no published dashboard to
+# look at. This workflow builds the same dashboard and hands it out as a
+# downloadable artifact instead of deploying anything.
+#
+# Safety properties (enforced by benchmark/test_dashboard_preview.py):
+# * `pull_request` only -- never `pull_request_target`, so PR code never
+# runs with a privileged token; no repository secret is referenced;
+# * permissions are limited to `contents: read` (no pages:, no id-token,
+# no write scope of any kind);
+# * the `benchmark-results` data branch is checked out read-only into a
+# separate path; nothing is committed, pushed or written back to it;
+# * nothing is uploaded to Pages and no Pages artifact or deployment is
+# produced, so a PR cannot change the live site;
+# * both checkouts use persist-credentials: false, so the token is not left
+# in the worktree for generated code to find.
+#
+# The assembly step below is copied VERBATIM from .github/workflows/pages.yml
+# ("Assemble combined results tree"), so the preview and the production site
+# read the same results: the union of main's historical runs and the data
+# branch's generated runs, byte-identical duplicates collapsed, conflicting
+# duplicates fatal. A drift test fails if either copy is edited alone.
+#
+# Path filters keep unrelated PRs from spending CI minutes: previews are built
+# only when the dashboard generator, its report renderer, the pinned results,
+# the landing-page generator or this workflow change.
+
+on:
+ pull_request:
+ branches: [main]
+ types: [opened, synchronize, reopened, ready_for_review]
+ paths:
+ - "benchmark/dashboard_generate.py"
+ - "benchmark/report/**"
+ - "benchmark/results/**"
+ - "benchmark/pages_generate.py"
+ - "benchmark/dashboard_preview_readme.md"
+ - "benchmark/test_dashboard_preview.py"
+ - ".github/workflows/dashboard-preview.yml"
+
+# Read-only: this workflow never writes to the repository, to Pages or to the
+# data branch.
+permissions:
+ contents: read
+
+concurrency:
+ group: dashboard-preview-${{ github.event.pull_request.number }}
+ cancel-in-progress: true
+
+jobs:
+ preview:
+ name: Build dashboard preview
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+
+ steps:
+ # The PR's own code (the merge commit of base + head), so the preview
+ # shows the generator exactly as this pull request would ship it.
+ - name: Checkout pull request code
+ uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ # Separate, read-only checkout of the generated results.
+ # continue-on-error turns a missing/renamed data branch into the explicit
+ # failure message below instead of an opaque checkout error (the same
+ # contract the Pages workflow uses).
+ - name: Checkout generated results (benchmark-results)
+ id: data
+ continue-on-error: true
+ uses: actions/checkout@v6
+ with:
+ ref: benchmark-results
+ path: benchmark-data
+ fetch-depth: 1
+ persist-credentials: false
+
+ - name: Verify benchmark-results checkout
+ if: steps.data.outcome != 'success'
+ run: |
+ echo "::error::could not check out branch 'benchmark-results'. The dashboard preview needs the generated benchmark results that live on that branch; if it was renamed or deleted, restore it (see README 'Results and reporting') before requesting a preview."
+ exit 1
+
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: "3.12"
+
+ # Verbatim copy of the Pages assembly step (see the header comment):
+ # same inputs, same union of main's historical runs and the data
+ # branch's runs, same duplicate handling. The drift test in
+ # benchmark/test_dashboard_preview.py fails if the copies diverge.
+ - name: Assemble combined results tree
+ env:
+ DATA_DIR: benchmark-data
+ HISTORY_DIR: benchmark/results
+ OUT_DIR: site-results
+ run: |
+ set -euo pipefail
+ DATA_DIR="${DATA_DIR:-benchmark-data}"
+ HISTORY_DIR="${HISTORY_DIR:-benchmark/results}"
+ OUT_DIR="${OUT_DIR:-site-results}"
+
+ for d in openms openswath_dia/openms; do
+ if [ ! -d "$DATA_DIR/$d" ]; then
+ echo "::error::$DATA_DIR/$d is missing: branch 'benchmark-results' must contain generated results at $d/"
+ exit 1
+ fi
+ done
+ if [ ! -d "$HISTORY_DIR/tools" ]; then
+ echo "::error::$HISTORY_DIR/tools is missing; the local tool-reference JSONs must stay on main"
+ exit 1
+ fi
+
+ rm -rf "$OUT_DIR"
+ mkdir -p "$OUT_DIR/openms" "$OUT_DIR/openswath_dia/openms" "$OUT_DIR/tools"
+
+ history_total=0
+ generated_total=0
+ duplicates_identical=0
+ generated_smoke=0
+ generated_openswath=0
+
+ # place copies one result to its family-relative destination. A path
+ # already placed is accepted only when the bytes are identical (both
+ # sources can hold the same run); different contents fail the build,
+ # so one copy can never silently replace the other.
+ place() {
+ src="$1"
+ rel="$2"
+ dst="$OUT_DIR/$rel"
+ if [ -e "$dst" ]; then
+ if cmp -s "$src" "$dst"; then
+ duplicates_identical=$((duplicates_identical + 1))
+ echo "duplicate result with identical contents at $rel; keeping one copy"
+ return 0
+ fi
+ echo "::error::conflicting result at $rel: $src differs from the copy already assembled; refusing to publish a report that would silently pick one"
+ return 1
+ fi
+ mkdir -p "$(dirname "$dst")"
+ cp -p "$src" "$dst"
+ return 0
+ }
+
+ # copy_family copies every JSON of one source tree, keeping the family
+ # prefix so both sources land at the same relative layout.
+ copy_family() {
+ family="$1"
+ source_dir="$2"
+ [ -d "$source_dir" ] || return 0
+ while IFS= read -r -d '' file; do
+ place "$file" "$family/${file#"$source_dir"/}" || exit 1
+ done < <(find "$source_dir" -type f -name '*.json' -print0)
+ }
+
+ for family in openms openswath_dia/openms; do
+ history_dir="$HISTORY_DIR/$family"
+ generated_dir="$DATA_DIR/$family"
+ if [ -d "$history_dir" ]; then
+ history_count="$(find "$history_dir" -type f -name '*.json' | wc -l | tr -d ' ')"
+ else
+ history_count=0
+ echo "$history_dir holds no historical results on main; $family keeps the data branch's runs only"
+ fi
+ generated_count="$(find "$generated_dir" -type f -name '*.json' | wc -l | tr -d ' ')"
+ case "$family" in
+ openms) generated_smoke="$generated_count" ;;
+ openswath_dia/openms) generated_openswath="$generated_count" ;;
+ esac
+ echo "source counts for $family: main history=$history_count, benchmark-results=$generated_count"
+ history_total=$((history_total + history_count))
+ generated_total=$((generated_total + generated_count))
+ copy_family "$family" "$history_dir"
+ copy_family "$family" "$generated_dir"
+ done
+
+ cp -a "$HISTORY_DIR/tools/." "$OUT_DIR/tools/"
+
+ smoke="$(find "$OUT_DIR/openms" -maxdepth 1 -name 'smoke-*.json' | wc -l | tr -d ' ')"
+ openswath="$(find "$OUT_DIR/openswath_dia/openms" -maxdepth 1 -name 'openswath_dia-*.json' | wc -l | tr -d ' ')"
+ if [ "$generated_smoke" -eq 0 ] || [ "$generated_openswath" -eq 0 ]; then
+ echo "::error::branch 'benchmark-results' holds no usable history (smoke=$generated_smoke, openswath=$generated_openswath); refusing to publish an empty report"
+ exit 1
+ fi
+ echo "assembled $smoke smoke run(s), $openswath openswath run(s), $(find "$OUT_DIR/tools" -name '*.json' | wc -l | tr -d ' ') tool reference(s)"
+ echo "sources: main history=$history_total file(s), benchmark-results=$generated_total file(s), identical duplicate(s) collapsed=$duplicates_identical"
+
+ # Same generator and same results layout as production Pages; only the
+ # destination differs (an artifact directory instead of site/).
+ - name: Generate dashboard
+ run: |
+ set -euo pipefail
+ python benchmark/dashboard_generate.py \
+ --results-dir site-results \
+ --out dashboard-preview/dashboard.html
+
+ # Refuse to hand out a preview that is empty or obviously broken rather
+ # than let a reviewer download a blank page.
+ - name: Sanity-check the generated dashboard
+ run: |
+ set -euo pipefail
+ page=dashboard-preview/dashboard.html
+ if [ ! -s "$page" ]; then
+ echo "::error::$page was not generated or is empty"
+ exit 1
+ fi
+ bytes="$(wc -c < "$page" | tr -d ' ')"
+ if [ "$bytes" -lt 10000 ]; then
+ echo "::error::$page is only $bytes bytes; the dashboard looks empty, refusing to publish a preview"
+ exit 1
+ fi
+ for needle in "" "Reading these numbers" "All runs"; do
+ if ! grep -qF -- "$needle" "$page"; then
+ echo "::error::$page is missing the expected marker: $needle"
+ exit 1
+ fi
+ done
+ echo "dashboard preview: $page ($bytes bytes)"
+
+ # The artifact is self-contained: the page plus the instructions needed
+ # to download and view it offline (file:// works, no server needed).
+ - name: Write preview instructions
+ env:
+ PR_NUMBER: ${{ github.event.pull_request.number }}
+ HEAD_SHA: ${{ github.event.pull_request.head.sha }}
+ BASE_SHA: ${{ github.event.pull_request.base.sha }}
+ RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
+ REPO_SLUG: ${{ github.repository }}
+ GENERATED_AT: ${{ github.event.pull_request.updated_at }}
+ run: |
+ set -euo pipefail
+ mkdir -p dashboard-preview
+ sed -e "s|@PR_NUMBER@|${PR_NUMBER}|g" \
+ -e "s|@REPO_SLUG@|${REPO_SLUG}|g" \
+ -e "s|@HEAD_SHA@|${HEAD_SHA}|g" \
+ -e "s|@BASE_SHA@|${BASE_SHA}|g" \
+ -e "s|@GENERATED_AT@|${GENERATED_AT}|g" \
+ -e "s|@RUN_URL@|${RUN_URL}|g" \
+ benchmark/dashboard_preview_readme.md > dashboard-preview/README.md
+ echo "wrote dashboard-preview/README.md"
+
+ - name: Add preview summary
+ env:
+ RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
+ run: |
+ {
+ echo "### Dashboard preview"
+ echo
+ echo "Download the openms-dashboard-preview artifact from this run"
+ echo "(${RUN_URL}), extract it and open dashboard.html."
+ echo
+ echo "Built from this PR's code plus the benchmark-results data branch."
+ echo "Nothing was deployed: the production Pages site is unchanged."
+ } >> "$GITHUB_STEP_SUMMARY"
+
+ - name: Upload dashboard preview artifact
+ uses: actions/upload-artifact@v7
+ with:
+ name: openms-dashboard-preview
+ path: dashboard-preview
+ retention-days: 14
+ if-no-files-found: error
diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
index 4a7c50c..d36c77d 100644
--- a/.github/workflows/pages.yml
+++ b/.github/workflows/pages.yml
@@ -185,7 +185,7 @@ jobs:
echo "assembled $smoke smoke run(s), $openswath openswath run(s), $(find "$OUT_DIR/tools" -name '*.json' | wc -l | tr -d ' ') tool reference(s)"
echo "sources: main history=$history_total file(s), benchmark-results=$generated_total file(s), identical duplicate(s) collapsed=$duplicates_identical"
- - name: Generate site (pinned reference view + optional latest view)
+ - name: Generate site (dashboard + pinned reference view + optional latest view)
run: |
ARGS=(--site-dir site)
if [ -d upstream ]; then
@@ -198,6 +198,10 @@ jobs:
# main's tool-reference JSONs. Same renderer the CI report uses.
python benchmark/report/report_generate.py render \
--results-dir site-results --out site/report.html
+ # Benchmark dashboard: the primary view over the same results tree
+ # (latest cards, history charts, filterable table).
+ python benchmark/dashboard_generate.py \
+ --results-dir site-results --out site/dashboard.html
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml
index a1bc7af..92832d0 100644
--- a/.github/workflows/pr-checks.yml
+++ b/.github/workflows/pr-checks.yml
@@ -60,7 +60,9 @@ jobs:
benchmark/test_recover_nightly_results.py \
benchmark/test_runner_timestamps.py \
benchmark/report/test_generic_renderer.py \
- benchmark/report/test_v2_schema.py; do
+ benchmark/report/test_v2_schema.py \
+ benchmark/test_dashboard_generate.py \
+ benchmark/test_dashboard_preview.py; do
echo "== python $f"
python "$f"
done
diff --git a/benchmark/dashboard_generate.py b/benchmark/dashboard_generate.py
new file mode 100644
index 0000000..b6ad4dc
--- /dev/null
+++ b/benchmark/dashboard_generate.py
@@ -0,0 +1,915 @@
+#!/usr/bin/env python3
+"""Generate the static OpenMS benchmark dashboard.
+
+ benchmark run -> JSON result -> dashboard_generate.py -> dashboard.html
+
+The dashboard is the primary way to explore the stored benchmark results. It
+is a *view* over the same result tree the report renderer reads; it never
+maintains data of its own.
+
+Sections (mirroring the Sage CI/Benchmarks page, without copying its data):
+
+ Latest one card per (benchmark, dataset, runtime source) series showing
+ the latest run: provenance, identification-yield metrics first,
+ then verdict/correctness, then runtime and peak RSS as supporting
+ measurements.
+ History small-multiple SVG line charts per series: wall time, peak RSS and
+ the most relevant available benchmark metric (identification yield
+ when the stored results carry it). X positions come from the real
+ run timestamps; missing values are left as gaps, never
+ interpolated.
+ Table every stored run with benchmark/dataset filters (vanilla JS).
+
+Design rules enforced here:
+
+ * Identification yield (PSMs / peptides / proteins / features @ 1% FDR or
+ equivalent) is visually first-class whenever a result records it. A run
+ that does not record it says "unavailable" -- it never shows a 0.
+ * Runtime and peak RSS are labelled as performance/context measurements and
+ are not presented as benchmark quality.
+ * SOURCE and PACKAGE runs are distinct series and are never merged, so the
+ page cannot imply that runs with different provenance are comparable.
+ * No cross-tool ranking is computed or rendered.
+
+Stdlib only, like the rest of the benchmarking repository.
+"""
+
+import argparse
+import datetime as _dt
+import html
+import json
+import os
+import re
+import sys
+import importlib.util
+
+_HERE = os.path.dirname(os.path.abspath(__file__))
+_REPORT_DIR = os.path.join(_HERE, "report")
+_REPORT_PATH = os.path.join(_REPORT_DIR, "report_generate.py")
+_spec = importlib.util.spec_from_file_location("report_generate", _REPORT_PATH)
+rg = importlib.util.module_from_spec(_spec)
+_spec.loader.exec_module(rg)
+
+
+# ---------------------------------------------------------------------------
+# identification-yield registry
+#
+# Only metrics actually written by the runners/normalizers are listed. The
+# registry decides *presentation* (what is shown first, how it is formatted);
+# it never derives a value that a result does not contain.
+#
+# Keys with an arm suffix (e.g. target_psms_at_1pct_fdr_baseline from the
+# ProSE+PeptDeep normalizer) match by prefix and keep the suffix as a label.
+# ---------------------------------------------------------------------------
+
+YIELD_METRICS = (
+ {"key": "target_psms_at_1pct_fdr", "label": "PSMs @ 1% FDR", "kind": "count"},
+ {"key": "target_peptides_at_1pct_fdr", "label": "Peptides @ 1% FDR", "kind": "count"},
+ {"key": "psms_total", "label": "PSMs scored (all q)", "kind": "count"},
+ {"key": "identified_peptides", "label": "Identified peptides", "kind": "count"},
+ {"key": "identified_proteins", "label": "Identified proteins", "kind": "count"},
+ {"key": "identified_features", "label": "Identified features", "kind": "count"},
+ {"key": "quantified_precursors", "label": "Quantified precursors", "kind": "count"},
+)
+
+# Yield metrics that are diagnostics, not identification yield: shown with the
+# supporting metrics, never in the yield block.
+YIELD_DIAGNOSTICS = (
+ "entrapment_psms_at_1pct_fdr",
+ "entrapment_peptides_at_1pct_fdr",
+ "library_coverage",
+)
+
+PERFORMANCE_KEYS = ("wall_time_s", "peak_rss_kb", "cpu_time_s")
+
+# Readable labels for the supporting (non-yield) metrics actually recorded by
+# the stored results. Unknown keys fall back to "snake_case -> Sentence case".
+SUPPORTING_LABELS = {
+ "feature_quality_sum": "Feature quality sum",
+ "total_intensity": "Total intensity",
+ "library_coverage": "Library coverage",
+ "library_peptides": "Library peptides",
+ "library_peptides_identifiable": "Library peptides (identifiable)",
+ "library_peptides_orphan": "Library peptides (orphan)",
+ "library_precursor_mz": "Library precursors (m/z)",
+ "library_transitions": "Library transitions",
+ "identified_precursor_mz": "Identified precursors (m/z)",
+ "transitions_used": "Transitions used",
+ "entrapment_psms_at_1pct_fdr": "Entrapment PSMs @ 1% FDR",
+ "entrapment_peptides_at_1pct_fdr": "Entrapment peptides @ 1% FDR",
+ "cv_median": "CV median",
+ "median_abs_epsilon": "Median |epsilon|",
+ "mean_abs_epsilon": "Mean |epsilon|",
+ "roc_auc": "ROC AUC",
+}
+
+
+def _metric_label(name):
+ if name in SUPPORTING_LABELS:
+ return SUPPORTING_LABELS[name]
+ label = name.replace("_", " ").strip()
+ return label[:1].upper() + label[1:]
+
+
+def _yield_match(metric_name):
+ """(label, kind) when metric_name is an identification-yield metric."""
+ for spec in YIELD_METRICS:
+ if metric_name == spec["key"]:
+ return spec["label"], spec["kind"]
+ prefix = spec["key"] + "_"
+ if metric_name.startswith(prefix) and metric_name[len(prefix):]:
+ suffix = metric_name[len(prefix):].replace("_", " ")
+ return f"{spec['label']} ({suffix})", spec["kind"]
+ return None
+
+
+def _is_numeric(value):
+ return isinstance(value, (int, float)) and not isinstance(value, bool)
+
+
+def _fmt_count(value):
+ if isinstance(value, float) and not value.is_integer():
+ return f"{value:,.3f}"
+ return f"{int(value):,}"
+
+
+def _fmt_performance(name, value):
+ """Formatting for the supporting performance metrics."""
+ if value is None:
+ return "unavailable"
+ if name == "wall_time_s":
+ return rg.fmt_seconds(value)
+ if name == "peak_rss_kb":
+ return rg.fmt_bytes(float(value) * 1024)
+ if name == "cpu_time_s":
+ return f"{value:.2f} s"
+ return str(value)
+
+
+def _fmt_value(name, value):
+ """Format one metric value for a table cell or chart point."""
+ if value is None:
+ return "unavailable"
+ match = _yield_match(name)
+ if name == "library_coverage" and _is_numeric(value):
+ return f"{value * 100:.1f}%"
+ if match and match[1] == "count":
+ return _fmt_count(value)
+ if name in PERFORMANCE_KEYS:
+ return _fmt_performance(name, value)
+ if _is_numeric(value):
+ return _fmt_count(value)
+ return str(value)
+
+
+def _fmt_run_at(value):
+ """'2026-11-06T03:21:53Z' -> '2026-11-06 03:21 UTC' (raw text when odd)."""
+ if not value:
+ return "unknown time"
+ text = str(value).strip()
+ if text.endswith("Z"):
+ text = text[:-1] + " UTC"
+ # Replace only the date/time separator, never the 'T' inside "UTC".
+ head, sep, tail = text.partition("T")
+ return f"{head} {tail}" if sep else text
+
+
+def _parse_timestamp(value):
+ """Aware/naive datetime for an ISO-8601 run_at, or None."""
+ if not value:
+ return None
+ try:
+ return _dt.datetime.fromisoformat(str(value).replace("Z", "+00:00"))
+ except (TypeError, ValueError):
+ return None
+
+
+def _commit_url(sha):
+ if sha and re.fullmatch(r"[0-9a-fA-F]{7,40}", str(sha)):
+ return f"https://github.com/OpenMS/OpenMS/commit/{sha}"
+ return None
+
+
+def _series_key(result):
+ """One dashboard series per benchmark/dataset/runtime source."""
+ return (rg._benchmark_name(result), rg._dataset(result), rg._runtime_source(result))
+
+
+def _latest_per_series(openms_runs):
+ """The most recent run of every series, as (key, run) sorted by key."""
+ latest = {}
+ for run in openms_runs:
+ key = _series_key(run)
+ current = latest.get(key)
+ if current is None or rg._run_at(run) >= rg._run_at(current):
+ latest[key] = run
+ return sorted(latest.items())
+
+
+def _yield_metrics(result):
+ """[(metric_name, label, value)] for the identification-yield block."""
+ found = []
+ for name, value in (rg._metrics(result) or {}).items():
+ if name == "verdict" or name in YIELD_DIAGNOSTICS:
+ continue
+ match = _yield_match(name)
+ if match is None or not _is_numeric(value):
+ continue
+ found.append((name, match[0], value))
+ # Registry order (PSMs, peptides, ...), then any other matched key.
+ order = {spec["key"]: i for i, spec in enumerate(YIELD_METRICS)}
+
+ def rank(item):
+ name = item[0]
+ for spec in YIELD_METRICS:
+ if name == spec["key"]:
+ return (order[spec["key"]], name)
+ if name.startswith(spec["key"] + "_"):
+ return (order[spec["key"]], name)
+ return (len(order), name)
+
+ return sorted(found, key=rank)
+
+
+def _supporting_metrics(result):
+ """Non-yield, non-verdict metric pairs (diagnostics included)."""
+ pairs = []
+ for name, value in sorted((rg._metrics(result) or {}).items()):
+ if name == "verdict":
+ continue
+ if _yield_match(name) is not None:
+ continue
+ if not _is_numeric(value) and not isinstance(value, (str, bool)):
+ continue
+ pairs.append((name, value))
+ return pairs
+
+
+# ---------------------------------------------------------------------------
+# correctness
+# ---------------------------------------------------------------------------
+
+def _correctness_items(result):
+ """[(text, ok|None)] describing the run's correctness section."""
+ corr = result.get("correctness") or {}
+ items = []
+ if "expected_features" in corr and "actual_features" in corr:
+ expected, actual = corr["expected_features"], corr["actual_features"]
+ items.append((f"{actual} / {expected} expected features", expected == actual))
+ for name in sorted(corr):
+ value = corr[name]
+ if isinstance(value, bool):
+ label = name.replace("_", " ")
+ items.append((f"{label}: {'yes' if value else 'no'}", value))
+ if not items and corr:
+ items.append((f"{len(corr)} correctness field(s) recorded", None))
+ return items
+
+
+# ---------------------------------------------------------------------------
+# tiny SVG line charts (no JS chart library, no interpolation)
+# ---------------------------------------------------------------------------
+
+_CHART_W = 360
+_CHART_H = 150
+_PAD_L = 48
+_PAD_R = 12
+_PAD_T = 12
+_PAD_B = 26
+
+
+def _chart_geometry(points):
+ """x/y pixel mappers for a list of (index, timestamp|None, value|None).
+
+ X uses the real timestamps when every point has one and there are at
+ least two distinct instants; otherwise points are evenly spaced. Y is
+ linear over the observed values (baseline_zero pins the bottom to 0).
+ """
+ stamps = [stamp for _, stamp, _ in points]
+ use_time = all(stamp is not None for stamp in stamps) and len(
+ {stamp for stamp in stamps}) > 1
+ if use_time:
+ epochs = [stamp.timestamp() for stamp in stamps]
+ x_lo, x_hi = min(epochs), max(epochs)
+ else:
+ x_lo, x_hi = 0.0, float(max(1, len(points) - 1))
+
+ def x_at(i):
+ if use_time:
+ position = (points[i][1].timestamp() - x_lo) / (x_hi - x_lo)
+ else:
+ position = i / (x_hi - x_lo) if x_hi else 0.0
+ return _PAD_L + position * (_CHART_W - _PAD_L - _PAD_R)
+
+ return x_at
+
+
+def _svg_line_chart(points, title, unit, baseline_zero=False):
+ """A small multiple SVG chart.
+
+ points: [{"run_at": str, "value": number|None, "label": str}]
+ Missing values break the line (a gap), never drawn as zero.
+ """
+ plotted = [
+ (i, _parse_timestamp(p["run_at"]), p["value"], p)
+ for i, p in enumerate(points)
+ ]
+ values = [v for _, _, v, _ in plotted if v is not None]
+ if not values:
+ return ""
+ x_at = _chart_geometry([(i, stamp, v) for i, stamp, v, _ in plotted])
+ lo, hi = min(values), max(values)
+ if baseline_zero:
+ lo = 0.0
+ if hi == lo:
+ hi = lo + 1.0 if lo == 0 else lo * 1.1
+ if hi == lo:
+ hi = lo + 1.0
+ plot_h = _CHART_H - _PAD_T - _PAD_B
+
+ def y_at(value):
+ return _PAD_T + (hi - value) / (hi - lo) * plot_h
+
+ parts = [
+ f'")
+ return "".join(parts)
+
+
+def _history_metric_choice(series):
+ """The most relevant benchmark metric of a history series.
+
+ Identification yield wins; otherwise the first numeric non-performance
+ metric recorded for the series. Returns (name, label, unit_fn, zero_base)
+ or None.
+ """
+ numeric = [col for col in series["columns"]
+ if col["kind"] == "numeric"
+ and series["values"].get(col["name"])
+ and any(v is not None for v in series["values"][col["name"]])]
+ with_yield = [col for col in numeric if _yield_match(col["name"])]
+ if with_yield:
+ name = with_yield[0]["name"]
+ return (name, _yield_match(name)[0], _fmt_count, True)
+ for col in numeric:
+ name = col["name"]
+ if name.startswith("performance."):
+ continue
+ return (name, name, _fmt_count, False)
+ return None
+
+
+def _history_card(series):
+ """One small-multiple card (3 charts) for a history series."""
+ runs = series["runs"]
+ esc = html.escape
+ bench, dataset, runtime = series["key"]
+ charts = []
+
+ def add_chart(name, label, unit_fn, zero_base):
+ values = series["values"].get(name)
+ if not values or not any(v is not None for v in values):
+ return
+ points = [
+ {"run_at": rg._run_at(run), "value": value, "label": rg._run_id(run),
+ "name": name}
+ for run, value in zip(runs, values)
+ ]
+ svg = _svg_line_chart(points, label, unit_fn, zero_base)
+ if svg:
+ charts.append(
+ f'
{html.escape(package["filename"])}')
+ if package.get("date"):
+ detail.append(f'build night {html.escape(str(package["date"]))}')
+ return (rg._chip("PACKAGE · nightly .deb", "warn"),
+ " · ".join(detail))
+ return rg._chip("SOURCE · exact-SHA build", "ok"), ""
+
+
+def _commit_html(result):
+ sha = rg._software_version(result)
+ if not sha or sha == "unknown":
+ return 'commit not recorded'
+ url = _commit_url(sha)
+ short = rg.short_sha(sha)
+ if url:
+ return f'{html.escape(short)}'
+ return f'{html.escape(short)}'
+
+
+def _yield_block(result):
+ metrics = _yield_metrics(result)
+ if not metrics:
+ return (
+ 'Unavailable — this run does not record ' + 'identification-yield metrics.
{esc(dataset)} + {esc(runtime.upper())}
+{chip} {provenance_detail}
+ {_yield_block(run)} +Verdict {rg._chip(verdict, rg.status_class(verdict))} + · correctness {correctness_html}
+Run {esc(rg._run_id(run))} ·
+ {esc(_fmt_run_at(rg._run_at(run)))} · {_commit_html(run)}
| Run at | Benchmark | Dataset | Runtime | +Commit | Verdict | +Wall | Peak RSS | + {yield_headers} +Correctness | Run / label | +
|---|
benchmark/results/tools/; they are not OpenMS runs and carry no
+ performance measurements.Every stored benchmark run in one place: latest results per + benchmark series, run history, and a filterable table. Identification yield + is shown first wherever the stored results record it; runtime and memory are + supporting performance measurements, not a measure of benchmark quality.
+ +