Skip to content

X30b: 64-byte aligned plan tables (compact twiddles and three-pass 4096 rejected) - #17

Merged
jtravs merged 12 commits into
mainfrom
exp/x30b-twiddle-tables
Nov 16, 2026
Merged

jtravs merged 12 commits into
mainfrom
exp/x30b-twiddle-tables

Conversation

@jtravs

@jtravs jtravs commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Experiment X30b (PLAN lead 3, after X30): the x86 chains at 1024–4096 points. Verdicts in dev/experiments/X30b-twiddle-tables.md.

  • L adopted: every plan table starts on a 64-byte boundary (platform/aligned_allocator.hpp, aligned_vector); bits unchanged. x30 double L ÷ main: EPYC 0.986, Xeon avx512 0.989, avx2 0.996, Mac 0.999; float 0.971 / 0.981 / 0.999 / 1.000; tracking 0.994 / 0.994 / 0.990 / 1.001; no case past the limit (Xeon avx512 c2r 2²⁰ 1.035 → 0.983 on re-run).
  • C rejected and reverted (b54a7f4): compact (wr, wi) twiddle tables per table kind. Best form won the EPYC's x30 cases (double 0.986, float 0.962 of L; tracking 0.989), but float 256 × 64 stayed 1.04 on re-run in every variant (also the one with no compact table, so the FMADDSUB form or code placement), Xeon c2c 16 1.05–1.07 on re-run, and no double gain on avx512.
  • R rejected: three-pass avx2 double 4096 sequences 1.30–1.88 of 8 × 8 × 8 × 8.

The branch's net change against main is L plus the experiment record (PLAN, DESIGN decision log, LESSONS 3.10). Do not merge before the lead's review.

🤖 Generated with Claude Code

jtravs and others added 12 commits November 16, 2026 06:54
…4096 in three passes)

The decision rule is written before any arm is built or timed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every plan table (the chain's twiddles, the grid's, Bluestein's) is an
aligned_vector, whose allocator starts each buffer on a cache line. std::vector
put them 16 bytes into a line, so half of a per-lane pass's 32-byte twiddle
loads crossed one. No instruction or bit changes.

Built: Homebrew Clang 23, Release, -Werror, neon_fcma/neon/scalar; all 1787
tests pass on the Mac. x86 runs in CI and on DMOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…large (X30b arm C)

The avx2 and avx512 vocabularies now hold a twiddle register pair as
(wr, wr) and (wi, wi) and multiply through FMADDSUB and FMSUBADD (X30's
arithmetic, bit-identical to the (-wi, wi) form). Tables may be stored
pre-arranged (4 reals per twiddle, plain loads that fold into the multiplies)
or compact ((wr, wi), 2 reals: double r and i duplicated from one load,
float by VMOVSLDUP from p and p + 1, broadcasts by two scalar broadcasts).
The grouped first pass and the twiddled lane pass get compact instantiations
(grouped_compact, lane_compact; null on targets without the storage), and the
chain builder takes them for a pass whose pre-arranged table would exceed
machine_profile::twiddle_compact_bytes, half the L1 data cache by default.
fbench sets the threshold with TWIDDLE_COMPACT_BYTES.

Tests: every codelet in every position with every table compact against the
reference, and plans with every table compact against none bit for bit (both
skip where no target has the storage).

Built: Homebrew Clang 23, Release, -Werror; all 1789 tests pass on the Mac
(neon_fcma, neon, scalar; the new tests skip). x86 units cross-compiled with
Clang 23 (avx2, avx512, narrow, both FFTN_MASKED_TAILS states). x86 tests run
in CI and on DMOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… by default (X30b arm C2)

One size limit for both kinds of table missed what the EPYC counters showed:
a compact per-lane table (the grouped first pass) cost 1.06-1.13 of the cycles
at 2048 and 4096 points in double, a compact broadcast table (lane passes)
costs no extra operation and gave the best cycles at 1024 (0.92 of main). The
machine profile now has compact_grouped_bytes (default never) and
compact_shared_bytes (default 0, every lane pass), fbench's
COMPACT_GROUPED_BYTES and COMPACT_SHARED_BYTES. The experiment file records the
screen and amends the arms before any timing run finished.

Built: Homebrew Clang 23 Release -Werror (Mac, 77 schedule/topology/pass tests
pass), x86 units cross-compiled with Clang 23.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cted)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lane passes' expected names ended with the closing parenthesis, which a
compact pass's name has after its note. Found by the new test on DMOG (GCC 16,
avx2): every other test passed there in both FFTN_MASKED_TAILS states.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: the machine profile's new fields (both kept) and PLAN's index rows.
X29's two new grid tables bind as aligned_vector (auto&). Mac Clang 23 Release:
all 1806 tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: plan_core's chain set-up (pair leaves and compact limits, both kept)
and entries.inl's helper templates (both kept). Mac Clang 23 Release: all 1808
tests pass; x86 units (avx2, avx512, pairs, narrow) cross-compile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Arm C (88cd9c3, ead29f2, 2b38263) failed X30b's rule (b): its best form
(broadcast tables compact, per-lane tables above 16 KiB) won the EPYC's x30
cases (double 0.986, float 0.962 of arm L) and its tracking tier (0.989), but
c2c float 256 x 64 stayed 1.038-1.042 of L on the re-run (run
20261116-101921-03d8), as did the variant with no compact table, so the
FMADDSUB arithmetic or the larger library rather than the storage; on the
Xeon the broadcast form gained nothing in double on avx512 (1.001) and c2c 16
ran 1.050-1.054 of L in the tracking tier. The vocabularies, passes and chain
return to main's; the aligned plan tables (arm L) stay.

Built: Homebrew Clang 23 Release -Werror, all 1806 tests pass on the Mac; x86
units cross-compile with Clang 23.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…three-pass 4096 rejected

Results, re-runs and Slurm jobs in the experiment file; PLAN index and lead 3,
DESIGN decision log, LESSONS 3.10.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jtravs jtravs changed the title X30b: aligned twiddle tables, compact twiddle storage for large tables (x86) X30b: 64-byte aligned plan tables (compact twiddles and three-pass 4096 rejected) Nov 16, 2026
@jtravs
jtravs marked this pull request as ready for review November 16, 2026 11:38
@jtravs
jtravs merged commit 29f9772 into main Nov 16, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant