Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use size hint for ivc circuits #4802

Merged
merged 2 commits into from
Feb 29, 2024
Merged
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
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
Loading