How babybear-labs/benchmark works
Main Components
• Independent Proof System Modules: Represent each major subcomponent as an independent module (Circom, Jolt, Nexus, Powdr, Halo2, RISC Zero, SP1, Zokrates, etc.). For each module, indicate:
– Its source code (e.g., Rust code for Jolt/Nexus, shell scripts and circuits for Circom).
– Specific directories for tests, circuits/algorithms, and build scripts.
• Reporting/Aggregation Module: Show a module (or folder) for “reports” that collects and stores benchmark results and related metrics.
• Documentation and Utility Components: Include components such as the “documentation” folder, ancillary scripts (e.g., compile scripts in Circom), and configuration files that inform each module’s operation.
Relationships and Interactions
• Data Flow: Illustrate that the Benchmark Orchestrator (whether manual or automated) initiates tests on each individual proof system module.
• Each module runs its specific tests (e.g., compiling circuits, running proof generation, and verification routines) then outputs performance metrics and results.
• The results are then gathered into the Reports module (with directories for each proof system, e.g., reports/jolt, reports/circom, etc.).
Architectural Patterns and Design Principles
• Layered Structure: At the top, the Benchmark Orchestrator sits as a “driver/manager” that interacts with the lower-level modules (each implementing one ZK-proof system).
• Reusability & Extensibility: Since many benchmarking scripts (e.g., test_fibonacci.py, test_poseidon.py) and build configuration files (Cargo.toml, Makefile, etc.) can be reused or extended, highlight extensibility points in the design.
• Integration Points: Show where common libraries or environments (e.g., Rust/Cargo for many modules, shell scripts for Circom) fit within each module.
Relevant Technologies and Frameworks
• Rust and Cargo: Used widely in modules like Jolt, Nexus, Powdr, RISC Zero, and SP1.
• Circom HDL: Used in the Circom module, along with its associated bash scripts, Python utilities, and circuit files.
• Build and Scripting Tools: Makefiles, shell scripts, and Python test harnesses are present to manage compilation and execution.