mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-07 00:03:10 +00:00
fixes
This commit is contained in:
parent
e7b480deaf
commit
28603b85d1
@ -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)
|
||||
}
|
||||
|
||||
|
||||
@ -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>>(
|
||||
|
||||
@ -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>()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user