Skip to content

feat(bb): centralize Chonk pinning around one canonical tarball + auto-regen on VK-UPDATE#23228

Closed
AztecBot wants to merge 1 commit into
nextfrom
cb/37e2ad89ed12
Closed

feat(bb): centralize Chonk pinning around one canonical tarball + auto-regen on VK-UPDATE#23228
AztecBot wants to merge 1 commit into
nextfrom
cb/37e2ad89ed12

Conversation

@AztecBot

Copy link
Copy Markdown
Collaborator

Summary

Centralizes every Chonk benchmark and the VK consistency test around a single
pinned IVC-inputs tarball, decouples them from the slow e2e regen path, and
revives an auto-regenerate-on-VK-UPDATE: mechanism that pushes the new pin
back to the PR with [skip ci].

Today there are two parallel artifacts: bb-chonk-inputs-<hash>.tar.gz (S3,
hand-pinned, used only by the VK-consistency test) and
bb-chonk-captures-<hash>.tar.gz (CI cache, regenerated by build_bench
running the e2e client flows, consumed by every chonk benchmark). The
benchmarks therefore pay the full TS + e2e cost on every cache miss, and a VK
update is a manual --update_inputs + commit dance.

After this PR:

  • One canonical tarball, one pin file (barretenberg/cpp/scripts/chonk-inputs.hash).
  • yarn-project/end-to-end/bootstrap.sh build_bench default = download +
    extract pinned tarball. Set BUILD_BENCH_REGEN=1 to regenerate from
    scratch (used only by regenerate_chonk_inputs.sh).
  • VK-consistency test (test_chonk_standalone_vks_havent_changed.sh),
    in-browser memory bench, and ci_benchmark_ivc_flows.sh all consume
    example-app-ivc-inputs-out populated by the same pinned download via
    the shared chonk_inputs_lib.sh library.
  • ci-fast / ci-full now call scripts/ci_vk_update.sh on test failure;
    if the PR contains a VK-UPDATE: <reason> empty commit, CI runs
    regenerate_chonk_inputs.sh --push which builds bb (AVM=ON), regenerates
    inputs, proves+verifies each flow, uploads the new tarball, rewrites
    chonk-inputs.hash, rebases the pin commit onto the latest PR head, and
    pushes back with [skip ci] in the commit subject so CI does not loop.
  • Push handles concurrent commits via fetch → rebase → push with retry.
    The pin commit only ever touches one one-line file, so race conditions
    resolve cleanly.

Files

  • barretenberg/cpp/scripts/chonk-inputs.hash (new) — single source of truth.
  • barretenberg/cpp/scripts/chonk_inputs_lib.sh (new) — sourced helpers:
    chonk_inputs_hash, chonk_inputs_url, chonk_inputs_s3_uri,
    chonk_inputs_download, chonk_inputs_upload, chonk_inputs_set_pin.
  • barretenberg/cpp/scripts/regenerate_chonk_inputs.sh (new) — orchestrator
    with --no-commit | --commit | --push + --reason.
  • scripts/ci_vk_update.sh (new) — CI hook that detects VK-UPDATE: and
    invokes the orchestrator with --push.
  • barretenberg/cpp/scripts/test_chonk_standalone_vks_havent_changed.sh
    pin lookup now goes through the library; --update_inputs delegates to
    the orchestrator; failure message tells authors how to acknowledge.
  • yarn-project/end-to-end/bootstrap.shbuild_bench default is a tiny
    pinned-download; BUILD_BENCH_REGEN=1 keeps the slow e2e regen path.
  • bootstrap.shci-fast / ci-full invoke ci_vk_update.sh on test
    failure.
  • barretenberg/cpp/CLAUDE.md — documents the VK-UPDATE: workflow + new
    fast-path bootstrap behavior.

Design notes

  • The pin file is deliberately a separate one-line file rather than an inline
    variable in test_chonk_standalone_vks_havent_changed.sh. Hash bumps then
    produce a one-line diff and never perturb the script's own
    .rebuild_patterns hash (avoids the kind of rebuild race that chore: shrink msm test size while maintaining coverage #23226
    patched around).
  • The VK-UPDATE: convention is the user-facing trigger. There is no
    dedicated workflow file — the existing ci3.yml lane already gives us
    the right hook point.
  • [skip ci] is enforced in the commit subject so the auto-push cannot
    loop. CI on the next manual push picks up the new pin and the VK check
    passes.
  • chonk_inputs_download is idempotent and short-circuits when the
    destination already contains flow folders, so the bench engine can call
    it from many flows in parallel without re-downloading.

Follow-ups (out of scope)

  • Move Chonk flow benchmark emission out of yarn-project/end-to-end and
    into barretenberg/cpp/bootstrap.sh bench_cmds, with the input prep
    declared as a barretenberg-level Make dep. That would let chonk benches
    schedule in parallel with TS tests instead of waiting on the bench phase.
  • A /repin-chonk-inputs PR-comment trigger if the VK-UPDATE: empty-commit
    convention proves too awkward.

Test plan

  • bash -n on every touched / new script.
  • Functional sanity of chonk_inputs_lib.sh (hash/url/s3 helpers print the
    expected strings from the new pin file).
  • The standalone VK test, when run with the unchanged pinned hash, falls
    through to parallel … check_circuit_vks exactly as before; the only
    visible difference is the pin source.
  • CI on this PR exercises ci_vk_update.sh (no VK-UPDATE: commit → no-op).
  • A follow-up PR will land a VK-UPDATE: empty commit on an intentional VK
    change to validate the end-to-end auto-push path against current CI.

Created by claudebox · group: slackbot

@AztecBot AztecBot added ci-barretenberg Run all barretenberg/cpp checks. claudebox Owned by claudebox. it can push to this PR. labels May 13, 2026
@AztecBot

Copy link
Copy Markdown
Collaborator Author

Automatically closing this stale claudebox draft PR (no updates for 5+ days). Re-open if still needed.

@AztecBot AztecBot closed this May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-barretenberg Run all barretenberg/cpp checks. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant