Skip to content

Research note: quantitative exact DFT with one size-adaptive program #233

Not planned

Description

@meteosimaji

Following the discussion of quantitative bounds in #223, here is a candidate bound for technical review. This is a research issue. The full RAM construction still needs a Lean formalization against the Comparator statement.

Proposed bound

One deterministic scalar/index RAM program computes the exact complex DFT at every positive length $n$. For all sufficiently large $n$, its work, including root-order selection, coefficient preparation and indexing, is at most
$$
O!\left(n\sqrt{\log n},
\exp!\left(C\sqrt{\log\log n,\log\log\log n}\right)\right)
$$
for an absolute constant $C$. The proposed supplied root has order less than $1024n^3$.

The extra factor is subpower in $\log n$. This would give an explicit rate for one program that handles every fixed positive slack, with the same open-$1/2$ score as #223 and #228 under the current rules. The factor allowed by this estimate is larger than the $\log\log n$ factor discussed as a research target in #223.

Derivation

  1. Parameter-dependent binary Walsh template. Use the binary rectangles from OpenAI's Fourier manuscript. For $m$ odd queries, put $x=\lceil\log_2 m\rceil$, $L=\max(2,\lfloor\sqrt{x/(1+\lfloor\log_2 x\rfloor)}\rfloor)$, $t=\lfloor L/2\rfloor$, $h=\lceil x/(L-t)\rceil$ and $q=2^h$. There are $q^L$ labels, dimension $D\le 1+Lq$, and $A=2(m+D-1)$ data axes. At most $2^Lq^t$ rectangles are charged separately, and each label occurs on each side of at most $(1+h)^L$ free rectangles. Each pencil therefore uses at most $O(D((1+h)^L + 2^L m q^{-(L-t)}))$ recursive axis calls per row, with an absolute constant. These choices give $q^L=m^{O(1)}$ and a pencil rate of $\exp(O(\sqrt{\log m,\log\log m}))$.

  2. Repair with polynomial batch width. Use the binary count window from the same paper, of width $O(\sqrt{m\log m})$ and tail density $p\le 1/(8m^4)$. For shift subspace $S$, put $w(x)=2^{|S\cap(x+T)|}$, where $T$ is the tail. Doubling $S$ by $v+S$ changes the sum of $w$ to $\sum_x w(x)w(x+v)$. Its mean over $v$ is $(\sum_x w(x))^2/2^m$; shifts in $S$ maximize it, so a minimizing shift can be chosen outside $S$. Integer Walsh autocorrelation finds one in $O(m2^m)$ operations per doubling. A power of two $W\in[4m^4,8m^4)$ yields at most $m+W\log_2(1+p)\le W/(2m^3)$ exceptions for every pattern. Use the full cube if it is smaller. Over $\mathbb C$, the count predictor is an ordinary univariate Newton polynomial. Evaluate it and the window-vanishing polynomial $B$ with the same Newton products. At each frequency, take Vandermonde checks of $B(J_i)X_i$, decode on the exceptional set, multiply there by $(z-P_i(J_i))/B(J_i)^2$, and lift with the transpose of the decoder. Apply $B$ to the lifted rows and add the predictor output. This uses $O(\sqrt{m\log m})$ pencils and at most $W/m^3$ full-row conversions. Together the pencil and conversion rate is at most $\sqrt A,\exp(O(\sqrt{\log m,\log\log m}))$.

  3. Uniform recursion. For a $k$-bit Walsh transform take $m$ to be an odd integer of order $k^\delta$, for a sufficiently small fixed $\delta>0$. All rectangle, basis, and scalar-table work outside recursion costs at most $m^{O(1)}$ per array entry, plus $2^m m^{O(1)}$ preparation at that node for shift selection and the table of sign patterns. The shift-selection integers have $O(m+Wp)=O(m)$ bits. Charting a full address takes $\operatorname{poly}(m)$ operations on its chunks. If needed, lookup tables for XOR and parity of a bitwise inner product take $O(2^{2f})$ word operations for chunk width $f$. Choose $r=\log_2(Wq^L)$ and $f=\lfloor(k-r)/A\rfloor$; the inactive bits fill whole batches. Handle the $O(A+r)$ leftover bits directly. After dividing by $2^k\sqrt k$, the recurrence has an additive constant and multiplier $\exp(O(\sqrt{\log k,\log\log k}))$. The logarithm of the child width contracts by a fixed factor for large $k$, so the logarithms of the multipliers sum to $O(\sqrt{\log k,\log\log k})$. Small widths use butterflies.

  4. All lengths. Use triangular Bluestein chirps and a work length $M\in[2n,4n)$ that is a product of distinct primes of order $\log n$ and one power of two, as in the September all-length construction. The November synchronized layers give $O(\log\log n)$ layers on the short axes. Implement a pair of short DFTs by a constant number of Bluestein convolutions on a borrowed slice, restoring it after the pair. For the circulant shear, add $2a I$ to the padded circulant for a length-$a$ DFT to obtain an invertible circulant, undo its action to restore the occupied slice, and cancel the added diagonal. Its dyadic convolution length is below $4a$. Pair short axes into groups of two and leave at most one fiber per axis for a direct short chirp; the total cost of these leftovers is $O(n)$. Each synchronized shear is a direct sum of powers of the unit two-point shear, with at most $O(\log n/\log\log n)$ Walsh bits per block and total block volume $O(n)$. Three Walsh calls per block suffice by the rational two-point identity. Before absorbing smaller factors, the bound is $O(n\sqrt{\log n,\log\log n})$ times the extra factor from step 3. The outer chirp uses the $n$-th root, the Good–Thomas grid uses the $M$-th root, and the short occupied-workspace constructions use dyadic convolution lengths dividing the largest needed power of two $P<4M$. A canonical root of order $nMP<64n^3$ supplies all of them.

I have Lean checks for component identities, recurrence accounting and the subpower comparison, and exact finite-field experiments for the routing and the synchronized cyclic DFT. The formal task remaining is to implement the variable-size compiler and prove its full work bound and correctness against the challenge's DFTProgram. The finite-field timings measure only the tested prototypes.

This derivation builds on OpenAI's manuscripts and the community's exact-RAM compiler work, with OpenAI Codex assistance. I would welcome technical review of the uniform preparation and any pointer to an earlier explicit rate of this form.

Activity

  1. nmamano commented on Nov 29, 2026

    @nmamano
    Contributor

    This is an agent for Nil (BOS Reviewer), writing for Big O Speedrun.

    Thank you for the detailed note. Where it stands on the board today:

    • Score. As you say, $O(n\sqrt{\log n},e^{C\sqrt{\log\log n,\log\log\log n}})$ scores as "every saving below $1/2$". That is equal to the two Lean Verified rows (optimized code, DFT is also at O(n·log^(1/2+ε)n) now #228 and the Frontier223 row of Exact DFT on the scalar/index RAM with saving 1/2 − 1/(2(10^40 − 1)) #223). At an equal bound a Lean Verified row ranks above a sketch, so this note would not change the order.
    • Review. We check Lean proofs against a fixed statement. We do not give technical review of research sketches in this repository.
    • Next step. Only an exact $1/2$ for one program ranks above the current rows, through the normal manifest.json route with bound = 1/2. If you complete a Lean proof of your bound, please open a new issue with the exact theorem. Nil then decides whether the board scores the factor after $\sqrt{\log n}$, and only then would we check a separate theorem.

    We close this issue for now, because there is nothing to run yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions