feat(ci): refresh pinned barretenberg gate counts#23404
Draft
AztecBot wants to merge 2 commits into
Draft
Conversation
Ports the Chonk inputs refresh workflow proposal from https://gist.github.com/ludamad/7fbd491753b17f4f9c94f0c7875de906 Source proposal commit (pre-port): 5fe441d9c2fab3e8410be30dcf94d3e29168e493 Base: AztecProtocol/aztec-packages merge-train/barretenberg @ 4da6ab0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #23400. Mirrors the
ci-refresh-chonkrefresh-label / commit-message-marker pattern for the pinned barretenberg gate counts that today live as hardcoded literals ingate_count_constants.hpp.What changed
barretenberg/cpp/scripts/gate-counts.jsonis now the canonical fixture for every measured gate count, kernel ECC row, ultra-ops count, and HONK recursion tuple that the C++ test suite pins.barretenberg/cpp/scripts/gen_gate_count_constants.pyregeneratesbarretenberg/cpp/src/barretenberg/dsl/acir_format/gate_count_constants.hppfrom the JSON. The header now carries aDO NOT EDIT BY HANDbanner;--checkmode lets CI guard against hand edits.barretenberg/cpp/src/barretenberg/dsl/acir_format/gate_count_fixture.hppexposesBB_OBSERVE_GATE_COUNT(key, value). The macro is a no-op unlessBB_GATE_COUNT_OBSERVED_DIRis set, in which case it records{"key": "<key>", "value": <observed>}to a per-process.jsonlfile. Header-only so any test target can call it without picking up a new link dep.EXPECT_EQ(measured, NAMED_CONSTANT)site in the centralized header now pairs with aBB_OBSERVE_GATE_COUNT(...)call so the refresh round-trip captures the observed value alongside the existing assertion.barretenberg/cpp/scripts/merge_observed_gate_counts.pyfolds an observed-dir worth of JSONL records back intogate-counts.json. Handles both flat keys (ROOT_ROLLUP_GATE_COUNT) and structured keys (HONK_RECURSION_CONSTANTS::<flavor>::<mode>::<gates|ultra_ops>).barretenberg/cpp/scripts/ci_update_gate_counts.shis the new PR push-back script, modeled onci_update_chonk_inputs.sh. It runs the gate-count tests underBB_GATE_COUNT_OBSERVED_DIR, merges into JSON, regenerates the header, stages both files, and pushes achore(bb): refresh pinned gate countscommit with--ci-skipso the follow-up run is suppressed..github/ci3_labels_to_env.sh,.github/ci3_success.sh,ci.sh, rootbootstrap.sh, andbarretenberg/cpp/bootstrap.shadd theci-refresh-gates/--ci-refresh-gatesshape. Main CI is skipped; post-actions dispatchbootstrap_ec2 "./bootstrap.sh ci-gate-count-update", which buildsdsl_tests,stdlib_eccvm_verifier_tests,stdlib_honk_verifier_testsand invokes the refresh script..claude/skills/gate-counts/SKILL.mddocuments the local commands (refresh, regenerate, check) and the review checklist.Refresh flow at a glance
ci-refresh-gateslabel or include--ci-refresh-gatesin the head commit. Main CI seesCI_MODE=skip.BB_GATE_COUNT_OBSERVED_DIR=$dir, merge the observed JSONL files intogate-counts.json, regenerate the header, and push a--ci-skipcommit back to the PR head.Scope
gate_count_constants.hpp(root rollup, chonk, ECCVM, goblin AVM, init/inner/tail/hiding kernel gates+ECC+ultra-ops, and every HONK recursion tuple).RANGE_32,SHA256_COMPRESSION, etc.) and one-off literals like the disabledEXPECT_GATE_COUNT = 1203700inavm2_recursion_constraint.test.cppare deliberately out of scope here; the new macro is a drop-in for them in a follow-up.Test plan
DO NOT EDITbanner and a stale// Trigger rebuildcomment differ — confirmed locally).ci-refresh-gatesto a PR with a deliberately stale value and confirm the post-actions job rewritesgate-counts.json+gate_count_constants.hppand pushes the--ci-skipcommit back.BB_GATE_COUNT_OBSERVED_DIR=$(mktemp -d) barretenberg/cpp/scripts/run_test.sh dsl_tests '*GateCount*'thenbarretenberg/cpp/scripts/merge_observed_gate_counts.py $BB_GATE_COUNT_OBSERVED_DIRproduces the expected (empty) diff against the current pin.python3 barretenberg/cpp/scripts/gen_gate_count_constants.py --checkexits 0.Created by claudebox · group:
slackbot