addressed comments

This commit is contained in:
Nicholas Ward 2023-03-20 12:36:07 -07:00
parent 72b5bb0eac
commit f6b9d6ee2e
8 changed files with 21 additions and 17 deletions

View File

@ -50,14 +50,6 @@
%endrep
%endmacro
%macro neq
// stack: x, y
EQ
// stack: x == y
ISZERO
// stack: x != y
%endmacro
%macro and_const(c)
// stack: input, ...
PUSH $c

View File

@ -360,7 +360,7 @@ fn test_addmul_bignum_all() -> Result<()> {
for b in &inputs {
for c in &u128_inputs {
let output = addmul_outputs_iter.next().unwrap();
test_addmul_bignum(a.clone(), b.clone(), c.clone(), output.clone())?;
test_addmul_bignum(a.clone(), b.clone(), *c, output.clone())?;
}
}
}

View File

@ -78,12 +78,16 @@ impl<F: RichField + Extendable<D>, const D: usize> CircuitBuilder<F, D> {
assert!(
self.config.num_wires >= min_wires,
"To efficiently perform FRI checks with an arity of 2^{max_fri_arity_bits}, at least {min_wires} wires are needed. Consider reducing arity."
"To efficiently perform FRI checks with an arity of 2^{}, at least {} wires are needed. Consider reducing arity.",
max_fri_arity_bits,
min_wires
);
assert!(
self.config.num_routed_wires >= min_routed_wires,
"To efficiently perform FRI checks with an arity of 2^{max_fri_arity_bits}, at least {min_routed_wires} routed wires are needed. Consider reducing arity."
"To efficiently perform FRI checks with an arity of 2^{}, at least {} routed wires are needed. Consider reducing arity.",
max_fri_arity_bits,
min_routed_wires
);
}

View File

@ -38,7 +38,8 @@ impl<F: RichField + Extendable<D>, const D: usize> CircuitBuilder<F, D> {
let num_bits = bits.len();
assert!(
num_bits <= log_floor(F::ORDER, 2),
"{num_bits} bits may overflow the field"
"{} bits may overflow the field",
num_bits
);
if num_bits == 0 {
return self.zero();

View File

@ -361,7 +361,9 @@ impl<F: RichField + Extendable<D>, const D: usize> SimpleGenerator<F>
let access_index = access_index_f.to_canonical_u64() as usize;
debug_assert!(
access_index < vec_size,
"Access index {access_index} is larger than the vector size {vec_size}"
"Access index {} is larger than the vector size {}",
access_index,
vec_size
);
set_local_wire(

View File

@ -136,7 +136,9 @@ impl<F: RichField, H: Hasher<F>> MerkleTree<F, H> {
let log2_leaves_len = log2_strict(leaves.len());
assert!(
cap_height <= log2_leaves_len,
"cap_height={cap_height} should be at most log2(leaves.len())={log2_leaves_len}"
"cap_height={} should be at most log2(leaves.len())={}",
cap_height,
log2_leaves_len
);
let num_digests = 2 * (leaves.len() - (1 << cap_height));

View File

@ -89,7 +89,8 @@ pub(crate) fn generate_partial_witness<
assert_eq!(
remaining_generators, 0,
"{remaining_generators} generators weren't run",
"{} generators weren't run",
remaining_generators,
);
witness

View File

@ -284,7 +284,8 @@ impl<F: Field> WitnessWrite<F> for PartialWitness<F> {
if let Some(old_value) = opt_old_value {
assert_eq!(
value, old_value,
"Target {target:?} was set twice with different values: {old_value} != {value}"
"Target {:?} was set twice with different values: {} != {}",
target, old_value, value
);
}
}
@ -324,7 +325,8 @@ impl<'a, F: Field> PartitionWitness<'a, F> {
if let Some(old_value) = *rep_value {
assert_eq!(
value, old_value,
"Partition containing {target:?} was set twice with different values: {old_value} != {value}"
"Partition containing {:?} was set twice with different values: {} != {}",
target, old_value, value
);
None
} else {