Skip to content

Commit

Permalink
chore: rebase and remove conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Al-Kindi-0 committed Aug 27, 2024
1 parent f4034ff commit f57cda9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion air/src/air/aux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl<E: FieldElement> GkrData<E> {
.fold(E::ZERO, |acc, (a, b)| acc + *a * *b)
}

pub fn compute_batched_query_<F>(&self, query: &[F]) -> E
pub fn compute_batched_query<F>(&self, query: &[F]) -> E
where
F: FieldElement<BaseField = E::BaseField>,
E: ExtensionOf<F>,
Expand Down
8 changes: 1 addition & 7 deletions air/src/air/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ use core::cmp;

use math::StarkField;

use crate::{air::TransitionConstraintDegree, ProofOptions, TraceInfo};

use super::LAGRANGE_KERNEL_OFFSET;
use crate::{air::TransitionConstraintDegree, ProofOptions, TraceInfo};

// AIR CONTEXT
// ================================================================================================
Expand Down Expand Up @@ -266,11 +265,6 @@ impl<B: StarkField, P> AirContext<B, P> {
self.logup_gkr
}

/// Returns true if the auxiliary trace segment contains a Lagrange kernel column
pub fn is_with_logup_gkr(&self) -> bool {
self.logup_gkr
}

/// Returns the total number of assertions defined for a computation, excluding the Lagrange
/// kernel assertion, which is managed separately.
///
Expand Down
9 changes: 6 additions & 3 deletions prover/src/constraints/evaluator/logup_gkr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
use alloc::vec::Vec;

use air::{
Air, EvaluationFrame, GkrData, LagrangeConstraintsCompositionCoefficients, LagrangeKernelConstraints, LagrangeKernelEvaluationFrame, LogUpGkrEvaluator, LAGRANGE_KERNEL_OFFSET, S_COLUMN_OFFSET
Air, EvaluationFrame, GkrData, LagrangeConstraintsCompositionCoefficients,
LagrangeKernelConstraints, LagrangeKernelEvaluationFrame, LogUpGkrEvaluator,
LAGRANGE_KERNEL_OFFSET, S_COLUMN_OFFSET,
};
use math::{batch_inversion, FieldElement};

Expand Down Expand Up @@ -79,6 +81,7 @@ where

let c = self.gkr_data.compute_batched_claim();
let mean = c / E::from(E::BaseField::from(trace.trace_info().length() as u32));
let mut query = vec![E::BaseField::ZERO; evaluator.get_oracles().len()];

for step in 0..domain.ce_domain_size() {
// compute Lagrange kernel frame
Expand Down Expand Up @@ -129,8 +132,8 @@ where
let s_cur = aux_frame.current()[s_col_idx];
let s_nxt = aux_frame.next()[s_col_idx];

let query = evaluator.build_query(&main_frame, &[]);
let batched_query = self.gkr_data.compute_batched_query_(&query);
evaluator.build_query(&main_frame, &[], &mut query);
let batched_query = self.gkr_data.compute_batched_query(&query);

let rhs = s_cur - mean + batched_query * l_cur;
let lhs = s_nxt;
Expand Down
6 changes: 4 additions & 2 deletions verifier/src/evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ pub fn evaluate_constraints<A: Air, E: FieldElement<BaseField = A::BaseField>>(
let mean = batched_claim
.mul_base(E::BaseField::ONE / E::BaseField::from(air.trace_length() as u32));

let query = air.get_logup_gkr_evaluator::<E>().build_query(main_trace_frame, &[]);
let batched_claim_at_query = gkr_data.compute_batched_query_::<E>(&query);
let mut query = vec![E::ZERO; air.get_logup_gkr_evaluator::<E>().get_oracles().len()];
air.get_logup_gkr_evaluator::<E>()
.build_query(main_trace_frame, &[], &mut query);
let batched_claim_at_query = gkr_data.compute_batched_query::<E>(&query);
let rhs = s_cur - mean + batched_claim_at_query * l_cur;
let lhs = s_nxt;

Expand Down

0 comments on commit f57cda9

Please sign in to comment.