mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-04 06:43:07 +00:00
Add row index to constraint failure message (#1598)
This commit is contained in:
parent
217b4a272c
commit
42a821dfde
@ -549,6 +549,8 @@ fn check_constraints<'a, F, C, S, const D: usize>(
|
|||||||
C: GenericConfig<D, F = F>,
|
C: GenericConfig<D, F = F>,
|
||||||
S: Stark<F, D>,
|
S: Stark<F, D>,
|
||||||
{
|
{
|
||||||
|
use core::any::type_name;
|
||||||
|
|
||||||
let degree = 1 << degree_bits;
|
let degree = 1 << degree_bits;
|
||||||
let rate_bits = 0; // Set this to higher value to check constraint degree.
|
let rate_bits = 0; // Set this to higher value to check constraint degree.
|
||||||
let total_num_helper_cols: usize = num_ctl_helper_cols.iter().sum();
|
let total_num_helper_cols: usize = num_ctl_helper_cols.iter().sum();
|
||||||
@ -656,11 +658,14 @@ fn check_constraints<'a, F, C, S, const D: usize>(
|
|||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
// Assert that all constraints evaluate to 0 over our subgroup.
|
// Assert that all constraints evaluate to 0 over our subgroup.
|
||||||
for v in constraint_values {
|
for (row, v) in constraint_values.iter().enumerate() {
|
||||||
assert!(
|
for x in v.iter() {
|
||||||
v.iter().all(|x| x.is_zero()),
|
assert!(
|
||||||
"Constraint failed in {}",
|
x.is_zero(),
|
||||||
core::any::type_name::<S>()
|
"Constraint failed in {} at row {}",
|
||||||
);
|
type_name::<S>(),
|
||||||
|
row
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user