Context
When users run aztec compile and it hangs during VK generation, there's no way to get diagnostic output without manually running bb aztec_process --verbose as a separate step. Similarly, there's no CLI flag to control thread count — users must set the HARDWARE_CONCURRENCY env var.
This came up from the Dark Forest team hitting a hang during compilation of a large contract. The only workaround today is:
- Run
nargo compile separately
- Run
bb aztec_process --verbose -i <artifact> manually
- Set
export HARDWARE_CONCURRENCY=N to control threads
Or use export BB_VERBOSE=1 which the spawn inherits — but this is undiscoverable.
What's needed
1. Pass --verbose through aztec compile
bb aztec_process already supports --verbose (defined in cli.cpp:628), but aztec compile (compile.ts:153) hardcodes only -i args:
const bbArgs = artifacts.flatMap(a => ['-i', a]);
await run(bb, ['aztec_process', ...bbArgs]);
Add a --verbose flag to aztec compile that forwards --verbose to bb aztec_process.
2. Add --threads N flag to bb
Currently thread count is controlled only via the HARDWARE_CONCURRENCY env var (thread.cpp:14). Add a --threads N CLI option to bb (at least for aztec_process) that sets thread concurrency, then expose it through aztec compile --threads N.
Relevant files
yarn-project/aztec/src/cli/cmds/compile.ts — aztec compile command definition and bb invocation
barretenberg/cpp/src/barretenberg/bb/cli.cpp — bb CLI, aztec_process subcommand (line 607+)
barretenberg/cpp/src/barretenberg/common/thread.cpp — HARDWARE_CONCURRENCY env var handling
barretenberg/cpp/src/barretenberg/api/aztec_process.cpp — artifact processing with parallel VK generation
Context
When users run
aztec compileand it hangs during VK generation, there's no way to get diagnostic output without manually runningbb aztec_process --verboseas a separate step. Similarly, there's no CLI flag to control thread count — users must set theHARDWARE_CONCURRENCYenv var.This came up from the Dark Forest team hitting a hang during compilation of a large contract. The only workaround today is:
nargo compileseparatelybb aztec_process --verbose -i <artifact>manuallyexport HARDWARE_CONCURRENCY=Nto control threadsOr use
export BB_VERBOSE=1which the spawn inherits — but this is undiscoverable.What's needed
1. Pass
--verbosethroughaztec compilebb aztec_processalready supports--verbose(defined incli.cpp:628), butaztec compile(compile.ts:153) hardcodes only-iargs:Add a
--verboseflag toaztec compilethat forwards--verbosetobb aztec_process.2. Add
--threads Nflag tobbCurrently thread count is controlled only via the
HARDWARE_CONCURRENCYenv var (thread.cpp:14). Add a--threads NCLI option tobb(at least foraztec_process) that sets thread concurrency, then expose it throughaztec compile --threads N.Relevant files
yarn-project/aztec/src/cli/cmds/compile.ts—aztec compilecommand definition and bb invocationbarretenberg/cpp/src/barretenberg/bb/cli.cpp— bb CLI,aztec_processsubcommand (line 607+)barretenberg/cpp/src/barretenberg/common/thread.cpp—HARDWARE_CONCURRENCYenv var handlingbarretenberg/cpp/src/barretenberg/api/aztec_process.cpp— artifact processing with parallel VK generation