Skip to content

Commit

Permalink
fix: add NUM_RESERVED_GATES before fetching subgroup size in composer (
Browse files Browse the repository at this point in the history
  • Loading branch information
vezenovm authored Jun 16, 2023
1 parent b288c24 commit fa11abf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cpp/src/barretenberg/dsl/acir_proofs/acir_composer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ void AcirComposer::create_circuit(acir_format::acir_format& constraint_system)

exact_circuit_size_ = composer_.get_num_gates();
total_circuit_size_ = composer_.get_total_circuit_size();
circuit_subgroup_size_ = composer_.get_circuit_subgroup_size(total_circuit_size_);
circuit_subgroup_size_ =
composer_.get_circuit_subgroup_size(total_circuit_size_ + composer_.composer_helper.NUM_RESERVED_GATES);
size_hint_ = circuit_subgroup_size_;
}

Expand All @@ -44,7 +45,8 @@ void AcirComposer::init_proving_key(std::shared_ptr<barretenberg::srs::factories

exact_circuit_size_ = composer_.get_num_gates();
total_circuit_size_ = composer_.get_total_circuit_size();
circuit_subgroup_size_ = composer_.get_circuit_subgroup_size(total_circuit_size_);
circuit_subgroup_size_ =
composer_.get_circuit_subgroup_size(total_circuit_size_ + composer_.composer_helper.NUM_RESERVED_GATES);

info("computing proving key...");
proving_key_ = composer_.compute_proving_key();
Expand Down

1 comment on commit fa11abf

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'C++ Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: fa11abf Previous: b288c24 Ratio
construct_proof_ultra/sha256/10/repeats:1 9.59238505899998 s/iter 7.58884986399994 s/iter 1.26
construct_proof_ultra/keccak/10/repeats:1 25.595157809000057 s/iter 19.282759427999963 s/iter 1.33
construct_proof_ultra/ecdsa_verification/10/repeats:1 46.87546076599983 s/iter 34.4339084479999 s/iter 1.36
construct_proof_ultra/merkle_membership/10/repeats:1 5.236678002999838 s/iter 4.140180644999987 s/iter 1.26

This comment was automatically generated by workflow using github-action-benchmark.

CC: @ledwards2225

Please sign in to comment.