Skip to content

Commit 561a525

Browse files
committed
refactor: removing unnecessary flags and fixing linting issues
1 parent 7083b20 commit 561a525

File tree

10 files changed

+15
-25
lines changed

10 files changed

+15
-25
lines changed

crates/whir/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ nightly-features = [
4343
"transcript/nightly-features",
4444
"witness/nightly-features",
4545
]
46-
parallel = ["p3-maybe-rayon/parallel","dep:rayon"]
46+
parallel = ["p3-maybe-rayon/parallel", "dep:rayon"]
4747
print-trace = ["tracing/log"]
4848
rayon = ["dep:rayon"]

crates/whir/src/ntt/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ mod wavelet;
99

1010
use self::matrix::MatrixMut;
1111

12-
#[cfg(feature = "parallel")]
13-
use p3::maybe_rayon::prelude::*;
1412
use p3::{
1513
dft::{Radix2DitParallel, TwoAdicSubgroupDft},
1614
field::TwoAdicField,
1715
matrix::Matrix,
16+
maybe_rayon::prelude::*,
1817
};
1918
use tracing::instrument;
2019
use witness::{InstancePaddingStrategy, RowMajorMatrix};

crates/whir/src/ntt/ntt_impl.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,15 @@ use p3::{
1414
Matrix,
1515
dense::{DenseMatrix, RowMajorMatrix},
1616
},
17+
maybe_rayon::prelude::*,
1718
};
1819
use std::{
1920
any::{Any, TypeId},
21+
cmp::max,
2022
collections::HashMap,
2123
sync::{Arc, LazyLock, Mutex, RwLock, RwLockReadGuard},
2224
};
2325

24-
#[cfg(feature = "parallel")]
25-
use {rayon::prelude::*, std::cmp::max};
26-
2726
/// Global cache for NTT engines, indexed by field.
2827
// TODO: Skip `LazyLock` when `HashMap::with_hasher` becomes const.
2928
// see https://github.com/rust-lang/rust/issues/102575

crates/whir/src/ntt/transpose.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ use p3::{
77
matrix::{Matrix, dense::RowMajorMatrix},
88
maybe_rayon::prelude::*,
99
};
10-
#[cfg(feature = "parallel")]
11-
use rayon::join;
1210
use sumcheck::macros::{entered_span, exit_span};
1311

1412
// NOTE: The assumption that rows and cols are a power of two are actually only relevant for the square matrix case.

crates/whir/src/ntt/wavelet.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use super::{transpose, utils::workload_size};
22
use p3::field::Field;
33
use std::cmp::max;
44

5-
#[cfg(feature = "parallel")]
65
use p3::maybe_rayon::prelude::*;
76

87
/// Fast Wavelet Transform.

crates/whir/src/sumcheck/prover_batched.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ use super::proof::SumcheckPolynomial;
22
use crate::sumcheck::prover_single::SumcheckSingle;
33
use ff_ext::ExtensionField;
44
use p3::{field::Field, maybe_rayon::prelude::*, util::log2_strict_usize};
5-
#[cfg(feature = "parallel")]
6-
use rayon::join;
75

86
pub struct SumcheckBatched<F: ExtensionField> {
97
// The evaluation on each p and eq

crates/whir/src/sumcheck/prover_single.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use super::proof::SumcheckPolynomial;
22

33
use ff_ext::ExtensionField;
4-
use p3::{maybe_rayon::prelude::*, util::log2_strict_usize};
54
#[cfg(feature = "parallel")]
6-
use rayon::join;
5+
use p3::maybe_rayon::prelude::join;
6+
use p3::{maybe_rayon::prelude::*, util::log2_strict_usize};
77

88
pub struct SumcheckSingle<E: ExtensionField> {
99
// The evaluation of p
@@ -261,10 +261,12 @@ mod tests {
261261

262262
let eval = MultilinearExtension::from_evaluations_ext_vec(2, polynomial.clone())
263263
.evaluate(&eval_point);
264-
let mut prover =
265-
SumcheckSingle::new(polynomial, &[eval_point], &[E::from_canonical_u64(1)], &[
266-
eval,
267-
]);
264+
let mut prover = SumcheckSingle::new(
265+
polynomial,
266+
&[eval_point],
267+
&[E::from_canonical_u64(1)],
268+
&[eval],
269+
);
268270

269271
let poly_1 = prover.compute_sumcheck_polynomial();
270272

crates/whir/src/whir/batch/committer.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@ use derive_more::Debug;
1313
use ff_ext::ExtensionField;
1414
use p3::{
1515
matrix::{Matrix, dense::RowMajorMatrix},
16+
maybe_rayon::prelude::*,
1617
util::log2_strict_usize,
1718
};
1819
use sumcheck::macros::{entered_span, exit_span};
1920
use transcript::{BasicTranscript, Transcript};
2021

21-
#[cfg(feature = "parallel")]
22-
use p3::maybe_rayon::prelude::*;
23-
2422
#[derive(Debug)]
2523
pub struct Witnesses<E: ExtensionField> {
2624
pub(crate) polys: Vec<Vec<E::BaseField>>,

crates/whir/src/whir/batch/prover.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ use crate::{
2121
use ff_ext::{ExtensionField, PoseidonField};
2222
use itertools::zip_eq;
2323
use multilinear_extensions::mle::{FieldType, MultilinearExtension};
24-
use p3::{commit::Mmcs, matrix::dense::RowMajorMatrix};
24+
use p3::{commit::Mmcs, matrix::dense::RowMajorMatrix, maybe_rayon::prelude::*};
2525
use sumcheck::macros::{entered_span, exit_span};
2626
use transcript::Transcript;
2727

2828
use crate::whir::fs_utils::get_challenge_stir_queries;
29-
#[cfg(feature = "parallel")]
30-
use p3::maybe_rayon::prelude::*;
3129

3230
struct RoundStateBatch<'a, E: ExtensionField> {
3331
round_state: RoundState<'a, E>,

crates/whir/src/whir/fold.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ use crate::{
33
parameters::FoldType,
44
};
55

6-
#[cfg(feature = "parallel")]
7-
use p3::maybe_rayon::prelude::*;
86
use p3::{
97
field::{Field, TwoAdicField},
108
matrix::Matrix,
9+
maybe_rayon::prelude::*,
1110
};
1211

1312
/// Given the evaluation of f on the coset specified by coset_offset * <coset_gen>

0 commit comments

Comments
 (0)