Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
292fce8
port logup gkr
jotabulacios Mar 27, 2026
bbe4dbc
docs: add scaling improvements spec (unified sizing + MMCS + shared FRI)
diegokingston Apr 9, 2026
d566602
perf(tables): cap LT/LOAD/BRANCH/MEMW_R max_rows at 2^20
diegokingston Apr 9, 2026
c3f5719
perf(stark): deduplicate LdeTwiddles by domain size in multi_prove
diegokingston Apr 9, 2026
3aa03e6
perf(fri): parallelize fold_evaluations_in_place with Rayon
diegokingston Apr 9, 2026
ccb7548
perf(prover): eliminate per-row Vec alloc in commit_columns_bit_reversed
diegokingston Apr 9, 2026
b2821bf
Merge feat/logup_gkr_v2: GKR-based LogUp protocol
diegokingston Apr 9, 2026
36150b8
perf(gkr): parallelize fold_table inner loop with par_chunks(2)
diegokingston Apr 9, 2026
9b038bf
feat(gkr): wire batch GKR into STARK prover and verifier
diegokingston Apr 9, 2026
7ec0b56
perf(gkr): split-value optimization for eq polynomial in sumcheck
diegokingston Apr 9, 2026
dd6a214
Eliminate O(N) combined_claims recompute in batch GKR by evaluating
jotabulacios Apr 9, 2026
a9aa266
save work
jotabulacios Apr 9, 2026
fb65d0f
Port split-value eq optimization (SVO) to batch GKR sumcheck inner
jotabulacios Apr 9, 2026
95deda4
Fix three verifier panics in batch GKR
nicole-graus Apr 13, 2026
54dfa97
Prevent verifier DoS via unchecked layer_proofs length and child_clai…
nicole-graus Apr 13, 2026
d04f642
Fix Lagrange kernel soundness, 0-layer bus forgery, and column_claims…
nicole-graus Apr 13, 2026
334093f
Merge branch 'main' into feat/gkr-logup
nicole-graus Apr 13, 2026
dfd4c53
Return false instead of panicking on zero GKR root denominator
nicole-graus Apr 13, 2026
6ee8c77
Merge branch 'feat/gkr-logup' of github.com:yetanotherco/null-vm into…
nicole-graus Apr 13, 2026
e7761ed
Add gate check for trivial layers and fix single-proof API
nicole-graus Apr 13, 2026
72ad8cf
Delete dead pub, return Result instead of panicking, fix comment and …
nicole-graus Apr 13, 2026
78be304
fix fmt
nicole-graus Apr 13, 2026
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
42 changes: 40 additions & 2 deletions crypto/stark/src/constraints/evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ use rayon::{
};

use std::marker::PhantomData;
#[cfg(feature = "instruments")]
use std::time::Instant;

pub struct ConstraintEvaluator<
Field: IsSubFieldOf<FieldExtension> + IsFFTField + Send + Sync,
Expand Down Expand Up @@ -252,6 +254,9 @@ where
#[cfg(all(debug_assertions, not(feature = "parallel")))]
let boundary_polys: Vec<Polynomial<FieldElement<Field>>> = Vec::new();

#[cfg(feature = "instruments")]
let timer = Instant::now();

let trace_length = domain.interpolation_domain_size;
let lde_periodic_columns = air
.get_periodic_column_polynomials(trace_length)
Expand All @@ -267,6 +272,15 @@ where
.collect::<Result<Vec<Vec<FieldElement<Field>>>, FFTError>>()
.unwrap();

#[cfg(feature = "instruments")]
println!(
" Evaluating periodic columns on lde: {:#?}",
timer.elapsed()
);

#[cfg(feature = "instruments")]
let timer = Instant::now();

// Fused boundary evaluation: compute (trace[col] - value) on-the-fly
// instead of pre-computing all boundary_polys_evaluations.
// This eliminates N_constraints × LDE_size intermediate allocations.
Expand Down Expand Up @@ -296,6 +310,12 @@ where
})
.collect();

#[cfg(feature = "instruments")]
println!(
" Evaluated boundary polynomials on LDE: {:#?}",
timer.elapsed()
);

#[cfg(all(debug_assertions, not(feature = "parallel")))]
let boundary_zerofiers = Vec::new();

Expand All @@ -305,17 +325,27 @@ where
#[cfg(all(debug_assertions, not(feature = "parallel")))]
let _transition_evaluations: Vec<FieldElement<FieldExtension>> = Vec::new();

#[cfg(feature = "instruments")]
let timer = Instant::now();
let zerofier_data = air.transition_zerofier_evaluations_grouped(domain);
#[cfg(feature = "instruments")]
println!(
" Evaluated transition zerofiers: {:#?}",
timer.elapsed()
);

// Iterate over all LDE domain and compute the part of the composition polynomial
// related to the transition constraints and add it to the already computed part of the
// boundary constraints.

#[cfg(feature = "instruments")]
let timer = Instant::now();

let num_transition = air.num_transition_constraints();
let num_periodic = lde_periodic_columns.len();
let offsets = &air.context().transition_offsets;

Self::evaluate_transitions(
let evaluations_t = Self::evaluate_transitions(
air,
lde_trace,
&lde_periodic_columns,
Expand All @@ -327,6 +357,14 @@ where
num_periodic,
offsets,
&self.logup_table_offset,
)
);

#[cfg(feature = "instruments")]
println!(
" Evaluated transitions and accumulated results: {:#?}",
timer.elapsed()
);

evaluations_t
}
}
2 changes: 2 additions & 0 deletions crypto/stark/src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ pub fn validate_trace<
.map(|(trace_steps, constraint)| trace_steps - constraint.end_exemptions())
.collect();

// Pre-compute LogUp alpha powers once for all steps.
let logup_alpha_powers: Vec<FieldElement<FieldExtension>> =
if rap_challenges.len() > LOGUP_CHALLENGE_ALPHA {
compute_alpha_powers(
Expand All @@ -106,6 +107,7 @@ pub fn validate_trace<
Vec::new()
};

// Compute logup_table_offset = table_contribution / trace_length
let logup_table_offset = match bus_public_inputs {
Some(bpi) => {
let n_inv = FieldElement::<Field>::from(trace_length as u64)
Expand Down
38 changes: 30 additions & 8 deletions crypto/stark/src/fri/fri_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,37 @@ pub fn fold_evaluations_in_place<F: IsSubFieldOf<E>, E: IsField>(
zeta: &FieldElement<E>,
inv_twiddles: &[FieldElement<F>],
) {
let half = evals.len() / 2;
for j in 0..half {
let lo = &evals[2 * j];
let hi = &evals[2 * j + 1];
let sum = lo + hi;
let diff = lo - hi;
evals[j] = &sum + &(&inv_twiddles[j] * &(zeta * &diff));
#[cfg(feature = "parallel")]
{
use rayon::prelude::*;
// Evaluations are stored interleaved: pairs (evals[2j], evals[2j+1]).
// Fold each pair in parallel, collecting into a new Vec of half length.
let folded: Vec<FieldElement<E>> = evals
.par_chunks(2)
.zip(inv_twiddles.par_iter())
.map(|(pair, tw)| {
let lo = &pair[0];
let hi = &pair[1];
let sum = lo + hi;
let diff = lo - hi;
&sum + &(tw * &(zeta * &diff))
})
.collect();
*evals = folded;
}

#[cfg(not(feature = "parallel"))]
{
let half = evals.len() / 2;
for j in 0..half {
let lo = &evals[2 * j];
let hi = &evals[2 * j + 1];
let sum = lo + hi;
let diff = lo - hi;
evals[j] = &sum + &(&inv_twiddles[j] * &(zeta * &diff));
}
evals.truncate(half);
}
evals.truncate(half);
}

/// Compute inverse twiddle factors for evaluation-form FRI folding.
Expand Down
Loading
Loading