Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 40 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,50 @@ on:
branches: [master]
pull_request:
workflow_dispatch:
inputs:
clojure_rs_sha:
description: 'Pin clojure-rs to this revision instead of master HEAD (40-char SHA; empty = float)'
required: false
default: ''

# Test data (recipes superproject resource/shared) ships as an encrypted
# bundle, tests/resources.tar.xz.asc (tar.xz, AES-256, ASCII-armored).
# The passphrase lives in the RESOURCES_PASSPHRASE repository secret.
# To rotate: run `snip bundle` with a fresh passphrase and set
# the secret to the same value (see `snip bundle --help`).

env:
# Pinned clojure-rs revision for the perf-callgrind native leg
# (interpreter-only build; `run` needs no LLVM). Bump
# deliberately: the sweep diff-gates every case, so a bad pin
# fails loudly, and Bencher shows the perf delta. Currently the
# #209 perf-gap fixes (2-20x faster), validated locally with
# byte-identical outputs before pinning.
CLOJURE_RS_SHA: 7e13b3e799f830d086e47636386e6383af6384c9
# The perf-callgrind native leg always builds clojure-rs master HEAD
# (interpreter-only build; `run` needs no LLVM), resolved once per
# run by the resolve-rs job below. A bad upstream commit fails
# loudly (the sweep diff-gates every case), and Bencher shows the
# delta; to bisect or repro, dispatch manually with `clojure_rs_sha`.

jobs:
# Resolve the clojure-rs revision ONCE per run so all 16 sweep
# legs build the same commit even if upstream master moves
# mid-sweep (a ~6h window). Default: master HEAD (float); a
# manual dispatch may pin `clojure_rs_sha` instead.
resolve-rs:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
sha: ${{ steps.resolve.outputs.sha }}
steps:
- id: resolve
run: |
if [ -n "${{ inputs.clojure_rs_sha }}" ]; then
sha="${{ inputs.clojure_rs_sha }}"
echo "using dispatch-pinned revision"
else
sha=$(git ls-remote https://github.com/hhh-pa/clojure HEAD | awk '{print $1}')
fi
if ! printf '%s' "$sha" | grep -Eq '^[0-9a-f]{40}$'; then
echo "error: resolved clojure-rs revision is not a 40-char SHA: '$sha'" >&2
exit 1
fi
echo "sha=$sha" >> "$GITHUB_OUTPUT"
echo "clojure-rs revision: \`$sha\`" >> "$GITHUB_STEP_SUMMARY"
test-shard:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -100,7 +127,7 @@ jobs:
# A valgrind/toolchain failure fails the push (unlike the
# pilot): the sweep is a required signal.
perf-callgrind:
needs: test
needs: [test, resolve-rs]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -151,9 +178,9 @@ jobs:

# clojure-rs leg: interpreter-only release build (no LLVM:
# `run` needs just the interpreter crates). The revision is
# pinned in CLOJURE_RS_SHA (see the workflow env); bump it
# deliberately — the sweep diff-gates every case, so a bad
# pin fails loudly, and Bencher shows the perf delta.
# master HEAD resolved once per run (see resolve-rs); the
# sweep diff-gates every case, so a bad upstream commit fails
# loudly, and Bencher shows the perf delta.
- name: Install Rust toolchain
if: matrix.runtime == 'clojure-rs'
uses: dtolnay/rust-toolchain@stable
Expand All @@ -163,7 +190,7 @@ jobs:
uses: actions/checkout@v7
with:
repository: hhh-pa/clojure
ref: ${{ env.CLOJURE_RS_SHA }}
ref: ${{ needs.resolve-rs.outputs.sha }}
path: clojure-rs

- name: Cache cargo build
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,12 @@ Each compiler is a Bencher testbed (`ubuntu-latest-jvm` for JVM
Clojure, `ubuntu-latest-clojure-rs` for the Rust port);
benchmark names stay identical across compilers, so overlay the
testbeds on Bencher's perf page to compare them visually. The
clojure-rs revision is pinned in the workflow's `CLOJURE_RS_SHA`
env (interpreter-only `cargo build --release --locked
--no-default-features` — `run` needs no LLVM); bump it
deliberately, since the sweep diff-gates every case and Bencher
shows the delta. To add a compiler:
native leg always builds clojure-rs master HEAD (resolved once
per run so all 16 legs share one revision; interpreter-only
`cargo build --release --locked --no-default-features` — `run`
needs no LLVM), since the sweep diff-gates every case and
Bencher shows the delta; a manual dispatch may pin
`clojure_rs_sha` to bisect or repro. To add a compiler:

1. Add a `runtime` entry in `.github/workflows/test.yml`
(perf-callgrind + report-callgrind matrices, testbed
Expand Down
Loading