COOLJAPAN
← All posts

OxiFFT 0.2.0 Released — Type-Safe Plans and an FFTW-Compatible API

OxiFFT, the Pure Rust FFT and rustfft replacement, turns runtime panics into compile-time errors: 0.2.0 makes 2D/3D and real plans Option-returning with honest types, ships a drop-in fftw-compat API to port C code, and adds Debug and #[must_use] across every plan type. 858 tests passing.

release oxifft fft fftw rust rustfft signal-processing api

The fastest FFT in the world is worthless if a typo crashes your pipeline at runtime. So we moved the crash to compile time.

Today we released OxiFFT 0.2.0 — a minor release with breaking changes that retypes the 2D/3D and real-FFT plan APIs so the wrong shape no longer compiles, and adds a drop-in FFTW-style compatibility surface for porting C code.

No C. No Fortran. No FFTW. No FFI. OxiFFT is Pure Rust to the core: its default features are 100% Rust, and it compiles to a single static binary — or to WASM — with nothing to link against and nothing to pkg-config. It is a Pure Rust port of FFTW3 — the “Fastest Fourier Transform in the West” — without inheriting FFTW’s build system, and it displaces rustfft for the Rust niche at the same time. It is the spectral backbone of the SciRS2 / signal / audio stack.

Why OxiFFT 0.2.0 is a step up

FFTW is a C API, and C APIs make their mistakes at runtime. Hand fftw_plan_dft_2d the wrong dimensions, execute a real plan as if it were complex, or ignore a null plan, and the failure shows up as a crash — in production, on someone else’s data, far from where the bug lives. OxiFFT 0.2.0 takes a different stance: the type system catches the mistake at compile time, and for teams coming from FFTW there is now a migration on-ramp that keeps your existing call sites almost verbatim.

Concretely, this release delivers:

Technical Deep Dive

Type-safe plans. The headline change is that the multidimensional and real planners now return the type they always built. Previously, dft_2d(), dft_3d(), r2c_1d(), and c2r_1d() all funneled through Option<Plan<T>>, and a mismatched shape was a runtime-panic path waiting to be hit. In 0.2.0 the signatures are honest:

The value was always 2D, 3D, or real under the hood — this just makes the type system tell the truth about it. A wrong-shape call that used to compile and then panic now simply doesn’t compile. Every plan-creation method carries #[must_use], so ignoring a returned None is a warning rather than a silent foot-gun, and Debug is now implemented on all public plan types so you can print and inspect a plan while debugging.

#[non_exhaustive] enums. All public enums are now #[non_exhaustive]. This future-proofs the ABI: we can add new variants in a later minor release without it being a breaking change. The cost is small and explicit — any downstream match over an OxiFFT public enum needs a wildcard _ => arm. While auditing the enums we also removed the IndirectStrategy enum and its IndexArray variant, which were dead code that was never constructed.

FFTW Compatibility API. Behind the new fftw-compat feature, the oxifft::compat module mirrors the FFTW C API with FFTW-style names, so existing FFTW code ports almost line for line:

It is Pure Rust underneath — the FFTW shape is purely an ergonomic on-ramp, not an FFI binding.

Getting Started

cargo add oxifft
use oxifft::{Complex, Direction, Flags, Plan2D};

// 2D forward FFT — now returns Option<Plan2D<f64>>: wrong shapes won't compile
let plan = Plan2D::new(64, 64, Direction::Forward, Flags::ESTIMATE)
    .expect("64x64 plan");
let input = vec![Complex::new(0.0_f64, 0.0); 64 * 64];
let mut output = vec![Complex::new(0.0_f64, 0.0); 64 * 64];
plan.execute(&input, &mut output);

The FFTW-compatibility surface is behind a feature flag — enable it with cargo add oxifft --features fftw-compat when you are porting existing FFTW code.

What’s New in 0.2.0

Tips

The foundation

OxiFFT is the spectral layer of the COOLJAPAN ecosystem, and an FFT is a dependency almost every scientific and ML pipeline reaches for sooner or later. By mid-April 2026 it sits beside mature siblings — SciRS2 for scientific computing, NumRS2 for arrays, OxiBLAS for linear algebra, ToRSh for tensors, SkleaRS for classical ML, TenfloweRS and TrustformeRS for deep learning, and OxiWhisper for speech — and every spectral transform underneath them can now rest on a plan API that fails at compile time instead of at 3 a.m.

Repository: https://github.com/cool-japan/oxifft

Star the repo if a Pure Rust FFT — one that catches your mistakes before they ship and lets you bring your FFTW code with you — is something you want to build on.

Pure Rust spectral computing is here — fast, safe, and sovereign.

KitaSan at COOLJAPAN OÜ April 14, 2026

↑ Back to all posts