Skip to content

Commit

Permalink
feat: logup batching (#487)
Browse files Browse the repository at this point in the history
Co-authored-by: Kevin Jue <[email protected]>
  • Loading branch information
tamirhemo and kevjue authored Apr 11, 2024
1 parent 3a0d957 commit 8d2ad2f
Show file tree
Hide file tree
Showing 5 changed files with 218 additions and 168 deletions.
10 changes: 9 additions & 1 deletion core/src/stark/chip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,21 @@ where
where
F: PrimeField,
{
let batch_size = self.logup_batch_size();
generate_permutation_trace(
&self.sends,
&self.receives,
preprocessed,
main,
random_elements,
batch_size,
)
}

pub fn logup_batch_size(&self) -> usize {
// TODO: calculate by log_quotient_degree.
2
}
}

impl<F, A> BaseAir<F> for Chip<F, A>
Expand Down Expand Up @@ -156,7 +163,8 @@ where
// Evaluate the execution trace constraints.
self.air.eval(builder);
// Evaluate permutation constraints.
eval_permutation_constraints(&self.sends, &self.receives, builder);
let batch_size = self.logup_batch_size();
eval_permutation_constraints(&self.sends, &self.receives, batch_size, builder);
}
}

Expand Down
Loading

0 comments on commit 8d2ad2f

Please sign in to comment.