diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index 5952fcc..040cf29 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -22,6 +22,8 @@ jobs: run: python3 ci/test-last-attempt-badge.py - name: Benchmark history checks run: python3 ci/test-bench-history.py + - name: Metric badge checks + run: python3 ci/test-metrics.py - name: Release evidence gate checks run: python3 ci/test-conformance.py - name: Release publication checks @@ -37,7 +39,7 @@ jobs: - name: Microbenchmarks run: | set -o pipefail - cargo test --release --locked -- --ignored --nocapture | tee bench-current.txt + cargo test --release --locked -- --ignored --nocapture --test-threads=1 | tee bench-current.txt - name: Coverage tool run: | rustup component add llvm-tools-preview diff --git a/README.md b/README.md index 01898b5..4251032 100644 --- a/README.md +++ b/README.md @@ -113,3 +113,7 @@ not imply that any board image or mining target has passed conformance. CI and metric badges are served from a private, machine-maintained branch. The CI badge shows the last completed attempt for this source branch while newer runs are queued; main CI refreshes measured metrics before conformance. +Microbenchmarks report the median of seven calibrated samples and compare +only with an earlier commit measured on the same CPU class. The code-quality +letter requires warnings-denied Clippy to pass and uses measured test line +coverage: A at 90%, B at 80%, C at 70%, D at 60%, and F below 60%. diff --git a/ci/bench_history.py b/ci/bench_history.py index 8591779..468c315 100644 --- a/ci/bench_history.py +++ b/ci/bench_history.py @@ -16,6 +16,7 @@ from urllib.error import HTTPError from urllib.parse import quote from badge_store import BADGE_BRANCH, publish_file, request_json +from bench_host import identity as benchmark_host INDEX = "history/index.json" MAX_INDEX_ENTRIES = 50 @@ -53,13 +54,15 @@ def git_distance(ancestor: str, sha: str) -> int | None: return int(result.stdout.strip()) if ancestor_check.returncode == 0 else None -def previous_measurement(index: dict, sha: str, distance=None) -> dict: +def previous_measurement(index: dict, sha: str, distance=None, host=None) -> dict: distance = distance or git_distance choices = [] for entry in index.get("entries", []): ancestor = entry.get("sha") if ancestor == sha or not isinstance(ancestor, str): continue + if host is not None and entry.get("metrics", {}).get("bench_host") != host: + continue gap = distance(ancestor, sha) if gap is not None and gap > 0: choices.append((gap, entry)) @@ -89,6 +92,9 @@ def render_html(index: dict) -> str: cells = [f'
Most recent {len(entries)} measured commits. Full per-commit JSON is retained " "in the private ci-badges branch.
" f"| Commit | " - f"UTC | {headings}UTC | CPU | {headings}{''.join(rows)}" "
|---|