Skip to content

Commit 17b314c

Browse files
committed
Merge remote-tracking branch 'origin/merge-train/barretenberg' into lde/circuit-to-polys
2 parents 711c7c8 + 47cf864 commit 17b314c

165 files changed

Lines changed: 10162 additions & 6506 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docs-typesense.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,43 @@ jobs:
3434
# regression (which happened with #22861 dropping the index from
3535
# ~12k to 48 records) into a loud CI failure.
3636
MIN_HITS: "5000"
37+
TYPESENSE_API_KEY: ${{ secrets.TYPESENSE_API_KEY }}
38+
TYPESENSE_HOST: ${{ secrets.TYPESENSE_HOST }}
3739
run: |
38-
set -o pipefail
40+
set -euo pipefail
41+
3942
docker run \
40-
-e "TYPESENSE_API_KEY=${{ secrets.TYPESENSE_API_KEY }}" \
41-
-e "TYPESENSE_HOST=${{ secrets.TYPESENSE_HOST }}" \
43+
-e "TYPESENSE_API_KEY=$TYPESENSE_API_KEY" \
44+
-e "TYPESENSE_HOST=$TYPESENSE_HOST" \
4245
-e "TYPESENSE_PORT=443" \
4346
-e "TYPESENSE_PROTOCOL=https" \
44-
-e "CONFIG=$(cat docs/typesense.config.json | jq -r tostring)" \
47+
-e "CONFIG=$(cat docs/typesense.config.json)" \
4548
typesense/docsearch-scraper:0.11.0 2>&1 | tee scraper.log
4649
4750
nb_hits=$(grep -oE 'Nb hits: *[0-9]+' scraper.log | tail -1 | grep -oE '[0-9]+' || true)
4851
if [ -z "$nb_hits" ]; then
49-
echo "::error::Could not parse 'Nb hits' from scraper output assuming index is broken."
52+
echo "::error::Could not parse 'Nb hits' from scraper output, assuming index is broken."
5053
exit 1
5154
fi
5255
echo "Indexed $nb_hits records (threshold: $MIN_HITS)"
5356
if [ "$nb_hits" -lt "$MIN_HITS" ]; then
5457
echo "::error::Indexed only $nb_hits records (expected at least $MIN_HITS). Search index is likely broken."
5558
exit 1
5659
fi
60+
61+
# Log how many api-nr records are visible in the live index. The
62+
# docusaurus theme always prepends `default` to its contextual
63+
# docusaurus_tag filter, and no docusaurus page is stamped with
64+
# `default` (each carries its plugin-context tag instead), so this
65+
# facet count is effectively the count of indexed api-nr records.
66+
# Informational only: the count varies with aztec-nr content size.
67+
api_hits=$(curl -fsS \
68+
"https://$TYPESENSE_HOST/collections/aztec-docs/documents/search" \
69+
-H "X-TYPESENSE-API-KEY: $TYPESENSE_API_KEY" \
70+
-G \
71+
--data-urlencode "q=*" \
72+
--data-urlencode "query_by=hierarchy.lvl0" \
73+
--data-urlencode "filter_by=docusaurus_tag:=[default]&&language:=en" \
74+
--data-urlencode "per_page=1" \
75+
| jq -r '.found')
76+
echo "api-nr records visible under docusaurus_tag:=[default]: $api_hits"

.test_patterns.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ tests:
6060
error_regex: "Aborted.*core dumped"
6161
owners:
6262
- *adam
63-
- regex: "barretenberg/cpp/scripts/run_bench.sh wasm bb-micro-bench/wasm/chonk build-wasm-threads/bin/chonk_bench"
64-
owners:
65-
- *luke
6663

6764
# noir
6865
# Something to do with how I run the tests now. Think these are fine in nextest.
@@ -297,11 +294,6 @@ tests:
297294
owners:
298295
- *palla
299296

300-
- regex: "bb-micro-bench/wasm/chonk build-wasm-threads/bin/chonk_bench"
301-
error_regex: "core dumped"
302-
owners:
303-
- *adam
304-
305297
- regex: "src/e2e_token_bridge_tutorial.test.ts"
306298
error_regex: "Error: Unable to find low leaf for block"
307299
owners:

CLAUDE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@ Do not explain *what* the code does — well-named identifiers cover that. Comme
107107
Do not reference the current task, PR, caller, or author (`// used by X`, `// fix for issue #123`, `// AI-generated`), and do not add banner-style section comments (`// ===== HELPERS =====`). Both rot the moment the surrounding code is moved.
108108
</writing_comments>
109109

110+
<jargon>
111+
Avoid recurring AI-isms in chat replies, PR descriptions, commit messages, code comments, and docs. Substitutes:
112+
113+
- **"load bearing"***important*, *critical*, *required*, or describe the actual dependency (e.g. "the scheduler relies on this invariant").
114+
- **"seam"** (for an interaction point or boundary) → *interface*, *boundary*, *call site*, *integration point*.
115+
- **"north star"***goal*, *main goal*, *objective*.
116+
- **"sharpening"** (for adding detail or refining wording) → *clarifying*, *adding detail*, *tightening*, *refining*.
117+
- **"You're absolutely right"** and effusive agreement openers (*"Great catch!"*, *"Excellent point!"*) → never lead a reply with these. A short acknowledgement (*"Right — …"*, *"Agreed."*) is fine, and a closing *"you're right"* at the end of a long reply is acceptable when warranted. Lead with substance, not validation.
118+
</jargon>
119+
110120
<attribution>
111121
Attribute work to the git author, not to Claude. Do not add `Co-Authored-By: Claude` trailers or `Generated with Claude Code` in PR descriptions. The git author (from `git config user.name`) is the author of record.
112122
</attribution>

barretenberg/.claude/skills/benchmark-chonk/SKILL.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,9 @@ argument-hint: <action> e.g. "run", "compare", "wasm", "instrument <area>", "per
66

77
# Benchmark Chonk
88

9-
Run realistic Chonk IVC benchmarks using **pinned protocol inputs** (real transaction flows captured from end-to-end tests), not the synthetic `chonk_bench` target. The synthetic benchmark (`chonk_bench`) uses trivially small mock circuits — it is useful for quick regression checks but does NOT reflect production proving performance. Users invoking `/benchmark-chonk` want the real thing.
9+
Run realistic Chonk IVC benchmarks using **pinned protocol inputs** (real transaction flows captured from end-to-end tests).
1010

11-
## What makes this different from `chonk_bench`
12-
13-
| | `chonk_bench` (synthetic) | This skill (realistic) |
14-
|---|---|---|
15-
| Input data | Mock circuits via `test_bench_shared.hpp` | Pinned msgpack from real Aztec transactions |
16-
| Circuit count | 2 or 5 tiny circuits | Full transaction flows (10+ circuits) |
17-
| Circuit variety | All identical | Mixed: app, kernel, tail, public |
18-
| BB command | `./chonk_bench --benchmark_filter=...` | `bb prove --scheme chonk --ivc_inputs_path ...` |
11+
**Chonk has no synthetic micro-benchmark.** Past attempts (`chonk_bench`) used trivially small mock circuits and produced misleading numbers — the target was deleted to prevent regression of that mistake. Always benchmark Chonk via `bb prove --scheme chonk` against pinned `ivc-inputs.msgpack` for real transaction flows. If a Chonk proving question seems to call for a micro-benchmark, the answer is still `bb prove` on a real flow.
1912

2013
## Step 1: Get pinned IVC inputs
2114

@@ -158,7 +151,7 @@ The macros create `BenchReporter` RAII objects that:
158151
159152
### Google Benchmark integration
160153
161-
For `chonk_bench` and other `.bench.cpp` targets:
154+
For `.bench.cpp` targets that integrate BB_BENCH into Google Benchmark counters:
162155
```cpp
163156
#include "barretenberg/common/google_bb_bench.hpp"
164157
@@ -275,15 +268,15 @@ python3 barretenberg/cpp/scripts/extract_component_benchmarks.py <output_dir> <n
275268

276269
This reads `benchmark_breakdown.json`, finds operations matching key components (sumcheck, pcs, pippenger, commitment, circuit, oink, compute), and appends them to `benchmarks.bench.json` with stacked chart markers for the dashboard.
277270

278-
## A/B comparison scripts
271+
## A/B comparison
272+
273+
For Chonk A/B between branches, run `bb prove --scheme chonk` against the same pinned `ivc-inputs.msgpack` on each branch and compare the resulting `--bench_out_hierarchical` JSON manually. Use the **remote machine** (`/remote-bench`) for stable, single-run numbers.
279274

280-
These use Google Benchmark's `compare.py` for statistical analysis. Note: these use the **remote machine** — see `/remote-bench`.
275+
The generic Google-Benchmark A/B scripts still exist for non-Chonk targets:
281276

282277
| Script | What it compares |
283278
|--------|-----------------|
284-
| `scripts/compare_chonk_bench.sh` | Native ChonkBench/Full/6, branch vs baseline |
285-
| `scripts/compare_chonk_bench_wasm.sh` | WASM ChonkBench/Full/6, branch vs baseline |
286-
| `scripts/compare_branch_vs_baseline_remote.sh` | Generic native A/B |
279+
| `scripts/compare_branch_vs_baseline_remote.sh` | Generic native A/B (any `*_bench` target) |
287280
| `scripts/compare_branch_vs_baseline_remote_wasm.sh` | Generic WASM A/B |
288281

289282
## Key scripts reference
@@ -293,7 +286,6 @@ These use Google Benchmark's `compare.py` for statistical analysis. Note: these
293286
| `scripts/test_chonk_standalone_vks_havent_changed.sh` | Download/update/verify pinned inputs |
294287
| `scripts/ci_benchmark_ivc_flows.sh` | CI: proves a flow, extracts components, uploads to dashboard |
295288
| `scripts/benchmark_example_ivc_flow_remote.sh` | Proves a pinned flow on the remote machine (uses `/remote-bench`) |
296-
| `scripts/benchmark_chonk.sh` | Synthetic `chonk_bench` on remote |
297289
| `scripts/wasmtime.sh` | wasmtime wrapper with standard flags |
298290
| `scripts/extract_component_benchmarks.py` | Extract component timings from hierarchical breakdown |
299291

@@ -307,7 +299,7 @@ These use Google Benchmark's `compare.py` for statistical analysis. Note: these
307299
- **WASM preset:** `wasm-threads`. Build dir is `build-wasm-threads/`. The preset enables `ENABLE_WASM_BENCH=ON` automatically.
308300
- **WASM is ~2.8x slower than native** — this ratio is consistent across all circuit types.
309301
- **CRS:** Ensure `~/.bb-crs` exists. For WASM, wasmtime needs `--dir=$HOME/.bb-crs`.
310-
- **`BB_BENCH=1` vs `--print_bench`:** Either activates profiling. `--print_bench` also triggers the hierarchical tree output to stderr. In `chonk_bench`, the `GOOGLE_BB_BENCH_REPORTER` macro enables it automatically when `BB_BENCH=1` is set.
302+
- **`BB_BENCH=1` vs `--print_bench`:** Either activates profiling. `--print_bench` also triggers the hierarchical tree output to stderr. In Google-Benchmark targets that wrap their loops with `GOOGLE_BB_BENCH_REPORTER`, the same activation happens automatically when `BB_BENCH=1` is set.
311303
- **Dashboard:** CI uploads breakdown data to `bench/bb-breakdown/` on S3. The dashboard at `ci3/dashboard/chonk-breakdowns/` visualizes it.
312304
- **Rebuilding after instrumentation changes:** Only `ninja bb` is needed — no need to reconfigure.
313305

barretenberg/.claude/skills/remote-bench/SKILL.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: remote-bench
33
description: Run benchmarks on the dedicated remote EC2 benchmarking machine for noise-free, single-run results. Handles env var validation, lock management, binary transfer, and result collection. Use with /benchmark-chonk or any BB benchmark target.
4-
argument-hint: <target> e.g. "bb", "chonk_bench", "ultra_honk_bench", "wasm bb"
4+
argument-hint: <target> e.g. "bb", "ultra_honk_bench", "wasm bb"
55
---
66

77
# Remote Bench
@@ -95,7 +95,7 @@ The standard flow used by `scripts/benchmark_remote.sh`:
9595
```bash
9696
cd barretenberg/cpp
9797

98-
BENCHMARK="bb" # or chonk_bench, ultra_honk_bench, etc.
98+
BENCHMARK="bb" # or ultra_honk_bench, etc. (Chonk: use bb with --scheme chonk on real example flows — there is no synthetic chonk benchmark)
9999
PRESET="clang20-no-avm" # or clang20
100100
BUILD_DIR="build-no-avm" # matches preset
101101

@@ -204,14 +204,14 @@ Compare current branch vs baseline (builds and runs both on remote):
204204

205205
```bash
206206
# Native
207-
./scripts/compare_chonk_bench.sh # ChonkBench/Full/6
208207
./scripts/compare_branch_vs_baseline_remote.sh <target> '<filter>'
209208

210209
# WASM
211-
./scripts/compare_chonk_bench_wasm.sh # ChonkBench/Full/6
212210
./scripts/compare_branch_vs_baseline_remote_wasm.sh <target> '<filter>'
213211
```
214212

213+
For Chonk A/B, do not use a synthetic benchmark — measure `bb prove --scheme chonk` against pinned `ivc-inputs.msgpack` for both branches and compare manually.
214+
215215
These use Google Benchmark's `compare.py` for statistical analysis. Note: comparison scripts check out the baseline branch locally, so your working tree must be clean.
216216

217217
## Scripts reference
@@ -220,10 +220,7 @@ These use Google Benchmark's `compare.py` for statistical analysis. Note: compar
220220
|--------|---------|
221221
| `scripts/benchmark_remote.sh` | Generic: build locally, scp, run remotely |
222222
| `scripts/benchmark_wasm_remote.sh` | Same for WASM (wasmtime on remote) |
223-
| `scripts/benchmark_example_ivc_flow_remote.sh` | Chonk with pinned inputs on remote |
224-
| `scripts/benchmark_chonk.sh` | Synthetic chonk_bench on remote |
225-
| `scripts/compare_chonk_bench.sh` | A/B native comparison |
226-
| `scripts/compare_chonk_bench_wasm.sh` | A/B WASM comparison |
223+
| `scripts/benchmark_example_ivc_flow_remote.sh` | Chonk with pinned inputs on remote (the only realistic Chonk bench) |
227224
| `scripts/compare_branch_vs_baseline_remote.sh` | Generic A/B native |
228225
| `scripts/compare_branch_vs_baseline_remote_wasm.sh` | Generic A/B WASM |
229226
| `scripts/_benchmark_remote_lock.sh` | Lock mechanism (source it, don't run it) |

barretenberg/bbup/bb-versions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"1.0.0-beta.21": "5.0.0-nightly.20260324",
23
"1.0.0-beta.20": "5.0.0-nightly.20260324",
34
"1.0.0-beta.19": "4.0.0-nightly.20260120",
45
"1.0.0-beta.18": "3.0.0-nightly.20260102",

barretenberg/cpp/CMakePresets.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,6 @@
788788
"barretenberg-debug.wasm",
789789
"ecc_tests",
790790
"ultra_honk_bench",
791-
"chonk_bench",
792791
"bb"
793792
]
794793
},

barretenberg/cpp/bootstrap.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,8 @@ function bench_cmds {
324324
prefix="$hash:CPUS=8"
325325
echo "$prefix barretenberg/cpp/scripts/run_bench.sh native bb-micro-bench/native/ultra_honk $native_build_dir/bin/ultra_honk_bench construct_proof_ultrahonk_power_of_2/20$"
326326
echo "$prefix barretenberg/cpp/scripts/run_bench.sh native bb-micro-bench/native/ultra_honk_zk $native_build_dir/bin/ultra_honk_bench construct_proof_ultrahonk_zk_power_of_2/20$"
327-
echo "$prefix barretenberg/cpp/scripts/run_bench.sh native bb-micro-bench/native/chonk $native_build_dir/bin/chonk_bench ChonkBench/Full/5$"
328327
echo "$prefix barretenberg/cpp/scripts/run_bench.sh wasm bb-micro-bench/wasm/ultra_honk build-wasm-threads/bin/ultra_honk_bench construct_proof_ultrahonk_power_of_2/20$"
329328
echo "$prefix barretenberg/cpp/scripts/run_bench.sh wasm bb-micro-bench/wasm/ultra_honk_zk build-wasm-threads/bin/ultra_honk_bench construct_proof_ultrahonk_zk_power_of_2/20$"
330-
echo "$prefix barretenberg/cpp/scripts/run_bench.sh wasm bb-micro-bench/wasm/chonk build-wasm-threads/bin/chonk_bench ChonkBench/Full/5$"
331-
prefix="$hash:CPUS=1"
332-
echo "$prefix barretenberg/cpp/scripts/run_bench.sh native bb-micro-bench/native/chonk_verify $native_build_dir/bin/chonk_bench VerificationOnly$"
333329
}
334330

335331
# Runs benchmarks sharded over machine cores.

barretenberg/cpp/scripts/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ There are scripts that:
2828
4. If `ssh` worked, the setup is complete.
2929

3030
## How
31-
- `./scripts/benchmark_chonk.sh` lets you run `chonk_bench` remotely and analyze the results.
3231
- `./scripts/benchmark_example_ivc_flow_remote.sh` copies the example flow input you'd like to run to the remote machine, runs `bb prove`, and analyze the results.
3332
- For the script to work you need to have the example flows downloaded locally, by `AZTEC_CACHE_COMMIT=origin/next~3 FORCE_CACHE_DOWNLOAD=1 yarn-project/end-to-end/bootstrap.sh build_bench`
3433
- If you have other special needs, look inside the above scripts and see what parameters you can give, or use `./scripts/benchmark_remote.sh`.
34+
35+
Chonk proving must always be measured on real example app flows via `benchmark_example_ivc_flow_remote.sh` — there is no synthetic chonk benchmark, and there should not be one. Running synthetic Chonk benchmarks gives misleading numbers because the mock circuits do not reflect production proving costs.

barretenberg/cpp/scripts/benchmark_chonk.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)