Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
525d596
benchcoin: add tooling
willcl-ark Dec 23, 2025
5098929
don't compare to master in prs
willcl-ark Jan 7, 2026
f996250
only run single bins in prs
willcl-ark Jan 7, 2026
5601b6a
rebase at 0100 GMT
willcl-ark Jan 8, 2026
82464f7
make charts taller
willcl-ark Jan 8, 2026
b21a5eb
update machine configs and charts
willcl-ark Jan 8, 2026
cc5af87
fix nightly chart display and machine spec detection
willcl-ark Jan 9, 2026
568e9ce
chart: make chart series dynamic and unique
willcl-ark Jan 9, 2026
1816173
rename history file
willcl-ark Jan 9, 2026
c765f2a
use better colours in charts
willcl-ark Jan 9, 2026
535e737
don't use inline html
willcl-ark Jan 10, 2026
2dd2fe5
use commit date in chart data points
willcl-ark Jan 12, 2026
c0a6576
use nix flake in both publish workflow steps
willcl-ark Jan 13, 2026
a86a69e
fix nightly-history mismatch
willcl-ark Jan 13, 2026
d2d8b5f
fix instrumented suffixes in reports
willcl-ark Jan 13, 2026
3d15490
add clickable plotly links
willcl-ark Jan 13, 2026
339a842
use corect path in index
willcl-ark Jan 13, 2026
14cbdcf
use scatter plot for leveldb compaction
willcl-ark Jan 14, 2026
16f4755
add debug logs to artifacts
willcl-ark Jan 14, 2026
df55f93
dynamic charts test
willcl-ark Jan 14, 2026
9512371
fix theme render order
willcl-ark Jan 14, 2026
382eb6b
add ruff and ty to flake
willcl-ark Jan 14, 2026
8cf7dfb
support a full IBD PR run
willcl-ark Jan 14, 2026
8eb6ac3
Generate static debug.log plots during report generation
willcl-ark Feb 24, 2026
707157a
Replace client-side debug.log charts with static images
willcl-ark Feb 24, 2026
c5d2226
Update bench/README.md to reflect current CLI interface
willcl-ark Feb 24, 2026
0ff4a81
Stop publishing debug.log.gz to gh-pages, link to CI artifacts instead
willcl-ark Feb 24, 2026
ec4a636
Wait for Pages deployment before commenting on PR
willcl-ark Feb 24, 2026
1292ec8
Sort PR results index numerically instead of lexicographically
willcl-ark Feb 24, 2026
103e02c
set prune height to 1_000_000MB
willcl-ark Feb 25, 2026
1049d94
Include prune in nightly chart series key
willcl-ark Feb 26, 2026
cb4af76
Fix numeric sort crash on pr-main directory
willcl-ark Feb 26, 2026
5ff3926
Restore debug log extraction for PNG plot generation
willcl-ark Feb 28, 2026
a8595e9
use local bitcoin node to test region network issues
willcl-ark Mar 4, 2026
bfe2ba9
pin nightly benchmark job order: 450 before 32000
willcl-ark Mar 5, 2026
5b6806e
run fstrim before each benchmark for consistent SSD performance
willcl-ark Mar 5, 2026
5716afd
Revert "use local bitcoin node to test region network issues"
willcl-ark Mar 5, 2026
9797c6c
fstrim the mount point, not a subdirectory
willcl-ark Mar 5, 2026
9b853c0
show manual nightly re-runs as scatter points on chart
willcl-ark Mar 6, 2026
47c150d
Compare PR benchmarks against median of last 7 nightly runs
willcl-ark Mar 13, 2026
52d9811
merge manual nightly runs into their series on the chart
willcl-ark Mar 13, 2026
2ebe507
Add assumevalid=0 benchmark runs to PR workflow
willcl-ark Mar 17, 2026
54bb7bf
nix: update flamegraph
willcl-ark May 29, 2026
aff898d
nix: bump nixpkgs
willcl-ark May 29, 2026
b03193a
bump flakegraph package hashes
willcl-ark May 29, 2026
5896183
bump GH actions versions
willcl-ark Jun 4, 2026
5a70651
Add experiment-driven benchmark runner
willcl-ark Jun 4, 2026
e7eb3f4
Retire matrix benchmark configs
willcl-ark Jun 4, 2026
6da4080
Add experiment artifact store
willcl-ark Jun 4, 2026
86006ee
Split experiment planning from execution
willcl-ark Jun 4, 2026
15b6044
Replace phase config with environments
willcl-ark Jun 4, 2026
235782f
Report from experiment artifacts
willcl-ark Jun 4, 2026
8f6a225
Isolate experiment subject resolution
willcl-ark Jun 4, 2026
c759034
Deepen benchmark CI result interfaces
willcl-ark Jun 4, 2026
6440e37
Load experiment artifacts through catalog
willcl-ark Jun 5, 2026
da0ff92
align times and runs
willcl-ark Jul 1, 2026
596c871
Increase nightly benchmark checkout depth
willcl-ark Jul 7, 2026
9d53531
Report experiment run times by config
willcl-ark Jul 8, 2026
b24644c
add dbcache-sigsize experiment
willcl-ark Jul 8, 2026
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
1 change: 1 addition & 0 deletions .github/README.md
48 changes: 48 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Benchmark
on:
pull_request:
branches:
- master

jobs:
benchmark:
runs-on: [self-hosted, linux, x64]
timeout-minutes: 1000
env:
ORIGINAL_DATADIR: /data/pruned-840k
steps:
- name: Checkout repo
uses: actions/checkout@v6
with:
fetch-depth: 1

- name: Run experiment
run: |
nix develop --command python3 bench.py experiment run \
bench/experiments/pr.toml \
--datadir $ORIGINAL_DATADIR \
--tmp-dir ${{ runner.temp }}/datadirs \
--binaries-dir ${{ runner.temp }}/binaries \
--output-dir ${{ runner.temp }}/experiment-output \
--skip-existing

- name: Upload experiment output
uses: actions/upload-artifact@v7
with:
name: experiment-output
path: ${{ runner.temp }}/experiment-output/

- name: Write context metadata
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
RUNNER_CONTEXT: ${{ toJSON(runner) }}
run: |
mkdir -p ${{ runner.temp }}/contexts
echo "$GITHUB_CONTEXT" | nix develop --command jq "del(.token)" > ${{ runner.temp }}/contexts/github.json
echo "$RUNNER_CONTEXT" > ${{ runner.temp }}/contexts/runner.json

- name: Upload context metadata
uses: actions/upload-artifact@v7
with:
name: run-metadata
path: ${{ runner.temp }}/contexts/
157 changes: 157 additions & 0 deletions .github/workflows/nightly-benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
name: Nightly Benchmark
on:
workflow_run:
workflows: ["Nightly Rebase"]
types: [completed]
workflow_dispatch:

jobs:
benchmark:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
runs-on: [self-hosted, linux, x64]
timeout-minutes: 1200
env:
ORIGINAL_DATADIR: /data/pruned-840k
steps:
- name: Checkout repo
uses: actions/checkout@v6
with:
fetch-depth: 200 # Need enough history for merge-base

- name: Get commit SHAs
run: |
# Bitcoin commit - find merge-base with upstream
git remote add upstream https://github.com/bitcoin/bitcoin.git
git fetch upstream master
BITCOIN_SHA=$(git merge-base HEAD upstream/master)
echo "BITCOIN_SHA=$BITCOIN_SHA" >> "$GITHUB_ENV"

# Get commit date for the Bitcoin commit (for chart X-axis)
COMMIT_DATE=$(git log -1 --format=%cd --date=short "$BITCOIN_SHA")
echo "COMMIT_DATE=$COMMIT_DATE" >> "$GITHUB_ENV"

echo "Benchcoin: $(git rev-parse HEAD)"
echo "Bitcoin merge-base: $BITCOIN_SHA"
echo "Commit date: $COMMIT_DATE"

- name: Run experiment
run: |
nix develop --command python3 bench.py experiment run \
bench/experiments/nightly.toml \
--datadir $ORIGINAL_DATADIR \
--tmp-dir ${{ runner.temp }}/datadirs \
--binaries-dir ${{ runner.temp }}/binaries \
--output-dir ${{ runner.temp }}/experiment-output \
--skip-existing

- name: Upload experiment output
uses: actions/upload-artifact@v7
with:
name: nightly-experiment-output
path: ${{ runner.temp }}/experiment-output/

- name: Upload commit info
run: |
echo "$BITCOIN_SHA" > ${{ runner.temp }}/commit.txt
echo "$COMMIT_DATE" > ${{ runner.temp }}/commit-date.txt

- uses: actions/upload-artifact@v7
with:
name: commit-info
path: |
${{ runner.temp }}/commit.txt
${{ runner.temp }}/commit-date.txt

- name: Capture machine specs
run: |
nix develop --command python3 -c "
from bench.machine import get_machine_specs
import json
print(json.dumps(get_machine_specs().to_dict()))
" > ${{ runner.temp }}/machine-specs.json

- name: Upload machine specs
uses: actions/upload-artifact@v7
with:
name: machine-specs
path: ${{ runner.temp }}/machine-specs.json

publish:
needs: benchmark
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout gh-pages
uses: actions/checkout@v6
with:
ref: gh-pages

- name: Checkout benchcoin tools
uses: actions/checkout@v6
with:
ref: master
path: benchcoin-tools

- name: Download commit info
uses: actions/download-artifact@v7
with:
name: commit-info
path: ./commit-info

- name: Download experiment output
uses: actions/download-artifact@v7
with:
name: nightly-experiment-output
path: ./nightly-experiment-output

- name: Download machine specs
uses: actions/download-artifact@v7
with:
name: machine-specs
path: ./machine-specs

- name: Install Nix
uses: cachix/install-nix-action@v31

- name: Get dates and trigger
run: |
# Commit date (for chart X-axis)
COMMIT_DATE=$(cat ./commit-info/commit-date.txt)
echo "COMMIT_DATE=$COMMIT_DATE" >> "$GITHUB_ENV"
# Run date (for reference)
echo "RUN_DATE=$(date -u +%Y-%m-%d)" >> "$GITHUB_ENV"
# Trigger type (scheduled nightly vs manual dispatch)
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "TRIGGER=manual" >> "$GITHUB_ENV"
else
echo "TRIGGER=scheduled" >> "$GITHUB_ENV"
fi

- name: Append results to history
run: |
COMMIT=$(cat ./commit-info/commit.txt)
nix develop ./benchcoin-tools --command python3 benchcoin-tools/bench.py nightly \
--history-file ./nightly-history.json \
append-experiment \
./nightly-experiment-output \
"$COMMIT" \
--date "$COMMIT_DATE" \
--run-date "$RUN_DATE" \
--trigger "$TRIGGER" \
--machine-specs ./machine-specs/machine-specs.json

- name: Generate chart
run: |
nix develop ./benchcoin-tools --command python3 benchcoin-tools/bench.py nightly \
--history-file ./nightly-history.json \
chart \
./index.html

- name: Commit and push to gh-pages
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add nightly-history.json index.html
git commit -m "Update nightly benchmark results for $COMMIT_DATE" || echo "No changes to commit"
git push origin gh-pages
139 changes: 139 additions & 0 deletions .github/workflows/publish-results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: Publish Results
on:
workflow_run:
workflows: ["Benchmark"]
types: [completed]
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
actions: read
contents: write
checks: read
outputs:
comparison: ${{ steps.generate.outputs.comparison }}
pr-number: ${{ steps.metadata.outputs.pr-number }}
result-url: ${{ steps.generate.outputs.result-url }}
pages-commit: ${{ steps.push-pages.outputs.pages-commit }}
steps:
- uses: actions/checkout@v6
with:
ref: gh-pages

- name: Checkout benchcoin tools
uses: actions/checkout@v6
with:
ref: master
path: benchcoin-tools

- name: Download artifacts
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh run download ${{ github.event.workflow_run.id }} --repo ${{ github.repository }}

- name: Extract metadata
run: |
if [ -d "run-metadata" ]; then
mkdir -p run-metadata-extracted
mv run-metadata/* run-metadata-extracted/
fi

- name: Read metadata
id: metadata
run: |
PR_NUMBER=$(jq -r '.event.pull_request.number // "main"' run-metadata-extracted/github.json)
RUN_ID=$(jq -r '.run_id' run-metadata-extracted/github.json)
HEAD_SHA=$(jq -r '.event.pull_request.head.sha // .sha' run-metadata-extracted/github.json)
echo "pr-number=${PR_NUMBER}" >> $GITHUB_OUTPUT
echo "run-id=${RUN_ID}" >> $GITHUB_OUTPUT
echo "head-sha=${HEAD_SHA}" >> $GITHUB_OUTPUT
echo "Found metadata: PR=${PR_NUMBER}, Run=${RUN_ID}, Commit=${HEAD_SHA}"

- name: Install Nix
uses: cachix/install-nix-action@v31

- name: Generate report
id: generate
env:
PR_NUMBER: ${{ steps.metadata.outputs.pr-number }}
RUN_ID: ${{ steps.metadata.outputs.run-id }}
HEAD_SHA: ${{ steps.metadata.outputs.head-sha }}
run: |
# Generate report with nightly comparison (use per-machine history file)
nix develop ./benchcoin-tools --command python3 benchcoin-tools/bench.py report \
--experiment-output "./experiment-output" \
--pr-number "${PR_NUMBER}" \
--run-id "${RUN_ID}" \
--commit "${HEAD_SHA}" \
--nightly-history "./nightly-history.json" \
--update-index \
"./results/pr-${PR_NUMBER}/${RUN_ID}"

COMPARISON=$(cat "./results/pr-${PR_NUMBER}/${RUN_ID}/summary.txt")
echo "comparison<<EOF" >> $GITHUB_OUTPUT
echo "${COMPARISON}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

RESULT_URL="https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/results/pr-${PR_NUMBER}/${RUN_ID}/index.html"
echo "result-url=${RESULT_URL}" >> $GITHUB_OUTPUT

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: results

- name: Commit and push to gh-pages
id: push-pages
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
# Note: Only add results/ directory, not root index.html
# The root index.html is managed by nightly-benchmark.yml
git add results/
git commit -m "Update benchmark results from run ${{ github.event.workflow_run.id }}"
git push origin gh-pages
echo "pages-commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT

wait-for-pages:
needs: build
runs-on: ubuntu-latest
steps:
- name: Wait for GitHub Pages deployment
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
COMMIT="${{ needs.build.outputs.pages-commit }}"
for i in $(seq 1 60); do
RUN_ID=$(gh run list -R "${{ github.repository }}" -w "pages-build-deployment" --commit "$COMMIT" -L 1 --json databaseId -q '.[0].databaseId')
if [ -n "$RUN_ID" ]; then
echo "Found pages-build-deployment run ${RUN_ID} for commit ${COMMIT}"
gh run watch "$RUN_ID" -R "${{ github.repository }}"
exit 0
fi
sleep 5
done
echo "::warning::Could not find pages-build-deployment run for commit ${COMMIT}"

comment-pr:
needs: [build, wait-for-pages]
runs-on: ubuntu-latest
permissions:
pull-requests: write
actions: read
steps:
- name: Comment on PR
if: ${{ needs.build.outputs.pr-number != 'main' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr comment ${{ needs.build.outputs.pr-number }} \
--repo ${{ github.repository }} \
--body "## Benchmark Results

**Comparison to nightly master (median of last 7 runs):**
- ${{ needs.build.outputs.comparison }}

[View detailed results](${{ needs.build.outputs.result-url }})
[View nightly trend chart](https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/)"
35 changes: 35 additions & 0 deletions .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Nightly Rebase

on:
schedule:
- cron: '0 1 * * *' # 01:00 GMT daily
workflow_dispatch: # manual trigger

permissions:
contents: write

jobs:
rebase:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: master
fetch-depth: 0 # Full history needed for rebase
token: ${{ secrets.REBASE_PAT }}

- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Add upstream and rebase
run: |
git remote add upstream https://github.com/bitcoin/bitcoin.git
git fetch upstream master
git rebase upstream/master

- name: Push changes
run: |
git push --force origin master
Loading