This commit is contained in:
Daniel Lubarov 2022-06-29 17:34:38 -07:00
parent e7b480deaf
commit 28603b85d1
3 changed files with 17 additions and 2 deletions

View File

@ -225,6 +225,11 @@ mod tests {
.collect();
let mut cpu_trace_rows: Vec<[F; CpuStark::<F, D>::COLUMNS]> = vec![];
let mut bootstrap_row: cpu::columns::CpuColumnsView<F> =
[F::ZERO; CpuStark::<F, D>::COLUMNS].into();
bootstrap_row.is_bootstrap_kernel = F::ONE;
cpu_trace_rows.push(bootstrap_row.into());
for i in 0..num_keccak_perms {
let mut row: cpu::columns::CpuColumnsView<F> =
[F::ZERO; CpuStark::<F, D>::COLUMNS].into();
@ -299,6 +304,11 @@ mod tests {
row.mem_value[op][j] = memory_trace[memory::columns::value_limb(j)].values[i];
}
}
// Pad to a power of two.
for _ in cpu_trace_rows.len()..cpu_trace_rows.len().next_power_of_two() {
cpu_trace_rows.push([F::ZERO; CpuStark::<F, D>::COLUMNS]);
}
trace_rows_to_poly_values(cpu_trace_rows)
}

View File

@ -30,7 +30,6 @@ pub(crate) fn generate_bootstrap_kernel<F: Field>(state: &mut GenerationState<F>
state.commit_cpu_row();
}
}
todo!()
}
pub(crate) fn eval_bootstrap_kernel<F: Field, P: PackedField<Scalar = F>>(

View File

@ -1,3 +1,5 @@
use std::any::type_name;
use anyhow::{ensure, Result};
use plonky2::field::extension::Extendable;
use plonky2::field::packable::Packable;
@ -563,6 +565,10 @@ fn check_constraints<'a, F, C, S, const D: usize>(
.collect::<Vec<_>>();
for v in constraint_values {
assert!(v.iter().all(|x| x.is_zero()));
assert!(
v.iter().all(|x| x.is_zero()),
"Constraint failed in {}",
type_name::<S>()
);
}
}