Skip to content

The only tool you need to know what is happening and how to fix it.

no more date - results are from the last run always

ddux0d00eaccc47c
diff --git a/.github/workflows/benchmark-hardware.yml b/.github/workflows/benchmark-hardware.yml
index bdd3f561..02d2ab6c 100644
--- a/.github/workflows/benchmark-hardware.yml
+++ b/.github/workflows/benchmark-hardware.yml
@@ -143,12 +143,16 @@ jobs:
with:
path: /tmp/results-raw
- - name: Stage into benchmarks/results/<date>/
+ - name: Stage into benchmarks/results/latest/
id: stage
run: |
set -euo pipefail
- date_tag="$(date -u +%Y-%m-%d)"
- dst="benchmarks/results/${date_tag}"
+ # Always overwrite `latest/` so each dispatch reports only its own
+ # matrix entries. Cross-run comparison happens via `git log`, not
+ # via cumulative same-folder data — the old date-stamped folder
+ # approach silently mixed dispatches that landed on the same day.
+ dst="benchmarks/results/latest"
+ rm -rf "${dst}"
mkdir -p "${dst}"
find /tmp/results-raw -name '*.json' -exec cp {} "${dst}/" \;
echo "dst=${dst}" >> "$GITHUB_OUTPUT"
@@ -167,21 +171,10 @@ jobs:
staged="${{ steps.stage.outputs.dst }}"
- # The benchmark run takes 2-3 hours, so by the time we get here our
- # checkout is almost always behind main. Sync to whatever main looks
- # like *right now* before committing.
- #
- # CRITICAL: previously this was just `git reset --hard origin/main`,
- # which assumed the staged dir contained only untracked new files.
- # That assumption breaks when an earlier dispatch today already
- # committed `benchmarks/results/<date>/` — our re-rendered charts +
- # summary.md become tracked-but-modified, and `reset --hard` reverts
- # them to the old (incomplete) versions. Only the genuinely-new
- # JSON survives, producing a misleading partial commit.
- #
- # Fix: copy the staged dir aside, reset to main, then restore. Our
- # versions always win on conflict, which is what we want — they
- # reflect the union of all matrix entries that have run today.
+ # Copy our staged data aside before touching git state. We always
+ # need to restore it after `reset --hard` regardless of what main
+ # currently has at `latest/` — this dispatch's data is the new
+ # source of truth.
tmp_staged="$(mktemp -d)/staged"
cp -a "${staged}" "${tmp_staged}"
@@ -189,14 +182,21 @@ jobs:
git fetch origin main
git reset --hard origin/main
+ # Wipe whatever main had at `latest/` (probably a prior dispatch's
+ # results) and replace it with this dispatch's full output. Using
+ # rm + cp + `git add -A` so deletions are captured: if the prior
+ # commit had `ccx33-pgch-metrics.json` but this dispatch only ran
+ # sqlite, the pgch JSON gets staged for deletion. The committed
+ # `latest/` always reflects exactly one dispatch, never a union.
+ rm -rf "${staged}"
mkdir -p "${staged}"
cp -a "${tmp_staged}/." "${staged}/"
rm -rf "${tmp_staged%/staged}"
- git add "${staged}"
+ git add -A "${staged}"
if git diff --cached --quiet; then
echo "nothing to commit"
exit 0
fi
- git commit -m "bench: hardware benchmark $(date -u +%Y-%m-%d)"
+ git commit -m "bench: hardware benchmark $(date -u +%Y-%m-%d) (latest)"
git push
diff --git a/benchmarks/README.md b/benchmarks/README.md
index b304570a..bf9ea3ef 100644
--- a/benchmarks/README.md
+++ b/benchmarks/README.md
@@ -156,8 +156,11 @@ works, the full matrix works.
```
4 tiers × 2 modes × 3 signals, default `--duration 30m`. Output goes to
-`benchmarks/results/<YYYY-MM-DD>-local/` — the `-local` suffix exists so
-dev runs never get confused with CI runs and never get accidentally committed.
+`benchmarks/results/latest-local/`, which is wiped at the start of every
+run so each dispatch's output stands alone — no silent cross-run mixing
+that the old date-folder layout produced. The `-local` suffix keeps dev
+runs separate from the committed `latest/` so you don't accidentally
+clobber CI's data.
### Other useful invocations
@@ -195,8 +198,14 @@ Required GitHub secrets:
`benchmark-key`.
After the matrix completes, an `aggregate` job downloads all artifacts, runs
-`chart.py`, and commits `benchmarks/results/<YYYY-MM-DD>/` to `main` via a bot
-commit. No PR — it's a generated artifact.
+`chart.py`, and commits `benchmarks/results/latest/` to `main` via a bot
+commit (`git add -A`, so files from a prior dispatch that aren't in this one
+get staged for deletion). No PR — it's a generated artifact. **The
+committed `latest/` always reflects exactly one dispatch**; comparing to
+previous runs is `git log -- benchmarks/results/latest/` or
+`git show <sha>:benchmarks/results/latest/summary.md`. Dated historical
+folders (`benchmarks/results/2026-05-15/` etc.) from before this layout
+change are kept in git for reference but are no longer written to.
## Running against managed ClickHouse
diff --git a/benchmarks/scripts/run-local.sh b/benchmarks/scripts/run-local.sh
index 7c161d06..ef1d9dae 100755
--- a/benchmarks/scripts/run-local.sh
+++ b/benchmarks/scripts/run-local.sh
@@ -67,12 +67,18 @@ fi
export BENCH_MODES_PLAN="${MODES}"
"${SCRIPT_DIR}/preflight.sh"
-date_tag="$(date -u +%Y-%m-%d)"
+# Single, dispatch-scoped results folder. Wiped at the start so each run's
+# committed output reflects only that run's matrix entries — no
+# cross-dispatch mixing (which was the failure mode of the date-folder
+# layout: two dispatches landing on the same day silently combined into one
+# summary.md). Cross-run comparison happens via `git log`, not adjacent
+# folders.
if [[ "${COMMIT}" -eq 1 ]]; then
- OUT_DIR="${REPO_ROOT}/benchmarks/results/${date_tag}"
+ OUT_DIR="${REPO_ROOT}/benchmarks/results/latest"
else
- OUT_DIR="${REPO_ROOT}/benchmarks/results/${date_tag}-local"
+ OUT_DIR="${REPO_ROOT}/benchmarks/results/latest-local"
fi
+rm -rf "${OUT_DIR}"
mkdir -p "${OUT_DIR}"
echo "results dir: ${OUT_DIR}" >&2