The COOLJAPAN scientific stack just got its spectral backbone — written entirely in Rust.
Today we released OxiFFT 0.1.0 — a Pure Rust implementation of FFTW3, the Fastest Fourier Transform in the West, bringing FFTW’s algorithms and planning system to Rust without a single line of C.
No C. No Fortran. No FFI, no bindgen, no build.rs linking against a system library.
No vendored cufft.h, no autotools, no version-skew between your compiler and someone else’s.
Just clean, memory-safe, SIMD-accelerated transforms that compile to a single static binary — or to WASM for the browser.
For the COOLJAPAN ecosystem this also closes a policy gap: OxiFFT is the mandated replacement for rustfft. Every spectral path in SciRS2, NumRS2, and the signal/audio work downstream now has a sovereign, dependency-light foundation to build on.
Why 0.1.0 matters
For decades, serious FFT work meant linking FFTW — a brilliant but heavy C library with its own build system, wisdom files, and platform quirks. The Rust world reached for rustfft, which is excellent but deliberately narrow: power-of-two-friendly complex transforms and not much beyond.
OxiFFT aims higher. It ports FFTW’s breadth — every transform type, every algorithm, the planner, the wisdom system — into safe Rust, and then keeps going past what FFTW offers.
This first release is a genuine first real release: the core is complete and tested, not a sketch.
- 629 unit tests passing, validated against a Direct O(n²) reference and cross-checked with
rustfft. - Zero clippy warnings across all features (186 lint sites cleared during hardening).
- Pure Rust default build —
no_stdcapable, withstdandthreadingas the default features. - Composite-size performance already ahead of RustFFT on sizes like 20, 30, 36, 45, 48, 50, 60, 80, and 100.
Technical Deep Dive: How OxiFFT rebuilds FFTW in Rust
The library is a Cargo workspace of three crates — oxifft (the library), oxifft-codegen (a proc-macro crate that generates SIMD codelets), and oxifft-bench (the benchmark suite with optional FFTW comparison).
-
Algorithm core. A full complement of complex-DFT algorithms: Cooley-Tukey (DIT/DIF, radix-2/4/8 and split-radix), Rader’s algorithm for prime sizes, Bluestein’s Chirp-Z for arbitrary sizes, a direct O(n²) solver for tiny inputs, and a generic mixed-radix solver for composites. Real transforms (R2C / C2R / R2R), all eight DCT/DST variants, and the Discrete Hartley Transform sit on top.
-
SIMD codelet layer. Architecture-specific kernels — SSE2, AVX, AVX2, AVX-512 on x86_64; NEON and SVE on aarch64; simd128 on WASM — selected by runtime CPU feature detection, with a portable scalar fallback. The Stockham radix-4 path uses precomputed twiddle tables.
-
Planning and wisdom. Four planning modes (
ESTIMATE,MEASURE,PATIENT,EXHAUSTIVE) mirror FFTW’s flags, and a wisdom system caches and serializes plans to disk so repeated transforms skip the planning cost. -
Dimensions, batching, and the guru interface. 1D/2D/3D and N-D transforms via row-column decomposition, vector-rank batching for many simultaneous transforms, and a
GuruPlanguru interface for full control over strides and split-complex layouts.
Getting Started
cargo add oxifft
A minimal forward-and-inverse 1D FFT:
use oxifft::api::{fft, ifft};
use oxifft::Complex;
fn main() {
// A length-16 signal: a sine wave at frequency 2.
let n = 16;
let input: Vec<Complex<f64>> = (0..n)
.map(|k| {
let t = 2.0 * std::f64::consts::PI * f64::from(k) / f64::from(n);
Complex::new((2.0 * t).sin(), 0.0)
})
.collect();
// Forward transform: time -> frequency.
let spectrum = fft(&input);
// Inverse transform: frequency -> time.
let recovered = ifft(&spectrum);
// Roundtrip error should be ~1e-15.
let max_error: f64 = input
.iter()
.zip(&recovered)
.map(|(a, b)| (a.re - b.re).hypot(a.im - b.im))
.fold(0.0, f64::max);
println!("max roundtrip error: {max_error:.2e}");
}
Need a reusable plan instead of the one-shot helpers? Build one with Plan::dft_1d(n, Direction::Forward, Flags::MEASURE) and call execute; real input has RealPlan::r2c_1d, and 2D/3D have Plan2D / Plan3D.
What’s inside
- Complex DFT with Cooley-Tukey, Rader, Bluestein, mixed-radix, and direct solvers.
- Real transforms (R2C / C2R / R2R) and all 8 DCT/DST variants plus the DHT.
- Multi-dimensional 1D/2D/3D/N-D transforms with optimized transpose, plus batch processing.
- Runtime-dispatched SIMD for x86_64 (through AVX-512), aarch64 (NEON/SVE), and WASM (simd128).
- Threading via Rayon, a wisdom plan cache, and FFTW-style planning modes.
- 20+ features beyond RustFFT, each behind a Cargo feature: Sparse FFT (
sparse, O(k log n) via FFAST), Pruned FFT (pruned), Streaming/STFT (streaming), compile-time const FFT (const-fft), NUFFT, Fractional FFT (frft), FFT convolution (conv), automatic differentiation (autodiff), GPU (cuda/metal), MPI distributed FFT (mpi), WebAssembly (wasm), and extended precision (f16-support,f128-support). - 10 worked examples and a SAR/radar-focused benchmark suite.
Tips
- Start simple. The
fft/ifft(andrfft/irfft) convenience functions inoxifft::apicover most needs with zero planning ceremony. - Reuse plans in hot loops. Construct a
Plan(orRealPlan/Plan2D) once and callexecuterepeatedly — that’s where FFTW-style planning pays off. - Pick the right
Flags. UseFlags::ESTIMATEfor one-off transforms andFlags::MEASUREwhen you’ll run the same size many times and want OxiFFT to benchmark candidate algorithms. - Persist wisdom. Export the plan cache with
oxifft::wisdom::export_to_file(...)and re-import it on startup to skip planning entirely across runs. - Real signals halve the work. For real-valued input, prefer
RealPlan::r2c_1d; the spectrum only needsn/2 + 1complex bins. - Enable only what you use. Everything advanced —
sparse,streaming,nufft,gpu,mpi,wasm— is feature-gated, so the default build stays lean and 100% Pure Rust.
This is the foundation
OxiFFT ships today alongside its same-day siblings OxiArc (Pure Rust compression) and OxiZ (Pure Rust SMT solver), joining an ecosystem that already includes SciRS2, NumRS2, OptiRS, PandRS, OxiBLAS, OxiCode, Legalis-RS, and MeCRab. Together with OxiBLAS, OxiFFT gives the SciRS2 numerical stack a sovereign spectral layer — the rustfft replacement the COOLJAPAN policy calls for.
Repository: https://github.com/cool-japan/oxifft
Star the repo if you want fast, safe FFTs without ever linking FFTW again.
Pure Rust spectral computing is here — fast, safe, and sovereign.
— KitaSan at COOLJAPAN OÜ January 12, 2026