Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions barretenberg/cpp/scripts/audit/audit_scopes/numeric_audit_scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@ Note: Paths relative to `aztec-packages/barretenberg/cpp/src/barretenberg`
3. `numeric/bitop/keep_n_lsb.hpp`
4. `numeric/bitop/pow.hpp`
5. `numeric/bitop/rotate.hpp`
6. `numeric/bitop/sparse_form.hpp`

### Random Number Generation
6. `numeric/random/engine.cpp`
7. `numeric/random/engine.hpp`
7. `numeric/random/engine.cpp`
8. `numeric/random/engine.hpp`

### Unsigned Integer Types
8. `numeric/uint128/uint128.hpp`
9. `numeric/uint128/uint128_impl.hpp`
10. `numeric/uint256/uint256.hpp`
11. `numeric/uint256/uint256_impl.hpp`
12. `numeric/uintx/uintx.cpp`
13. `numeric/uintx/uintx.hpp`
14. `numeric/uintx/uintx_impl.hpp`
9. `numeric/uint128/uint128.hpp`
10. `numeric/uint128/uint128_impl.hpp`
11. `numeric/uint256/uint256.hpp`
12. `numeric/uint256/uint256_impl.hpp`
13. `numeric/uintx/uintx.cpp`
14. `numeric/uintx/uintx.hpp`
15. `numeric/uintx/uintx_impl.hpp`

### General Utilities
15. `numeric/general/general.hpp`
16. `numeric/general/general.hpp`

## Summary of Module

Expand Down
6 changes: 6 additions & 0 deletions barretenberg/cpp/scripts/ci_benchmark_ivc_flows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ function chonk_flow {
}
]
EOF

# Extract component timings from hierarchical breakdown if available
if [[ -f "$output/benchmark_breakdown.json" ]]; then
echo "Extracting component timings from hierarchical breakdown..."
python3 scripts/extract_component_benchmarks.py "$output" "$name_path"
fi
}

export -f verify_ivc_flow run_bb_cli_bench
Expand Down
47 changes: 1 addition & 46 deletions barretenberg/cpp/scripts/ci_benchmark_ultrahonk_circuits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,52 +129,7 @@ EOF
# Extract component timings from hierarchical breakdown if available
if [[ -f "$output/benchmark_breakdown.json" ]]; then
echo "Extracting component timings from hierarchical breakdown..."

# Use Python to extract key component timings
# The breakdown JSON format is: { "operation_name": [{"parent": "...", "time": nanoseconds, ...}], ... }
python3 << PYTHON_SCRIPT
import json
import sys

try:
with open("$output/benchmark_breakdown.json", "r") as f:
data = json.load(f)

benchmarks = []

# Key components to track (case-insensitive matching)
key_components = ["sumcheck", "pcs", "pippenger", "commitment", "circuit", "oink", "compute"]

for op_name, entries in data.items():
# Check if this is a key component we want to track
if any(comp.lower() in op_name.lower() for comp in key_components):
# Sum up all timings for this operation (there may be multiple entries with different parents)
total_time_ns = sum(entry.get("time", 0) for entry in entries)
time_ms = total_time_ns / 1_000_000

# Create a safe benchmark name (replace special chars)
safe_name = op_name.replace("::", "_").replace(" ", "_")

benchmarks.append({
"name": f"$name_path/{safe_name}_ms",
"unit": "ms",
"value": round(time_ms, 2),
"extra": f"stacked:$name_path/components"
})

# Append to existing benchmarks file
with open("$output/benchmarks.bench.json", "r") as f:
existing = json.load(f)

existing.extend(benchmarks)

with open("$output/benchmarks.bench.json", "w") as f:
json.dump(existing, f, indent=2)

print(f"Extracted {len(benchmarks)} component timings")
except Exception as e:
print(f"Warning: Could not extract component timings: {e}", file=sys.stderr)
PYTHON_SCRIPT
python3 scripts/extract_component_benchmarks.py "$output" "$name_path"
fi

echo "Benchmark complete. Results in $output/"
Expand Down
64 changes: 64 additions & 0 deletions barretenberg/cpp/scripts/extract_component_benchmarks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env python3
"""Extracts component timings from a hierarchical benchmark breakdown and appends
them to the benchmark JSON file as stacked chart entries.

Usage: extract_component_benchmarks.py <output_dir> <name_path>

The output_dir must contain:
- benchmark_breakdown.json (hierarchical timing data from bb --bench_out_hierarchical)
- benchmarks.bench.json (existing benchmark results to append to)

The breakdown JSON format is:
{ "operation_name": [{"parent": "...", "time": nanoseconds, ...}], ... }

Component entries are added with extra: "stacked:<name_path>/components" so the
benchmark dashboard renders them as a single multi-line chart.
"""
import json
import sys

if len(sys.argv) != 3:
print(f"Usage: {sys.argv[0]} <output_dir> <name_path>", file=sys.stderr)
sys.exit(1)

output_dir = sys.argv[1]
name_path = sys.argv[2]

try:
with open(f"{output_dir}/benchmark_breakdown.json", "r") as f:
data = json.load(f)

benchmarks = []

# Key components to track (case-insensitive matching)
key_components = ["sumcheck", "pcs", "pippenger", "commitment", "circuit", "oink", "compute"]

for op_name, entries in data.items():
# Check if this is a key component we want to track
if any(comp.lower() in op_name.lower() for comp in key_components):
# Sum up all timings for this operation (there may be multiple entries with different parents)
total_time_ns = sum(entry.get("time", 0) for entry in entries)
time_ms = total_time_ns / 1_000_000

# Create a safe benchmark name (replace special chars)
safe_name = op_name.replace("::", "_").replace(" ", "_")

benchmarks.append({
"name": f"{name_path}/{safe_name}_ms",
"unit": "ms",
"value": round(time_ms, 2),
"extra": f"stacked:{name_path}/components"
})

# Append to existing benchmarks file
with open(f"{output_dir}/benchmarks.bench.json", "r") as f:
existing = json.load(f)

existing.extend(benchmarks)

with open(f"{output_dir}/benchmarks.bench.json", "w") as f:
json.dump(existing, f, indent=2)

print(f"Extracted {len(benchmarks)} component timings")
except Exception as e:
print(f"Warning: Could not extract component timings: {e}", file=sys.stderr)
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ A curve-agnostic zero-knowledge protocol for proving inner products of small vec

## Overview

SmallSubgroupIPA enables proving statements of the form $ \langle F, G \rangle = s$ where:
- $ G$ is a witness polynomial (prover's secret)
- $ F$ is a challenge polynomial (derived from public challenges)
- $ s$ is the claimed inner product
SmallSubgroupIPA enables proving statements of the form $\langle F, G \rangle = s$ where:
- $G$ is a witness polynomial (prover's secret)
- $F$ is a challenge polynomial (derived from public challenges)
- $s$ is the claimed inner product

This protocol is used in two contexts:
1. **ZK-Sumcheck**: Proving correct evaluation of Libra masking polynomials
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,6 @@ template <typename Curve> class SmallSubgroupIPAVerifier {
*/
static void handle_edge_cases(const FF& vanishing_poly_eval)
{

// TODO(https://github.com/AztecProtocol/barretenberg/issues/1194). Handle edge cases in PCS
// TODO(https://github.com/AztecProtocol/barretenberg/issues/1186). Insecure pattern.
bool evaluation_challenge_in_small_subgroup = false;
if constexpr (Curve::is_stdlib_type) {
evaluation_challenge_in_small_subgroup = (vanishing_poly_eval.get_value() == FF(0).get_value());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ProverPolynomialsBase : public AllEntitiesBase {
ProverPolynomialsBase(ProverPolynomialsBase&& o) noexcept = default;
ProverPolynomialsBase& operator=(ProverPolynomialsBase&& o) noexcept = default;
~ProverPolynomialsBase() = default;
[[nodiscard]] size_t get_polynomial_size() const { return this->q_c.size(); }
[[nodiscard]] size_t get_polynomial_size() const { return this->q_c.virtual_size(); }
[[nodiscard]] AllValuesType get_row(size_t row_idx) const
{
AllValuesType result;
Expand Down
Loading
Loading