Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crypto/stark/src/logup_gpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ mod tests {
let mut out = Vec::with_capacity(num_rows);
for row in 0..num_rows {
// Forward accumulation: acc[0] = 0, fold the current row afterwards.
out.push(acc.clone());
out.push(acc);
let mut rs = FieldElement::<E>::zero();
for c in cols {
rs = &rs + &c[row];
Expand Down
10 changes: 5 additions & 5 deletions crypto/stark/src/lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2346,7 +2346,7 @@ mod logup_single_source_tests {
//! (verifier) — all bit-for-bit.
//!
//! Coverage: the accumulated constraint's 1-absorbed AND 2-absorbed branches
//! (the latter reads `aux(1, ·)` next-row cells), the batched-term
//! (the latter folds two absorbed interactions, degree 3), the batched-term
//! constraint, and every [`Packing`] variant's fingerprint contribution.
use super::*;
use crate::constraint_ir::{eval_program, eval_program_verifier};
Expand Down Expand Up @@ -2432,11 +2432,11 @@ mod logup_single_source_tests {
let n_fe = Fp3::from(n_rows as u64);
for i in 0..n_rows {
let mut row_sum = Fp3::zero();
for c in 0..n_term_cols {
row_sum = row_sum + &term_columns[c][i];
for col in &term_columns {
row_sum = row_sum + &col[i];
}
let acc_i = trace.get_aux(i, acc_col_idx).clone();
let acc_next = trace.get_aux((i + 1) % n_rows, acc_col_idx).clone();
let acc_i = *trace.get_aux(i, acc_col_idx);
let acc_next = *trace.get_aux((i + 1) % n_rows, acc_col_idx);
let lhs = (acc_next - acc_i) * &n_fe;
let rhs = row_sum * &n_fe - &l;
assert_eq!(lhs, rhs, "forward circular recurrence broken at row {i}");
Expand Down
26 changes: 20 additions & 6 deletions crypto/stark/src/ood.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
//! Shared, prover = verifier-identical helpers for out-of-domain (OOD) trace
//! opening pruning.
//!
//! The frame OOD table has `num_offsets * step_size` rows (offsets `[0, 1]`,
//! offset-major: the first `step_size` rows are the current-row block, the rest
//! are next-row blocks) and one column per trace column. Only the columns a
//! transition constraint actually reads at the next row — the AIR's transition
//! window, [`crate::traits::AIR::trace_ood_next_row_columns`] — need to be
//! The frame OOD table has `num_offsets * step_size` rows (offset-major: the
//! first `step_size` rows are offset 0's current-row block, and every later
//! offset contributes a `step_size`-row next-row block) and one column per
//! trace column. Only the columns a transition constraint actually reads at the
//! next row — the AIR's transition window,
//! [`crate::traits::AIR::trace_ood_next_row_columns`] — need to be
//! opened in the next-row block(s). Every other next-row entry is redundant and
//! is pruned from the proof.
//!
Expand Down Expand Up @@ -49,6 +50,12 @@ pub fn num_surviving_trace_openings(
/// summing only the survivors — which is what lets the prover keep its
/// (GPU-friendly) rectangular DEEP unchanged.
///
/// Precondition: `powers.len() == num_surviving_trace_openings(num_total_cols,
/// num_eval_points, step_size, next_row_cols.len())` for the same layout args —
/// every power binds to exactly one surviving position and every surviving
/// position consumes exactly one power. Both operands are AIR-metadata-derived
/// (invariant I3), so this holds for every real AIR; a debug build checks it.
///
/// Assignment order (mirrored exactly by [`num_surviving_trace_openings`]):
/// 1. current-row block — for every column `j`, rows `0..step_size`;
/// 2. next-row block — for each masked column `j`, rows `step_size..num_eval_points`.
Expand Down Expand Up @@ -226,7 +233,14 @@ mod tests {
let full = Table::new(vec![fe(10), fe(11), fe(20), fe(21)], 2);
let (b0, b1) = split_ood_blocks(&full, 1, &[]);
assert_eq!(b1.width, 0);
let recon = reconstruct_ood_full(b0.row_major_data(), b0.width, b1.row_major_data(), 2, 1, &[]);
let recon = reconstruct_ood_full(
b0.row_major_data(),
b0.width,
b1.row_major_data(),
2,
1,
&[],
);
assert_eq!(recon.get_row(0), full.get_row(0));
assert_eq!(recon.get_row(1), &[Fe::zero(), Fe::zero()]);
}
Expand Down
2 changes: 1 addition & 1 deletion crypto/stark/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ pub trait IsStarkVerifier<
let expected_next_height = if expected_next_width == 0 {
0
} else {
num_eval_points - step_size
num_eval_points.saturating_sub(step_size)
};
let ood_current = proof.trace_ood_evaluations();
let ood_next = proof.trace_ood_next_evaluations();
Expand Down
Loading