From 0a3cf226ed6dba8a2eb7a59bea9797aa607620ab Mon Sep 17 00:00:00 2001 From: jlukic Date: Wed, 15 Apr 2026 16:21:35 -0400 Subject: [PATCH] Build: Discover runs all benchmarkable packages, not just touched ones MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #148 (signal-safety refactor under packages/reactivity) exposed the per-package scoping bug in discover. The prior logic looked up tachometer configs inside the specific changed package and ran their matrix cells — but every tachometer config in this repo lives under packages/renderer, so a PR that only changes packages/reactivity resolved to an empty matrix and the bench workflow skipped silently. This is wrong in the base case: reactivity imports renderer consumes via workspace symlinks, so a signal-path change moves renderer's bench numbers. Same for templating → rendering, utils → everything, etc. The benches are end-to-end measurements that pull the whole framework through a workload; treating them as scoped-by-touched-package was premature. New logic: any trigger that reaches this workflow (push to main, or a pull_request that matched our path filter) runs every tachometer-ci*.json it finds under packages/*/bench/tachometer/. Path filter already restricts triggers to perf-relevant changes, so this doesn't over-fire. The push-branch and pull-request branches collapse to the same one-liner, which is a good sign. Ship. --- .github/workflows/benchmarks.yml | 51 ++++++++++---------------------- 1 file changed, 15 insertions(+), 36 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index be009cb33..8348ec273 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -48,43 +48,22 @@ jobs: - name: Build matrix id: matrix run: | - # Push to main: archive every benchmarkable package — we need the - # full absolute-CI snapshot for bench-history regardless of what - # changed in this commit. - if [ '${{ github.event_name }}' = 'push' ]; then - changed=$(find packages -name 'tachometer-ci*.json' -path '*/bench/tachometer/*' \ - | cut -d/ -f2 \ - | sort -u) - else - base=origin/${{ github.event.pull_request.base.ref }} - - # If a benchmark workflow or bench harness changed, we need to - # validate CI itself — run against every benchmarked package. - ci_changed=$(git diff --name-only "$base"...HEAD \ - | grep -E '^(\.github/workflows/benchmarks.*\.yml|packages/[^/]+/bench/tachometer/)' \ - | head -1) - - if [ -n "$ci_changed" ]; then - changed=$(find packages -name 'tachometer-ci*.json' -path '*/bench/tachometer/*' \ - | cut -d/ -f2 \ - | sort -u) - else - changed=$(git diff --name-only "$base"...HEAD \ - | grep '^packages/' \ - | cut -d/ -f2 \ - | sort -u) - fi - fi - - # For each changed package, emit one entry per tachometer-ci*.json + # Any trigger that reaches this workflow — push to main, or a + # pull_request whose diff matched our path filter — runs every + # benchmarkable package's configs. Tachometer configs only live + # under `packages/renderer/` today, but a change in any other + # package (reactivity, templating, etc.) can absolutely move + # renderer's bench numbers via workspace imports. Per-package + # scoping of the matrix was premature: the benches are end-to-end + # measurements that pull the whole framework through; treat the + # set of benchmarkable packages as a single target suite. entries=() - for pkg in $changed; do - while IFS= read -r config; do - [ -z "$config" ] && continue - name=$(basename "$config" .json) - entries+=("{\"config\":\"$config\",\"name\":\"$name\",\"package\":\"$pkg\"}") - done < <(find "packages/$pkg" -name 'tachometer-ci*.json' -path '*/bench/tachometer/*' 2>/dev/null | sort) - done + while IFS= read -r config; do + [ -z "$config" ] && continue + pkg=$(echo "$config" | cut -d/ -f2) + name=$(basename "$config" .json) + entries+=("{\"config\":\"$config\",\"name\":\"$name\",\"package\":\"$pkg\"}") + done < <(find packages -name 'tachometer-ci*.json' -path '*/bench/tachometer/*' 2>/dev/null | sort) if [ ${#entries[@]} -eq 0 ]; then matrix="[]"