Skip to content

Commit

Permalink
verify batched logup
Browse files Browse the repository at this point in the history
  • Loading branch information
ohad-starkware committed Dec 17, 2024
1 parent 4ce700f commit b407d46
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ pub struct Claim {
}
impl Claim {
pub fn log_sizes(&self) -> TreeVec<Vec<u32>> {
const N_LOOKUPS: usize = 5;
let trace_log_sizes = vec![self.log_size; 29];
let interaction_log_sizes = vec![self.log_size; SECURE_EXTENSION_DEGREE * 5];
let interaction_log_sizes =
vec![self.log_size; SECURE_EXTENSION_DEGREE * N_LOOKUPS.div_ceil(2)];
let preprocessed_log_sizes = vec![self.log_size];
TreeVec::new(vec![
preprocessed_log_sizes,
Expand Down Expand Up @@ -254,7 +256,7 @@ impl FrameworkEval for Eval {
],
));

eval.finalize_logup();
eval.finalize_logup_in_pairs();
eval
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -425,34 +425,28 @@ impl InteractionClaimGenerator {
let mut logup_gen = LogupTraceGenerator::new(self.log_size);

let mut col_gen = logup_gen.new_col();
let lookup_row = &self.lookup_data.rangecheck_7_2_5[0];
for (i, lookup_values) in lookup_row.iter().enumerate() {
let denom = rangecheck_7_2_5_lookup_elements.combine(lookup_values);
col_gen.write_frac(i, PackedQM31::one(), denom);
}
col_gen.finalize_col();

let mut col_gen = logup_gen.new_col();
let lookup_row = &self.lookup_data.rangecheck_4_3[0];
for (i, lookup_values) in lookup_row.iter().enumerate() {
let denom = rangecheck_4_3_lookup_elements.combine(lookup_values);
col_gen.write_frac(i, PackedQM31::one(), denom);
}
col_gen.finalize_col();

let mut col_gen = logup_gen.new_col();
let lookup_row = &self.lookup_data.memoryaddresstoid[0];
for (i, lookup_values) in lookup_row.iter().enumerate() {
let denom = memoryaddresstoid_lookup_elements.combine(lookup_values);
col_gen.write_frac(i, PackedQM31::one(), denom);
for (i, (v0, v1)) in zip(
&self.lookup_data.rangecheck_7_2_5[0],
&self.lookup_data.rangecheck_4_3[0],
)
.enumerate()
{
let p0: PackedQM31 = rangecheck_7_2_5_lookup_elements.combine(v0);
let p1: PackedQM31 = rangecheck_4_3_lookup_elements.combine(v1);
col_gen.write_frac(i, p0 + p1, p0 * p1);
}
col_gen.finalize_col();

let mut col_gen = logup_gen.new_col();
let lookup_row = &self.lookup_data.memoryidtobig[0];
for (i, lookup_values) in lookup_row.iter().enumerate() {
let denom = memoryidtobig_lookup_elements.combine(lookup_values);
col_gen.write_frac(i, PackedQM31::one(), denom);
for (i, (v0, v1)) in zip(
&self.lookup_data.memoryaddresstoid[0],
&self.lookup_data.memoryidtobig[0],
)
.enumerate()
{
let p0: PackedQM31 = memoryaddresstoid_lookup_elements.combine(v0);
let p1: PackedQM31 = memoryidtobig_lookup_elements.combine(v1);
col_gen.write_frac(i, p0 + p1, p0 * p1);
}
col_gen.finalize_col();

Expand Down

0 comments on commit b407d46

Please sign in to comment.