Skip to content

Commit

Permalink
Placeholder profiling object updated #320
Browse files Browse the repository at this point in the history
  • Loading branch information
ETatuzova committed Apr 26, 2024
1 parent 994527c commit 6d909b3
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ namespace nil {

std::size_t permutation_size;
std::size_t round_proof_layers_num;
std::size_t quotient_poly_first_index;

variable_indices_type var_indices;
std::vector<std::size_t> permuted_zero_indices;
Expand Down Expand Up @@ -99,7 +100,6 @@ namespace nil {
res.permutation_batch_order = res.use_lookups || res.use_permutations ? 1 : -1;
res.quotient_batch_order = res.use_lookups || res.use_permutations ? 2: 1;
res.lookup_batch_order = res.use_lookups? 3: -1;
std::cout << "Quotient batch order " << res.quotient_batch_order << std::endl;

res.batches_num = 3;
if( res.use_lookups || res.use_permutations ) res.batches_num++;
Expand All @@ -115,11 +115,15 @@ namespace nil {
std::size_t full_gate_polynomial_size = (common_data.max_gates_degree + 1);
std::size_t max_quotient_size = std::max(full_permutation_polynomial_size, full_lookup_polynomial_size);
max_quotient_size = std::max(max_quotient_size, full_gate_polynomial_size);

res.permutation_batch_size = 0;
res.permutation_poly_amount = res.use_permutations? 1: 0;
res.lookup_poly_amount = res.use_lookups? 1: 0;

if( res.use_lookups || res.use_permutations ){
res.permutation_batch_size = res.use_lookups ? 2 : 1;
if( res.use_lookups ) res.permutation_batch_size++;
if( res.use_permutations ) res.permutation_batch_size++;

if( common_data.max_quotient_chunks > 0 ){
res.permutation_batch_size += full_permutation_polynomial_size/common_data.max_quotient_chunks;
res.permutation_batch_size += full_lookup_polynomial_size/common_data.max_quotient_chunks;
Expand All @@ -142,6 +146,7 @@ namespace nil {
for(std::size_t i = 0; i < fri_params.r; i++ ){
res.round_proof_layers_num += log2(fri_params.D[i]->m) -1;
}
res.poly_num = std::accumulate(res.batches_sizes.begin(), res.batches_sizes.end(), 0);

// variable indices
using variable_type = nil::crypto3::zk::snark::plonk_variable<typename PlaceholderParams::field_type::value_type>;
Expand Down Expand Up @@ -206,6 +211,10 @@ namespace nil {

res.sorted_poly_amount = constraint_system.sorted_lookup_columns_number();

res.quotient_poly_first_index = 2 * res.permutation_size + 4 + res.table_values_num;
if( res.use_permutations ) res.quotient_poly_first_index += res.permutation_poly_amount + 1;
if( res.use_lookups ) res.quotient_poly_first_index += res.lookup_poly_amount + 1;

return res;
}

Expand Down

0 comments on commit 6d909b3

Please sign in to comment.