mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-03 06:13:07 +00:00
Fix some off-by-one errors in the degrees
This commit is contained in:
parent
fe36030080
commit
21f90ca853
@ -64,9 +64,9 @@ impl<F: Extendable<D>, const D: usize> Tree<GateRef<F, D>> {
|
||||
gates.sort_unstable_by_key(|g| (-(g.0.degree() as isize), -(g.0.num_constants() as isize)));
|
||||
|
||||
for max_degree_bits in 1..10 {
|
||||
// The constraint polynomials are padded to the next power in `compute_vanishig_polys`.
|
||||
// So we can restrict our search space by setting `max_degree` to a power of 2.
|
||||
let max_degree = 1 << max_degree_bits;
|
||||
// The quotient polynomials are padded to the next power of 2 in `compute_vanishig_polys`.
|
||||
// So we can restrict our search space by setting `max_degree` to 1 + a power of 2.
|
||||
let max_degree = 1 << max_degree_bits + 1;
|
||||
for max_constants in 1..100 {
|
||||
if let Some(mut best_tree) = Self::find_tree(&gates, max_degree, max_constants) {
|
||||
let mut best_num_constants = best_tree.num_constants();
|
||||
|
||||
@ -332,7 +332,7 @@ fn compute_quotient_polys<'a, F: Extendable<D>, const D: usize>(
|
||||
alphas: &[F],
|
||||
) -> Vec<PolynomialCoeffs<F>> {
|
||||
let num_challenges = common_data.config.num_challenges;
|
||||
let max_degree_bits = log2_ceil(common_data.quotient_degree_factor + 1);
|
||||
let max_degree_bits = log2_ceil(common_data.quotient_degree_factor);
|
||||
assert!(
|
||||
max_degree_bits <= common_data.config.rate_bits,
|
||||
"Having constraints of degree higher than the rate is not supported yet. \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user