Repository navigation
refactor(ci): move benchmark aggregation into invokable Python (reld#48) - #162
Merged
zackees merged 1 commit intoSep 17, 2026
Merged
Conversation
The per-target measurement steps were already Python. Aggregation was not: a
shell loop in the aggregate job knew the target list, where each raw log lands,
how history is carried forward, and what the published directory looks like.
Nobody could run it locally, and it drifted from the target manifest by
construction — it re-derived the list through `--print-targets` and the layout
by hand.
`ci/benchmark_pipeline.py` owns all of it, and checks what the shell never did:
that every target produced `latest.json`, `history.jsonl`, `benchmark-link.jpg`
and `index.html`, failing with the target named rather than publishing a
half-written directory. A missing or unparseable raw log fails the same way
instead of rendering an empty chart.
The workflow step is now one call. Publishing stays in YAML, where the token is;
nothing in the pipeline can push.
Local run against logs downloaded from a CI run:
uv run --no-sync python -m ci.benchmark_pipeline \
--input-root benchmark-input --output-root benchmark-stats --no-history-fetch
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
11 of 20 tasks
zackees
added a commit
that referenced
this pull request
Sep 17, 2026
…54) (#161) * ci(bench): make the stacked chart layout the generated default (reld#54) The README block is already generated and stacked, but nothing asserted the property: `--check-readme` compares the file against the same generator that wrote it, so a change back to a column of thumbnails would pass with both sides agreeing. `ci/tests/test_benchmark_layout.py` now pins the layout itself — one full-width chart per OS, in the manifest's order, no table — on the generator and on the committed README. The published branch had no combined view at all: three per-target directories and nothing showing them together. `--write-combined-index` writes one at the root, using the same rule, and the aggregate job now emits it. A chart shrunk into a thumbnail grid is a chart nobody reads, so each OS gets the full width and its own row, with the per-target page one click away. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * refactor(ci): move benchmark aggregation into invokable Python (reld#48) (#162) The per-target measurement steps were already Python. Aggregation was not: a shell loop in the aggregate job knew the target list, where each raw log lands, how history is carried forward, and what the published directory looks like. Nobody could run it locally, and it drifted from the target manifest by construction — it re-derived the list through `--print-targets` and the layout by hand. `ci/benchmark_pipeline.py` owns all of it, and checks what the shell never did: that every target produced `latest.json`, `history.jsonl`, `benchmark-link.jpg` and `index.html`, failing with the target named rather than publishing a half-written directory. A missing or unparseable raw log fails the same way instead of rendering an empty chart. The workflow step is now one call. Publishing stays in YAML, where the token is; nothing in the pipeline can push. Local run against logs downloaded from a CI run: uv run --no-sync python -m ci.benchmark_pipeline \ --input-root benchmark-input --output-root benchmark-stats --no-history-fetch Co-authored-by: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #48. Wave 3 of #153. Stacked on #161 (#54) — it reuses the combined-index renderer, so merge that first and this retargets to main.
What was still in YAML
Measurement was already Python (
ci.benchmark_runner,ci.benchmark_coverage,ci.benchmark_stats). Aggregation was not: a shell loop in the aggregate job knew the target list, where each raw log lands, how history is carried forward, and what the published directory looks like. It re-derived the target list through--print-targetsand re-implemented the layout by hand, which is drift by construction, and nobody could run it locally.What this adds
ci/benchmark_pipeline.pyowns target configuration, thebenchmark-log-<target>/input layout, history carry-forward, per-target rendering, the combined page, and validation. It checks what the shell never did: that every target producedlatest.json,history.jsonl,benchmark-link.jpgandindex.html, failing with the target named rather than publishing a half-written directory. A missing or unparseable raw log, or metadata naming a different target, fails the same way instead of rendering an empty chart.History carry-forward keeps the old behaviour deliberately: a failed fetch starts an empty file rather than failing the run. Losing a history line is recoverable; refusing to publish is not.
The workflow step is now one call. Publishing stays in YAML, where the token is — nothing in the pipeline can push, and the default-branch guard is untouched.
RED → GREEN
test_benchmark_workflow.pyasserted the inline shell contract (benchmark-stats/$target,--metadata-path "benchmark-input/benchmark-log-$target/metadata.json"). Those two tests failed against this refactor and now assert the new contract: the YAML names only the roots and callsci.benchmark_pipeline.Local command
Verification
uv run --no-sync python -m pytest ci/tests -q— 274 passed, 9 new intest_benchmark_pipeline.pycovering all three targets, target isolation (eachlatest.jsonnames only its own target), missing log, malformed log, mismatched metadata, local history carry-forward, the empty-history path, and a no-network CLI run that writes no git state.🤖 Generated with Claude Code