Skip to content

Commit

Permalink
10243: Adjustements on gate cost per column
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmon committed Dec 4, 2024
1 parent e4f2e92 commit 4888c19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ TEST_F(AvmRecursiveTests, recursion)
verification_key->pcs_verification_key->pairing_check(agg_output.P0.get_value(), agg_output.P1.get_value());

ASSERT_TRUE(agg_output_valid) << "Pairing points (aggregation state) are not valid.";

vinfo("Recursive verifier: num gates = ", outer_circuit.num_gates);
ASSERT_FALSE(outer_circuit.failed()) << "Outer circuit has failed.";

bool outer_circuit_checked = CircuitChecker::check(outer_circuit);
Expand Down Expand Up @@ -139,6 +137,8 @@ TEST_F(AvmRecursiveTests, recursion)
auto ultra_verification_key = std::make_shared<UltraFlavor::VerificationKey>(ultra_instance->proving_key);
OuterVerifier ultra_verifier(ultra_verification_key);

vinfo("Recursive verifier: finalized num gates = ", outer_circuit.num_gates);

auto recursion_proof = ultra_prover.construct_proof();
bool recursion_verified = ultra_verifier.verify_proof(recursion_proof);
EXPECT_TRUE(recursion_verified) << "recursion proof verification failed";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ pub struct AvmProofData {
// The number of columns for the AVM recursive verifier we want to fake, i.e., the resulting
// verify() routine below will create a similar number of gates as a real AVM recursive verifier
// with the number of columns set by this constant.
pub global DUMMY_AVM_VERIFIER_NUM_COLUMNS: u32 = 3000;
pub global DUMMY_AVM_VERIFIER_NUM_COLUMNS: u32 = 2200;

// Current AVM recursive verifier has 7000 gates per column.
// Note that the addition of a single column in AVM recursive verifier incurs 6600 gates.
// (some additional costs due to lookups/perms, etc...).
// Current AVM recursive verifier has 9500 gates per column.
// Note that the addition of a single column in AVM recursive verifier incurs 8500 gates.
// (some additional costs are due to lookups, relations, ...).
// 78 gates per Poseidon permutation
// 7000/78 = 89.7
pub global DUMMY_AVM_VERIFIER_NUM_ITERATIONS: u32 = DUMMY_AVM_VERIFIER_NUM_COLUMNS * 90;
// 9500/78 = 121.8
pub global DUMMY_AVM_VERIFIER_NUM_ITERATIONS: u32 = DUMMY_AVM_VERIFIER_NUM_COLUMNS * 122;

// Warning: This is a fake avm recursive verification whose sole goal is to reproduce a similar
// computational effort (number of gates) as the real recursive verifier.
Expand Down

0 comments on commit 4888c19

Please sign in to comment.