Skip to content

Commit

Permalink
fix: use size hint for ivc circuits (#4802)
Browse files Browse the repository at this point in the history
Adds size hint (2^17) to ivc bench circuits so wire/selector vector
memory can be reserved in advance of circuit construction.
  • Loading branch information
ledwards2225 authored Feb 29, 2024
1 parent 24d918f commit 035cff4
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ class ClientIVCBench : public benchmark::Fixture {
*/
static void perform_ivc_accumulation_rounds(State& state, ClientIVC& ivc)
{
const size_t size_hint = 1 << 17; // Size hint for reserving wires/selector vector memory in builders
// Initialize IVC with function circuit
Builder function_circuit{ ivc.goblin.op_queue };
Builder function_circuit{ size_hint, ivc.goblin.op_queue };
GoblinMockCircuits::construct_mock_function_circuit(function_circuit);
ivc.initialize(function_circuit);

// Accumulate kernel circuit (first kernel mocked as simple circuit since no folding proofs yet)
Builder kernel_circuit{ ivc.goblin.op_queue };
Builder kernel_circuit{ size_hint, ivc.goblin.op_queue };
GoblinMockCircuits::construct_mock_function_circuit(kernel_circuit);
auto kernel_fold_proof = ivc.accumulate(kernel_circuit);

Expand All @@ -56,12 +57,12 @@ class ClientIVCBench : public benchmark::Fixture {
for (size_t circuit_idx = 0; circuit_idx < NUM_CIRCUITS; ++circuit_idx) {

// Accumulate function circuit
Builder function_circuit{ ivc.goblin.op_queue };
Builder function_circuit{ size_hint, ivc.goblin.op_queue };
GoblinMockCircuits::construct_mock_function_circuit(function_circuit);
auto function_fold_proof = ivc.accumulate(function_circuit);

// Accumulate kernel circuit
Builder kernel_circuit{ ivc.goblin.op_queue };
Builder kernel_circuit{ size_hint, ivc.goblin.op_queue };
GoblinMockCircuits::construct_mock_folding_kernel(kernel_circuit, function_fold_proof, kernel_fold_proof);
auto kernel_fold_proof = ivc.accumulate(kernel_circuit);
}
Expand Down

0 comments on commit 035cff4

Please sign in to comment.