refactor(benchmark): dedup rendering, path resolution, and metrics accumulation - #470
Merged
Conversation
…cumulation - Exported RunMetrics.Add for the two hand-rolled accumulation sites - Sticky-error writer collapses ~36 Fprintf-error triples; run/selection and compare/selection-compare render pairs merged - One variadic results-dir helper replaces three resolve* copies - benchmark.ResolveSuitePath exported; four suite-relative copies gone - Selection failure epilogue in a closure; identical if/else branches collapsed in compare/select/run - Generic filterByID for candidate/case selection; single-loop warning dedup; shared report-markdown headers - validateCandidateCaseHosts parses each case PR once (error order kept) - markdownCell alias deleted (11 callers -> markdownCode) - Normalize uses trimAll instead of 20 per-field lines Part of #453 (Phase 6, dedup half; in-process executor is separate).
This was referenced Jul 10, 2026
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.
The dedup half of #453 (Phase 6, part of #455); the in-process executor ships separately. All 12 audited items landed, scoped to
internal/benchmark+internal/cmd/benchmarkcmd.Highlights: a sticky-error writer collapses ~36 copies of the 3-line Fprintf-error pattern and lets the run/selection and compare/selection-compare render pairs merge;
benchmark.ResolveSuitePathreplaces four copies of suite-relative resolution;RunMetrics.Addreplaces the two hand-rolled accumulations (the audit's caveat held —ExtractRunMetricsuses a different type and stays); genericfilterByID;markdownCellalias deleted across 11 call sites;validateCandidateCaseHostsparses each case PR once with error order preserved;Normalizetrims viatrimAll.Rendered text, report markdown, and error messages are byte-identical (rendering tests pass unchanged).
Verification: build/vet clean; full suite 2,587 green in 57 packages; repo-wide lint clean; harness green; zero tests deleted. 7 files, +177/−348 (net −171).