algorithm-bluestein-fft
The groupant beside algorithms/src/bluestein_fft/mod.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.
Facts
Implementation material. A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.
Components
| component | label | where |
|---|---|---|
| approximant | partial | approximant |
| ast | partial | syntax.json |
| descriptant | present | descriptant |
| invariant | partial | approximant |
| tests | existing checks referenced | tests |
Obernants
The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.
| id | type | label | where |
|---|---|---|---|
behavior_complement | behavior_complement | partial source derived model | behavior_complement |
reverse_reconstruction | reverse_reconstruction | partial source derived model | reverse_reconstruction |
chirp_identity | chirp_identity | partial source derived model | chirp_identity |
padding_relation | padding_relation | partial source derived model | padding_relation |
kernel_composition | kernel_composition | partial source derived model | kernel_composition |
inverse_normalization | inverse_normalization | partial source derived model | inverse_normalization |
Model text
descriptant
bluestein_fft / mod.rs
Original Rust; original algorithm citation appears in module documentation. Existing FFT and Householder QR reused where appropriate.
Prospective epoch
Prospective transform models
Before implementation: DCT II uses sqrt(1/n) DC and sqrt(2/n) others, cos(pi*(j+.5)k/n), inverse transpose; n<=2048, empty identity; O(n²) work/O(n) space. Haar full dyadic transform packs coarse value then detail levels; pair sum/difference divided sqrt(2); n<=65536 power two, no extension; empty invalid; O(n) work/space. Bluestein uses chirp exp(signipij²/n), symmetric inverse chirp convolution padded to power two >=2n-1, existing FFT, n<=16384; inverse divides n; empty invalid; O(n log n)/O(n). Goertzel recurrence s=x+2cos(w)s1-s2, final real=cos(w)s1-s2, imaginary=sin(w)s1 (integer-bin phase correction), n<=65536, bins<=65536, all k<n; empty input only accepts empty bins; O(nb)/O(b). SG n<=4096, odd window<=31 and <=n, degree<=6 and <window, shifted full window at boundaries; offsets scaled by window, Vandermonde QR solves local least squares, constant coefficient predicts target; O(nwd²)/O(wd+n). All finite magnitudes <=1e50, no callbacks, allocations follow standard policy except reused QR fallible allocation. Validate shapes/limits before values then compute; roundoff and rank/nonfinite failures explicit, no universal percent or residual-to-solution guarantee. Polynomial reproduction, independent direct sums, orthogonality and reconstruction are finite checks. No timing or gain claim. References: Ahmed/Natarajan/Rao (1974) DCT; Haar (1910); Bluestein (1970) linear filtering DFT; Goertzel (1958); Savitzky/Golay (1964).
Mathematical combiner
Source and SHA-bound partial syntax define transition F; forward/invariant approximants model F, behavior complement models excluded pairs and reconstruction models compatible antecedents. Finite independent tests constrain F. Combining these observations is not a semantic proof; no macro expansion or semantic AST. Leaf children=[]; root integrates exports/ancestor bindings.
Observed epoch 2026-10-30
20 new tests pass in twice debug and twice release crate runs (713 total each) with identical normalized outcomes. Five compiled production mutants fail named assertions and exact source restoration passes four tests each. Strict all-target algorithm Clippy and focused formatting pass. No timing, speed or universal accuracy claim.
model
behavior_complement
For validated input x let F(x) be source-defined tagged floating output. Excluded relation is (x,y) where y differs from F(x), including wrong normalization, wrong grid/layout, invalid-domain success or nonfinite success. This models excluded outputs, not only a list of tests. For sign s=-1 forward/+1 inverse, a[j]=x[j] exp(sipij²/n), b[+/-j]=exp(-sipij²/n). Convolve at m=next_power_of_two(2n-1) using existing radix-two FFT, multiply kth result by chirp; inverse divides n. n in 1..16384, finite components <=1e50.
reverse_reconstruction
Fixed n full real-complex DFT is invertible using conjugate sign and 1/n; rounded arithmetic loses exact injectivity. Spectrum magnitude alone would have phase/shift ambiguity but API preserves complex spectrum. InvalidInput conflates empty, oversized and invalid-value preimages.
chirp_identity
jk=(j²+k²-(j-k)²)/2 identifies exact DFT with chirp convolution. j² modulo 2n keeps phase in bounded range without changing exp(ipij²/n). j<=16383 avoids usize overflow on supported platforms.
padding_relation
m>=2n-1 keeps positive and wrapped negative chirp indices disjoint except zero and prevents circular aliasing on desired n outputs. Empty is rejected before 2n-1.
kernel_composition
Existing FFT forward is unnormalized negative phase and inverse includes 1/m, so convolution needs no extra m factor. Product spectra remain far below kernel magnitude bound under stated input caps.
inverse_normalization
Inverse changes sign and divides by n once after convolution. Wrong sign or extra division yields excluded results even if output stays finite.
approximant
Forward model and invariant
For sign s=-1 forward/+1 inverse, a[j]=x[j] exp(sipij²/n), b[+/-j]=exp(-sipij²/n). Convolve at m=next_power_of_two(2n-1) using existing radix-two FFT, multiply kth result by chirp; inverse divides n. n in 1..16384, finite components <=1e50.
Cost: O(m log m) work/O(m) space, m<=32768. Three FFT calls; standard allocation behavior; kernel errors propagated.
Successful values remain finite and input arrays are immutable. Orthogonal/DFT inverse laws require the transformed coefficients to satisfy the second call input cap; large admissible forward samples can produce coefficients above that cap, so the bounded API is not globally closed under round trips. Invalid domain checks precede computation; same error tag can cover several invalid premises. No callbacks; allocation failure is outside ordinary Result except errors inside reused QR. Transform algebra is exact over reals, implementation is rounded f64. Zero-reference relative error is undefined; cancellation precludes universal relative claims. No executable 1/2/5/10% surrogate certificate is supplied. Residuals, if present in reused QR, do not bound signal or solution error.
tests
independent_dft compares both directions to separate trigonometric sum for all n=1..35; roundtrip covers primes/nonpowers and powers; impulse_boundary exercises n=16384; rejected_domains checks caps and real/imaginary nonfinite values.
Control: Swapping the forward/inverse chirp sign compiles and fails independent_dft.
Evidence: $MOVA_DATA/runs/octopus-wave26-transforms-2026-10-30. No allocator fault injection; finite arithmetic bounds and cap tests are not exhaustive f64 verification.
This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/algorithms/src/bluestein_fft/mod.rs.groupant/