diff --git a/src/gates/gate_testing.rs b/src/gates/gate_testing.rs index b71d1509..4a6c80df 100644 --- a/src/gates/gate_testing.rs +++ b/src/gates/gate_testing.rs @@ -36,6 +36,12 @@ pub(crate) fn test_low_degree, G: Gate, const D: usize>(g .map(|p| p.degree()) .collect::>(); + assert_eq!( + constraint_eval_degrees.len(), + gate.num_constraints(), + "eval should return num_constraints() constraints" + ); + let expected_eval_degree = WITNESS_DEGREE * gate.degree(); assert!( diff --git a/src/gates/reducing.rs b/src/gates/reducing.rs index 9404cf93..0129a156 100644 --- a/src/gates/reducing.rs +++ b/src/gates/reducing.rs @@ -22,7 +22,7 @@ impl ReducingGate { } pub fn max_coeffs_len(num_wires: usize, num_routed_wires: usize) -> usize { - (num_routed_wires - 3 * D).min((num_wires - 3 * D) / (D + 1)) + (num_routed_wires - 3 * D).min((num_wires - 2 * D) / (D + 1)) } pub fn wires_output() -> Range { @@ -56,7 +56,6 @@ impl, const D: usize> Gate for ReducingGate { } fn eval_unfiltered(&self, vars: EvaluationVars) -> Vec { - let output = vars.get_local_ext_algebra(Self::wires_output()); let alpha = vars.get_local_ext_algebra(Self::wires_alpha()); let old_acc = vars.get_local_ext_algebra(Self::wires_old_acc()); let coeffs = self @@ -81,7 +80,6 @@ impl, const D: usize> Gate for ReducingGate { } fn eval_unfiltered_base(&self, vars: EvaluationVarsBase) -> Vec { - let output = vars.get_local_ext(Self::wires_output()); let alpha = vars.get_local_ext(Self::wires_alpha()); let old_acc = vars.get_local_ext(Self::wires_old_acc()); let coeffs = self @@ -110,7 +108,6 @@ impl, const D: usize> Gate for ReducingGate { builder: &mut CircuitBuilder, vars: EvaluationTargets, ) -> Vec> { - let output = vars.get_local_ext_algebra(Self::wires_output()); let alpha = vars.get_local_ext_algebra(Self::wires_alpha()); let old_acc = vars.get_local_ext_algebra(Self::wires_old_acc()); let coeffs = self @@ -150,7 +147,7 @@ impl, const D: usize> Gate for ReducingGate { } fn num_wires(&self) -> usize { - 3 * D + self.num_coeffs * (D + 1) + 2 * D + self.num_coeffs * (D + 1) } fn num_constants(&self) -> usize { @@ -162,7 +159,7 @@ impl, const D: usize> Gate for ReducingGate { } fn num_constraints(&self) -> usize { - D * (self.num_coeffs + 1) + D * self.num_coeffs } }