Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/prover/src/core/backend/simd/circle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ impl SimdBackend {

// The caller function expects the mapping in natural order. i.e. (y,x,h(x),h(h(x)),...).
// If the polynomial is large, the fft does a transpose in the middle in a granularity of 16
// (avx512). The coefficients would then be in tranposed order of 16-sized chunks.
// (avx512). The coefficients would then be in transposed order of 16-sized chunks.
// i.e. (a_(n-15), a_(n-14), ..., a_(n-1), a_(n-31), ..., a_(n-16), a_(n-32), ...).
// To compute the twiddles in the correct order, we need to transpose the coprresponding
// 'transposed bits' in the mappings. The result order of the mappings would then be
// (y, x, h(x), h^2(x), h^(log_n-1)(x), h^(log_n-2)(x) ...). To avoid code
// complexity for now, we just reverse the mappings, transpose, then reverse back.
// TODO(Ohad): optimize. consider changing the caller to expect the mappings in
// reversed-tranposed order.
// reversed-transposed order.
if log_size > CACHED_FFT_LOG_SIZE {
mappings.reverse();
let n = mappings.len();
Expand Down Expand Up @@ -189,7 +189,7 @@ impl PolyOps for SimdBackend {
let twiddle_steps = Self::twiddle_steps(map_high);

// Every twiddle is a product of mappings that correspond to '1's in the bit representation
// of the current index. For every 2^n alligned chunk of 2^n elements, the twiddle
// of the current index. For every 2^n aligned chunk of 2^n elements, the twiddle
// array is the same, denoted twiddle_low. Use this to compute sums of (coeff *
// twiddle_high) mod 2^n, then multiply by twiddle_low, and sum to get the final result.
let mut sum = PackedSecureField::zeroed();
Expand All @@ -200,7 +200,7 @@ impl PolyOps for SimdBackend {
let high_twiddle_factors =
(PackedSecureField::broadcast(twiddle_high) * twiddle_mids).to_array();

// Sum the coefficients multiplied by each corrseponsing twiddle. Result is effectivley
// Sum the coefficients multiplied by each corrseponsing twiddle. Result is effectively
// an array[16] where the value at index 'i' is the sum of all coefficients at indices
// that are i mod 16.
for (&packed_coeffs, mid_twiddle) in zip(coeff_chunk, high_twiddle_factors) {
Expand Down
2 changes: 1 addition & 1 deletion crates/prover/src/core/backend/simd/fft/rfft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ pub fn simd_butterfly(
/// Runs fft on 2 vectors of 16 M31 elements.
///
/// This amounts to 4 butterfly layers, each with 16 butterflies.
/// Each of the vectors represents natural ordered polynomial coefficeint.
/// Each of the vectors represents natural ordered polynomial coefficient.
/// Each value in a vectors is in unreduced form: [0, P] including P.
/// Takes 4 twiddle arrays, one for each layer, holding the double of the corresponding twiddle.
/// The first layer (higher bit of the index) takes 2 twiddles.
Expand Down