-
Notifications
You must be signed in to change notification settings - Fork 131
Expose --verbose and --threads flags through aztec compile to bb aztec_process #1653
Description
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 compileseparately - Run
bb aztec_process --verbose -i <artifact>manually - Set
export HARDWARE_CONCURRENCY=Nto 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 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