Skip to content

Commit

Permalink
chore(deps): upgrade twenty-first to v0.40.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ferdinand committed Apr 16, 2024
1 parent 29849ab commit 751aa0f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
5 changes: 1 addition & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ strum = { version = "0.26", features = ["derive"] }
syn = "2.0"
test-strategy = "0.3.1"
thiserror = "1.0"
twenty-first = "0.38"
twenty-first = "0.40"
unicode-width = "0.1"

[workspace.lints.clippy]
Expand Down Expand Up @@ -111,6 +111,3 @@ verbose_bit_mask = "warn"
version = "1.5"
default-features = false
features = ["precommit-hook", "run-cargo-clippy", "run-cargo-fmt"]

[patch.crates-io]
twenty-first = { git = "https://github.com/Neptune-Crypto/twenty-first.git", rev = "b57ed599" }
4 changes: 2 additions & 2 deletions triton-vm/src/arithmetic_domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl ArithmeticDomain {
{
self.domain_values()
.iter()
.map(|&v| polynomial.evaluate(&v.into()))
.map(|&v| polynomial.evaluate(v.into()))
.collect()
}

Expand Down Expand Up @@ -235,7 +235,7 @@ mod tests {
// Verify that batch-evaluated values match a manual evaluation
for i in 0..order {
assert_eq!(
poly.evaluate(&b_domain.domain_value(i as u32)),
poly.evaluate(b_domain.domain_value(i as u32)),
values[i as usize]
);
}
Expand Down
14 changes: 7 additions & 7 deletions triton-vm/src/stark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl Stark {
let out_of_domain_point_curr_row_pow_num_segments =
out_of_domain_point_curr_row.mod_pow_u32(NUM_QUOTIENT_SEGMENTS as u32);
let out_of_domain_curr_row_quot_segments = quotient_segment_polynomials
.map(|poly| poly.evaluate(&out_of_domain_point_curr_row_pow_num_segments))
.map(|poly| poly.evaluate(out_of_domain_point_curr_row_pow_num_segments))
.to_vec()
.try_into()
.unwrap();
Expand Down Expand Up @@ -345,7 +345,7 @@ impl Stark {
prof_stop!(maybe_profiler, "interpolate");
prof_start!(maybe_profiler, "base&ext curr row");
let out_of_domain_curr_row_base_and_ext_value =
base_and_ext_interpolation_poly.evaluate(&out_of_domain_point_curr_row);
base_and_ext_interpolation_poly.evaluate(out_of_domain_point_curr_row);
let base_and_ext_curr_row_deep_codeword = Self::deep_codeword(
&base_and_ext_codeword.to_vec(),
short_domain,
Expand All @@ -356,7 +356,7 @@ impl Stark {

prof_start!(maybe_profiler, "base&ext next row");
let out_of_domain_next_row_base_and_ext_value =
base_and_ext_interpolation_poly.evaluate(&out_of_domain_point_next_row);
base_and_ext_interpolation_poly.evaluate(out_of_domain_point_next_row);
let base_and_ext_next_row_deep_codeword = Self::deep_codeword(
&base_and_ext_codeword.to_vec(),
short_domain,
Expand All @@ -367,7 +367,7 @@ impl Stark {

prof_start!(maybe_profiler, "segmented quotient");
let out_of_domain_curr_row_quot_segments_value = quotient_segments_interpolation_poly
.evaluate(&out_of_domain_point_curr_row_pow_num_segments);
.evaluate(out_of_domain_point_curr_row_pow_num_segments);
let quotient_segments_curr_row_deep_codeword = Self::deep_codeword(
&quotient_segments_codeword.to_vec(),
short_domain,
Expand Down Expand Up @@ -2418,7 +2418,7 @@ pub(crate) mod tests {
let low_deg_codeword = domain.evaluate(&low_deg_poly);

let out_of_domain_point: XFieldElement = thread_rng().gen();
let out_of_domain_value = low_deg_poly.evaluate(&out_of_domain_point);
let out_of_domain_value = low_deg_poly.evaluate(out_of_domain_point);

let deep_poly = Stark::deep_codeword(
&low_deg_codeword,
Expand Down Expand Up @@ -2449,11 +2449,11 @@ pub(crate) mod tests {
) {
let x_pow_n = x.mod_pow_u32(N as u32);
let evaluate_segment = |(segment_idx, segment): (_, &Polynomial<_>)| {
segment.evaluate(&x_pow_n) * x.mod_pow_u32(segment_idx as u32)
segment.evaluate(x_pow_n) * x.mod_pow_u32(segment_idx as u32)
};
let evaluated_segments = segments.iter().enumerate().map(evaluate_segment);
let sum_of_evaluated_segments = evaluated_segments.fold(FF::zero(), |acc, x| acc + x);
assert!(f.evaluate(&x) == sum_of_evaluated_segments);
assert!(f.evaluate(x) == sum_of_evaluated_segments);
}

fn assert_segments_degrees_are_small_enough<const N: usize, FF: FiniteField>(
Expand Down
12 changes: 6 additions & 6 deletions triton-vm/src/table/master_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ impl MasterTable<BFieldElement> for MasterBaseTable {
fn row(&self, row_index: XFieldElement) -> Array1<XFieldElement> {
self.interpolation_polynomials()
.into_par_iter()
.map(|polynomial| polynomial.evaluate(&row_index))
.map(|polynomial| polynomial.evaluate(row_index))
.collect::<Vec<_>>()
.into()
}
Expand Down Expand Up @@ -557,7 +557,7 @@ impl MasterTable<XFieldElement> for MasterExtTable {
self.interpolation_polynomials()
.slice(s![..NUM_EXT_COLUMNS])
.into_par_iter()
.map(|polynomial| polynomial.evaluate(&row_index))
.map(|polynomial| polynomial.evaluate(row_index))
.collect::<Vec<_>>()
.into()
}
Expand Down Expand Up @@ -1266,7 +1266,7 @@ mod tests {
assert_eq!(big_order as usize, initial_zerofier_inv.len());
assert_eq!(1, initial_zerofier_poly.degree());
assert!(initial_zerofier_poly
.evaluate(&small_domain.domain_value(0))
.evaluate(small_domain.domain_value(0))
.is_zero());

let consistency_zerofier_inv =
Expand All @@ -1277,7 +1277,7 @@ mod tests {
assert_eq!(big_order as usize, consistency_zerofier_inv.len());
assert_eq!(small_order as isize, consistency_zerofier_poly.degree());
for val in small_domain.domain_values() {
assert!(consistency_zerofier_poly.evaluate(&val).is_zero());
assert!(consistency_zerofier_poly.evaluate(val).is_zero());
}

let transition_zerofier_inv =
Expand All @@ -1286,7 +1286,7 @@ mod tests {
let transition_zerofier_poly = big_domain.interpolate(&transition_zerofier);
assert_eq!(big_order as usize, transition_zerofier_inv.len());
assert_eq!(small_order as isize - 1, transition_zerofier_poly.degree());
for val in small_domain
for &val in small_domain
.domain_values()
.iter()
.take(small_order as usize - 1)
Expand All @@ -1300,7 +1300,7 @@ mod tests {
assert_eq!(big_order as usize, terminal_zerofier_inv.len());
assert_eq!(1, terminal_zerofier_poly.degree());
assert!(terminal_zerofier_poly
.evaluate(&small_domain.domain_value(small_order as u32 - 1))
.evaluate(small_domain.domain_value(small_order as u32 - 1))
.is_zero());
}

Expand Down

0 comments on commit 751aa0f

Please sign in to comment.