Skip to content

CI: consolidate metrics scripts into one Python module#106

Merged
typeless merged 1 commit into
mainfrom
ci/task-clock-units
Jul 18, 2026
Merged

CI: consolidate metrics scripts into one Python module#106
typeless merged 1 commit into
mainfrom
ci/task-clock-units

Conversation

@typeless

@typeless typeless commented Jul 18, 2026

Copy link
Copy Markdown
Owner

The three metrics scripts (bench_metrics.sh, coverage_stats.py, compose_metrics.py) become one shebang-invoked .github/scripts/metrics command with bench / coverage / render subcommands, folding in the task-clock unit fix.

Why: the TSV schema was defined twice (a shell printf and Python dict keys), and every defect so far — counters rendering as 0 instead of n/a, CPU time as 228882 s — lived in embedded awk fragments that can't be tested. The parsers are now plain functions verified against captured output, including the exact ns-format task-clock line from the failing CI run (228,882,540 ns → 0.23 s, matching that run's 0.232 s wall). task-clock is normalized via its unit token (msec/usec/ns).

Verified locally: bench reproduces the shell version's TSV byte-for-byte on the same tree; coverage + render with and without a fabricated baseline produce the same tables and deltas as before; exec bit is 100755 in the index; workflow YAML validated.

🤖 Generated with Claude Code

https://claude.ai/code/session_01U5KUoGDhJEZYoiK9CkeXtz

@typeless typeless changed the title CI: parse task-clock unit-aware in bench metrics CI: consolidate metrics scripts into one Python module Jul 18, 2026
@typeless
typeless force-pushed the ci/task-clock-units branch 2 times, most recently from 7482a8c to 073f518 Compare July 18, 2026 03:57
@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 0.44 s 12.2 k 1.1% 0.1% 0.452 s 33.1 MB (-0.1MB)
dry-run n/a 0.66 s 16.5 k 1.6% 0.1% 0.697 s 51.3 MB (-0.1MB)

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

Test coverage (lines)

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

95 files · 13780/16220 lines covered

Deltas vs main@b49caca44.

Updated for a9f80af

bench_metrics.sh, coverage_stats.py, and compose_metrics.py shared a
TSV schema defined twice and parsed perf/valgrind output in embedded
awk fragments that failed twice on unseen input shapes (<not
supported> counters, task-clock in ns instead of msec). One
.github/scripts/metrics command with bench, coverage, and render
subcommands keeps the schema in one place, makes the parsers plain
testable functions, and normalizes task-clock via its unit token.
Shebang-invoked; the implementation language is not part of the
interface.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U5KUoGDhJEZYoiK9CkeXtz
@typeless
typeless force-pushed the ci/task-clock-units branch from 073f518 to a9f80af Compare July 18, 2026 04:11
@typeless
typeless merged commit 052d1a8 into main Jul 18, 2026
11 checks passed
@typeless typeless mentioned this pull request Jul 18, 2026
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