From 94c9772318b6fe69c73d14c04a130facc1f825d8 Mon Sep 17 00:00:00 2001 From: DJ Majumdar Date: Sun, 22 Mar 2026 12:39:53 -0700 Subject: [PATCH] fix: use distinct critcmp group names so PR benchmark diff shows two columns Both the main baseline and PR results were exported under the group name "current", causing critcmp to merge them into a single column instead of a side-by-side comparison. Rename to "main" and "pr" respectively. --- .github/workflows/benchmarks.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 60a21f9..664f768 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -63,7 +63,10 @@ jobs: - name: Cache baseline for PR comparison if: github.event_name == 'push' - run: critcmp --export current > baseline.json + run: | + critcmp --export current > baseline.json + # Rename the group inside the JSON so critcmp can diff two distinct columns. + sed -i 's/"current"/"main"/' baseline.json - name: Save baseline to cache if: github.event_name == 'push' @@ -90,7 +93,10 @@ jobs: echo "::warning::No benchmark baseline found. Merge to main to generate one." exit 0 fi - critcmp --export current > pr.json + critcmp --export current > pr-raw.json + # Rename so critcmp sees "pr" vs "main" as two distinct columns. + sed -i 's/"current"/"pr"/' pr-raw.json + mv pr-raw.json pr.json echo 'result<> $GITHUB_OUTPUT critcmp baseline.json pr.json >> $GITHUB_OUTPUT echo 'EOF' >> $GITHUB_OUTPUT