perf: skip redundant bit-reverse pair in R4 deep-composition LDE#566
Conversation
Codex Code ReviewNo issues found in the PR diff. I checked the changed FFT ordering path: Verification note: I attempted targeted |
Review: perf: skip redundant bit-reverse pair in R4 deep-composition LDEThe optimization is correct. The Bowers DIF FFT kernel leaves data in bit-reversed order; One real issueMedium – No test for This is a new public cryptographic API and the prover's soundness depends on it returning exactly bit-reversed evaluations. A wrong ordering would silently produce invalid proofs without panicking. A single round-trip test would close this gap: let mut expected = Polynomial::evaluate_fft::<F>(&poly, 1, Some(n)).unwrap();
in_place_bit_reverse_permute(&mut expected);
let got = Polynomial::evaluate_fft_bit_reversed::<F>(&poly, 1, Some(n)).unwrap();
assert_eq!(got, expected);Minor observations (no action required)
|
|
/bench 10 |
Benchmark — fib_iterative_8M (median of 3)Table parallelism: 1
Commit: bc40d33 · Baseline: built from main · Runner: self-hosted bench |
|
/bench k=1 |
Codex Code ReviewNo issues found in the PR diff. The new I attempted the targeted test:
but it could not run because Rustup tried to write under |
Review: perf: skip redundant bit-reverse pair in R4 deep-composition LDEThe optimization is correct and the property-based test validates it well. Three issues worth addressing: Medium
Low
|
Optimization extracted from PR #545.
The R4 deep-composition LDE ran
evaluate_fft(ends with a natural-order permute) followed byin_place_bit_reverse_permuteto feed FRI's commit phase, which already expects bit-reversedevaluations. The two permutes cancel out.
This PR adds
Polynomial::evaluate_fft_bit_reversed(same asevaluate_fftbut skips the finalpermute) and switches the R4 LDE site to use it, dropping both cancelling permutes.