From 60d2eef795501904cf7271c90497ca8ab0b1c65b Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Tue, 17 Feb 2026 11:15:45 -0500 Subject: [PATCH 01/10] ci: Deploy bench results with bencher.dev --- .github/workflows/compile.yml | 36 +++++++++++++++++++++++++++++++---- Ix/Cli/CompileCmd.lean | 2 ++ 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 09cb7857..64d0ff55 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -2,7 +2,7 @@ name: Benchmark Ix compiler on: push: - branches: main + branches: sb/bench-compiler workflow_dispatch: permissions: @@ -61,7 +61,7 @@ jobs: with: lake-package-directory: ${{ env.COMPILE_DIR }} build: false - use-github-cache: false + use-github-cache: false # FLT and FC take a few minutes to rebuild, so we cache the build artifacts - if: matrix.cache_pkg uses: actions/cache@v4 @@ -73,5 +73,33 @@ jobs: - run: lake build Compile${{ matrix.bench }} working-directory: ${{ env.COMPILE_DIR }} # Run the `ix` compiler over the input library env - - run: ix compile --path ${{ env.COMPILE_DIR }}/Compile${{ matrix.bench }}.lean - + - name: Run ix compile + run: ix compile --path ${{ env.COMPILE_DIR }}/Compile${{ matrix.bench }}.lean 2>&1 | tee output.txt + # Parse the ##benchmark## line into Bencher Metric Format JSON + - name: Generate benchmark JSON + run: | + line=$(grep '^##benchmark##' output.txt) + elapsed_ms=$(echo "$line" | awk '{print $2}') + bytes=$(echo "$line" | awk '{print $3}') + constants=$(echo "$line" | awk '{print $4}') + cat > benchmark.json < Date: Tue, 17 Feb 2026 11:36:10 -0500 Subject: [PATCH 02/10] Fix units --- .github/workflows/compile.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 64d0ff55..9ae06e3a 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -7,6 +7,7 @@ on: permissions: contents: read + checks: write concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -79,14 +80,14 @@ jobs: - name: Generate benchmark JSON run: | line=$(grep '^##benchmark##' output.txt) - elapsed_ms=$(echo "$line" | awk '{print $2}') + elapsed_s=$(echo "$line" | awk '{printf "%.3f", $2 / 1000}') bytes=$(echo "$line" | awk '{print $3}') constants=$(echo "$line" | awk '{print $4}') cat > benchmark.json < Date: Tue, 17 Feb 2026 12:05:20 -0500 Subject: [PATCH 03/10] Test --- .github/workflows/compile.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 9ae06e3a..90d0c696 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -92,6 +92,7 @@ jobs: } } EOF + # Deploy benchmark results to https://bencher.dev/console/projects/ix/plots - uses: bencherdev/bencher@main - name: Track benchmarks run: | From dcd8a59590cbf719adcd2f61dac47b85ac47a5c4 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Tue, 17 Feb 2026 12:10:35 -0500 Subject: [PATCH 04/10] Measure throughput --- .github/workflows/compile.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 90d0c696..3edc1499 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -9,10 +9,6 @@ permissions: contents: read checks: write -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - env: COMPILE_DIR: Benchmarks/Compile @@ -83,11 +79,13 @@ jobs: elapsed_s=$(echo "$line" | awk '{printf "%.3f", $2 / 1000}') bytes=$(echo "$line" | awk '{print $3}') constants=$(echo "$line" | awk '{print $4}') + throughput=$(echo "$line" | awk '{if ($2 > 0) printf "%.2f", $3 * 1000 / $2; else print 0}') cat > benchmark.json < Date: Tue, 17 Feb 2026 12:32:59 -0500 Subject: [PATCH 05/10] Add threshold log_normal test --- .github/workflows/compile.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 3edc1499..f899a963 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -103,4 +103,9 @@ jobs: --adapter json \ --err \ --github-actions '${{ secrets.GITHUB_TOKEN }}' \ + --threshold-measure build-time \ + --threshold-test log_normal \ + --threshold-max-sample-size 64 \ + --threshold-upper-boundary 0.95 \ + --thresholds-reset \ --file benchmark.json From c5bb750b9c945530149c47b2564fbe86c33f3f80 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Tue, 17 Feb 2026 13:43:00 -0500 Subject: [PATCH 06/10] Add thresholds for throughput, file-size --- .github/workflows/compile.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index f899a963..a63fe6b4 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -107,5 +107,16 @@ jobs: --threshold-test log_normal \ --threshold-max-sample-size 64 \ --threshold-upper-boundary 0.95 \ + --threshold-lower-boundary _ \ + --threshold-measure throughput \ + --threshold-test log_normal \ + --threshold-max-sample-size 64 \ + --threshold-upper-boundary _ \ + --threshold-lower-boundary 0.95 \ + --threshold-measure file-size \ + --threshold-test percentage \ + --threshold-max-sample-size 64 \ + --threshold-upper-boundary 0.10 \ + --threshold-lower-boundary _ \ --thresholds-reset \ --file benchmark.json From 614a56c2007c45d15de58ee156cc4c0a5202afe5 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Tue, 17 Feb 2026 13:48:58 -0500 Subject: [PATCH 07/10] Threshold for constants --- .github/workflows/compile.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index a63fe6b4..8e441c51 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -118,5 +118,10 @@ jobs: --threshold-max-sample-size 64 \ --threshold-upper-boundary 0.10 \ --threshold-lower-boundary _ \ + --threshold-measure constants \ + --threshold-test percentage \ + --threshold-max-sample-size 64 \ + --threshold-upper-boundary 0.10 \ + --threshold-lower-boundary _ \ --thresholds-reset \ --file benchmark.json From 3c043b533b2acb68703b92c499d03c5fa1e126c9 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Tue, 17 Feb 2026 14:00:48 -0500 Subject: [PATCH 08/10] Prep for review --- .github/workflows/compile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 8e441c51..0ba1c1cb 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -2,7 +2,7 @@ name: Benchmark Ix compiler on: push: - branches: sb/bench-compiler + branches: main workflow_dispatch: permissions: From b5dfefb0a616921b93e0ed525b779b7cba2546d3 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Tue, 17 Feb 2026 14:36:45 -0500 Subject: [PATCH 09/10] Increase Nix CI runner size --- .github/workflows/nix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index cb4d4747..6eff54f5 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -17,7 +17,7 @@ jobs: # Runs Lean tests via Nix nix-test: name: Nix Tests - runs-on: ubuntu-latest + runs-on: warp-ubuntu-latest-x64-8x steps: - uses: actions/checkout@v5 - uses: cachix/install-nix-action@v31 From 81eeb60b4ef2214d714432c396ef22f32a901c16 Mon Sep 17 00:00:00 2001 From: samuelburnham <45365069+samuelburnham@users.noreply.github.com> Date: Wed, 18 Feb 2026 18:41:40 -0500 Subject: [PATCH 10/10] Fix throughput and update Readme --- .github/workflows/compile.yml | 2 +- README.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 0ba1c1cb..f5aa4932 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -79,7 +79,7 @@ jobs: elapsed_s=$(echo "$line" | awk '{printf "%.3f", $2 / 1000}') bytes=$(echo "$line" | awk '{print $3}') constants=$(echo "$line" | awk '{print $4}') - throughput=$(echo "$line" | awk '{if ($2 > 0) printf "%.2f", $3 * 1000 / $2; else print 0}') + throughput=$(echo "$line" | awk '{if ($2 > 0) printf "%.2f", $4 * 1000 / $2; else print 0}') cat > benchmark.json <