Skip to content

feat(build): first make targets as ci3 steps, with a build plan (spike) - #25906

Draft
charlielye wants to merge 29 commits into
nextfrom
cl/step-targets
Draft

charlielye wants to merge 29 commits into
nextfrom
cl/step-targets

Conversation

@charlielye

Copy link
Copy Markdown
Contributor

Spike, using aztec-labs-eng/ci3#38 (ci3 is pinned to that branch): the first Makefile targets become ci3 steps, keyed and cached from the make graph, and every build starts with a plan of what will be restored, what will build, and why.

Converted

Target Key now Before
avm-transpiler-native, -cross-* its patterns, noir's patterns, the noir-repo gitlink the same, chained by hand
l1-contracts-src l1-contracts patterns only also noir's hash, the circuits and bb patterns
l1-contracts-verifier own patterns + keys of noir-protocol-circuits and l1-contracts-src one $hash for all three
l1-contracts-artifacts own patterns + l1-contracts-verifier's key one $hash for all three
noir-protocol-circuits outputs never; it still caches per circuit, but has a key for the steps above none
  • Each converted bootstrap function now builds unconditionally. The step does the restoring and uploading.
  • Running avm-transpiler's or l1-contracts' ./bootstrap.sh with no command goes through make, so it still caches.
  • l1-contracts-prep holds what used to run outside build_src's cache wrapper (constants, solc, npm, lib/). It always runs, and the steps run after it.
  • Everything else goes through ci3/step_legacy and is unchanged. Steps that depend on it are keyed by its ./bootstrap.sh hash.
  • ./bootstrap.sh plan [goal] prints the plan; build and build_and_test print it first. A plan failure never stops the build.

Tried locally

  • avm-transpiler-native: a cold build took 2.5 min. With its outputs deleted, it was restored from the local cache in 1.4s, and the plan then showed it as cached.
  • l1-contracts-src: built with prep.
  • Plan after touching one contract:
    ├─ avm-transpiler-native  9265014f597b  cached
    ├─ l1-contracts-src  1ffb29083a72  BUILD  changed: l1-contracts/src/core/libraries/DataStructures.sol (since 6d34a7580a)
    
  • Not run locally: the verifier and artifacts steps, and the circuits as a step. They need bb.

New keys mean the first CI run of each converted target is a cold build.

🤖 Generated with Claude Code

charlielye and others added 3 commits November 25, 2026 17:21
avm-transpiler (native and cross), l1-contracts-src, -verifier and -artifacts, and noir-protocol-circuits
become ci3 steps: keyed from their own inputs and the keys of their make prerequisites, and cached by
ci3 rather than by wrappers in their bootstrap scripts. The rest of the Makefile is unchanged, run through
ci3/step_legacy so steps can depend on it (keyed by each project's ./bootstrap.sh hash).

- l1-contracts-src no longer depends on noir or the circuits: only the verifier does, through the
  noir-protocol-circuits step's key.
- l1-contracts-prep is what ran outside build_src's cache wrapper (constants, solc, npm, libraries): it
  always runs, and the l1-contracts steps run after it.
- avm-transpiler and l1-contracts' `./bootstrap.sh` with no command builds through make, so it still caches.
- build and build_and_test print the build plan first (ci3/step_plan); `./bootstrap.sh plan [goal]` prints
  it alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
charlielye and others added 25 commits November 25, 2026 19:20
avm-transpiler's steps now write their binary and library to ci3-out/<target> (ci3's $STEP_OUT), which is
what is cached, and barretenberg's presets link the library from there. The Makefile no longer lists their
output paths. l1-contracts keeps listing them for now: forge's out/ and cache/ are working directories that
each build continues from and the tests read in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ff, tests kind

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit uses step_tests but left the ci3 gitlink behind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The protocol circuits, mock circuits and protocol contracts stay `never` steps: they cache per item, and those
items are now keyed by the nargo and bb that build them as ci3 hands them in ($CI3_KEY_NOIR,
$CI3_KEY_BB_CPP_NATIVE) rather than by noir's and barretenberg's bootstrap hashes. Each item keeps its own
content key (nargo's program hash for a circuit, the bytecode for a VK, the sources for a contract).

- noir-protocol-circuits-variants is a step whose outputs stay in place (nargo reads the generated workspace
  there), and a prerequisite of what reads them; the circuits build no longer regenerates them.
- noir-projects-fnd-format-check is a cached check. The builds no longer rely on it to warm nargo's dependency
  cache: each fetches its dependencies first (nargo fetch, retried), as nargo serializes concurrent fetches.
- fnd-artifacts-stage is a step whose dists stay in place, for the labs portals and the release.
- fnd-release, fnd-genesis, noir-projects-fnd and noir-projects are step groups.
- The test targets prefix their commands with $STEP_KEY. The circuits' and contracts' tests read sources, not
  build output, so their builds are order-only prerequisites.
- ./bootstrap.sh with no command (and fnd's build) runs the make targets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
l1-contracts
- l1-contracts-src builds into its $STEP_OUT (FOUNDRY_OUT/FOUNDRY_CACHE_PATH), with the sources' modification
  times zeroed in forge's cache so the same sources give the same outputs. build_verifier continues from it:
  it copies src's out/ and cache/ into place and points forge's cache at them, which forge otherwise takes
  as a reason to recompile everything.
- l1-contracts-verifier and -artifacts keep their transitional output paths: out/ and cache/ are forge's
  working directories that the tests, the deploy scripts and l1-artifacts read in place, generated/ is a
  source directory (the @generated remapping), and l1-artifacts is a yarn workspace read in place.
- l1-contracts-solc and -prep are never steps; solc's key is the solc version foundry.toml pins.
- l1-contracts-tests is keyed by $STEP_KEY, from its own inputs (scripts, fixtures, solhint config), the
  verifier's outputs and noir-protocol-circuits; the HonkVerifier comparison also folds in the circuits'
  verifier's content. The hand-rolled hash remains only as `./bootstrap.sh hash` (scripts/labs_fnd_hashes.sh)
  and bench_cmds' key, both outside make.

docs
- docs (the site into $STEP_OUT, plus the aztec.js reference and orphaned-URL checks), docs-examples (nargo's
  target/ in place), docs-checks (keyed by the whole tree: they check repository paths exist), and the never
  step docs-prep for the aztec-node checkout and node_modules. The #include_code inputs come from
  docs/scripts/include_code_patterns.sh; the variables that change the site are KEY_ENV.
- docs-tests and the new docs-examples-tests key their tests with $STEP_KEY; a test that reads a page or a
  line folds its own patterns into that key. The docs and examples `hash` commands are gone.

Leftovers: claude-tests, scripts-tests and labs-patches-tests key their tests with $STEP_KEY (labs-patches-
tests with the labs gitlink as KEY_SALT, and only ordered after labs-patched); labs-patched is a never step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…steps

bb-crs (never: the CRS lives in ~/.bb-crs), bb-bbup (a group: nothing to build), bb-ts-packages, bb-ts, bb-bin,
bb-bin-cross-copy, bb-rs, bb-acir, bb-docs and bb-sol become ci3 steps, keyed from their inputs and their make
prerequisites rather than from chained ./bootstrap.sh hash calls, and cached by ci3 rather than by wrappers in their
bootstrap scripts. Their test targets get INPUTS, and their test commands are prefixed with $STEP_KEY.

- barretenberg/ts: bb-ts-packages-build generates, installs and compiles the packages (cached in place: yarn
  workspaces read through node module resolution); bb-ts-packages then installs node_modules every run
  (npm_install_deps caches it), so the packages are usable whether or not they came from the cache. bb-ts caches
  bb.js/dest in place. ipc-codegen is no longer a prerequisite: the generator runs from source, an input.
- acir_tests splits into bb-acir-programs (the compiled programs, in place), bb-acir-deps (node_modules, every run)
  and bb-acir-js (the browser app and bb.js harness), grouped as bb-acir.
- bb-docs is a check (nothing reads build/); bb-docs-deps installs its node_modules every run.
- bb-rs no longer depends on bb-ts (it generates its client from the schema itself), but is now keyed by bb's
  build, whose libbb-external.a it links: its hash covered neither.
- bb-sol: l1-contracts-solc is order-only (foundry.toml's path names the solc version), so l1-contracts changes no
  longer rebuild it.
- Test targets depend on what the tests run: bb-ts-tests and bb-acir-tests on the packages (bb, wasm), bb-sol-tests
  and bb-rs-tests on bb-cpp-native.
- hash commands removed from acir_tests, bbup, docs, rust, sol and barretenberg/bootstrap.sh. barretenberg/ts and
  bb.js keep theirs (computed on demand) for scripts/labs_fnd_hashes.sh; bb.js and sol benches still hash, as
  benchmarks are not steps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e native packages as ci3 steps

Their builds and tests are keyed and cached by ci3 from the make graph; the bootstraps build unconditionally,
and `./bootstrap.sh` (and `build`) runs their targets through make.

- noir: one step (nargo/noir-execute/noir-profiler and the JS packages) on the transitional path list, since nargo
  and noir/packages are read in place by many scripts and the labs toolchain. The release check is its own
  always-run target (noir-release-check), so it still runs when noir is cached.
- ipc-runtime: path list (ts/dest, ts/build, the C++ test binary): consumers portal into ipc-runtime/ts. Its cross
  builds install the addon into $STEP_OUT, which copy_cross.sh now reads.
- ipc-codegen: builds only the echo example harness its tests run, on the path list.
- constants-codegen: path list (dest, inputs; labs portals into it); its inputs now include constants.nr, which
  its build embeds.
- lmdblib installs its library and test binary into $STEP_OUT. kvdb and wsdb compile lmdblib's sources, so they
  take them as inputs; wsdb takes bb's wsdb-ref sources, ipc-runtime's C++ and ipc-codegen's generator as inputs,
  and depends on ipc-runtime's built TS package rather than on ipc-codegen. Their TS packages stay in place.
- Test commands are keyed by $STEP_KEY. kvdb's installs its node_modules itself, which a restored build lacks.
- `hash` stays for every project here: other projects' bootstraps and scripts/labs_fnd_hashes.sh still call it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the hand-rolled hashes they kept

Benchmark commands are listed by <project>-benches make targets (ci3 step_benches) and keyed by
$STEP_KEY, as tests are; bootstrap.sh bench_cmds collects them through make. labs-use-local is a
never step whose prerequisites are the providers labs consumes: scripts/labs_fnd_hashes.sh records
what ci3 hands it for each (output hash or key) instead of chaining every project's ./bootstrap.sh
hash. The hash commands of kvdb, lmdblib, wsdb, constants-codegen, genesis, ipc-codegen, l1-contracts,
barretenberg/ts, bb.js and noir-projects/fnd are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every bb-cpp-* target is a step, keyed from the make graph instead of barretenberg/cpp's hand-rolled hash.

- The presets' cmake build dirs stay where they are (build/bin/bb is read all over the repo, and local builds
  continue from them): each preset's step caches its bin/lib in place (the transitional path list).
- bb's inputs now name what it reads of other projects: ipc-runtime's C++ sources and avm-transpiler's header,
  rather than chaining their hashes. avm-transpiler's library comes from the avm-transpiler-native step.
- The objects warm-ups, the format check and the syntax checks are steps that record a pass. The warm-ups and the
  format check are order-only prerequisites, and the cross builds run after one another order-only: none reads
  another's outputs.
- The downloads (chonk inputs, iOS SDK, Android sysroot) cache themselves: `never` steps keyed by their scripts.
- bb's binaries are stamped with a version derived from their own contents rather than the commit, so the cached
  outputs are the same wherever the same binary is built and the steps after bb are cut off when it comes out
  unchanged. bin/dist (stripped, with a release's version) is staged after the step, outside its outputs.
- bb-cpp-release-dir writes the release tarballs to its $STEP_OUT; barretenberg/ts reads them there.
- The test commands are keyed by their step ($STEP_KEY), and `./bootstrap.sh test` lists them through make.
- barretenberg/bootstrap.sh's unused `hash` is gone. barretenberg/cpp keeps its `hash` for the projects that
  still chain it, and for the bench commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ped outputs keyed by RELEASE_VERSION

barretenberg/cpp's benches are a step_benches target like the rest, so the bb, avm-transpiler,
ipc-runtime and noir hash commands, which only chained into each other, are gone: no bootstrap
computes a hand-rolled build hash any more.

Targets whose outputs carry the release version key on RELEASE_VERSION (REF_NAME when it is a
semver, else empty) rather than REF_NAME, which is a branch name on every other build. avm-transpiler
and bb.js key on AVM_TRANSPILER, which turns their build off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… not their committed sources

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	Makefile
#	barretenberg/ts/bootstrap.sh
#	ipc-runtime/ts/scripts/copy_cross.sh
… pin ci3 to name missing outputs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ntry (#25855)

The install rewrote it on every build, which left bb-acir-deps' inputs dirty and so bb-acir-js uncached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AztecBot

Copy link
Copy Markdown
Collaborator

Flakey Tests

🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/089b0511a44ccef8�089b0511a44ccef88;;�): cd labs && export root= ci3= &&  yarn-project/end-to-end/scripts/run_test.sh simple src/multi-node/slashing/attested_invalid_proposal.parallel.test.ts "slashes a lazy attester for an invalid checkpoint and clears it on delayed equivocation" (198s) (code: 0) group:e2e-p2p-epoch-flakes

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants