Skip to content

Expose --verbose and --threads flags through aztec compile to bb aztec_process #1653

@AztecBot

Description

@AztecBot

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:

  1. Run nargo compile separately
  2. Run bb aztec_process --verbose -i <artifact> manually
  3. 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.tsaztec 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.cppHARDWARE_CONCURRENCY env var handling
  • barretenberg/cpp/src/barretenberg/api/aztec_process.cpp — artifact processing with parallel VK generation

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions