Skip to content

CI: publish perf and coverage metrics as a sticky PR comment#105

Merged
typeless merged 4 commits into
mainfrom
ci/pr-metrics
Jul 18, 2026
Merged

CI: publish perf and coverage metrics as a sticky PR comment#105
typeless merged 4 commits into
mainfrom
ci/pr-metrics

Conversation

@typeless

Copy link
Copy Markdown
Owner

Adds a pr-metrics-comment job that posts one continuously-updated comment per PR with:

Performance (Linux, measured in build-gcc-bsp against the fully built gcc example):

  • parse and dry-run (-n) workloads
  • instructions, cycles, wall (perf stat -r 3, user-space counters; runner needs kernel.perf_event_paranoid lowered, done via sudo)
  • peak RSS via /usr/bin/time -v
  • instructions + RSS flagged as the stable metrics; cycles/wall noted as noisy on shared runners

Coverage (from the existing coverage job's gcovr summary.json):

  • overall / median / min / max per-file line coverage, with the min/max filenames

Mechanics: each producing job uploads a small markdown fragment as an artifact and mirrors it to its step summary; the comment job (permissions: pull-requests: write, PR events only) merges the fragments and upserts a comment keyed by an HTML marker, so pushes edit the existing comment instead of stacking new ones. Untrusted-input rule respected: only PR number, head SHA, and repo slug reach the shell, via env:.

Both generators are repo scripts validated locally: .github/scripts/bench_metrics.sh produced the table against a local gcc-example tree, and .github/scripts/coverage_stats.py against a real gcovr summary (84.0% overall, median 91.5%, min 0.0% src/platform/path-posix.cpp, max 100% include/pup/core/arena.hpp). This PR's own checks exercise the workflow end-to-end — the comment below this description is the acceptance test.

🤖 Generated with Claude Code

https://claude.ai/code/session_01U5KUoGDhJEZYoiK9CkeXtz

The build-gcc-bsp job benchmarks parse and dry-run on the built gcc
example (perf stat + peak RSS); the coverage job condenses gcovr's
per-file line coverage into overall/median/min/max. A final job merges
both fragments into one marker-keyed PR comment, updated in place on
every push, and mirrors them to the step summary.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U5KUoGDhJEZYoiK9CkeXtz
@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown

PR metrics

Performance (gcc example, Linux)

Workload Instructions CPU time Page faults D1 miss LL miss Wall Peak RSS
parse n/a 228882 s 12.2 k 0.8% 0.1% 0.232 s 33.2 MB
dry-run n/a 381847 s 16.5 k 1.3% 0% 0.386 s 51.4 MB

Deterministic signals: page faults, peak RSS, and the cachegrind D1/LL miss rates (simulated cache, exact across runs). CPU time is the stable compute signal on shared runners; instructions read n/a on GitHub-hosted runners (virtualized, no PMU).

Test coverage (lines)

Overall Median file Min file Max file
84.9% 92% 0.0% include/pup/core/metrics.hpp 100.0% include/pup/core/arena.hpp

95 files · 13778/16220 lines covered

Updated for 7169376

typeless and others added 3 commits July 18, 2026 10:36
GitHub-hosted runners are virtualized without a PMU, so cycles and
instructions come back '<not supported>'; render those as n/a and add
task-clock and page-faults as the stable software-counter signals.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U5KUoGDhJEZYoiK9CkeXtz
Hosted runners have no PMU, so hardware cache counters are
unavailable; cachegrind's simulated rates are deterministic to the
last reference and fill that gap. --cache-sim=yes is required since
valgrind 3.21 turned the simulation off by default.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U5KUoGDhJEZYoiK9CkeXtz
Generators now emit TSV; compose_metrics.py renders the markdown and
annotates deltas (percent for counts, percentage points for rates, MB
for RSS) against baseline TSVs when present. The comment job fetches
the baseline artifacts from the most recent successful push run on
main and falls back to current-only when none exist — main runs before
this change carry no TSV artifacts, so the first delta appears one
merge after this lands.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U5KUoGDhJEZYoiK9CkeXtz
@typeless
typeless merged commit b49caca into main Jul 18, 2026
11 checks passed
@typeless
typeless deleted the ci/pr-metrics branch July 18, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant