From ba956342059ccf00625494ab5d8f0ff2d043c4ce Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Tue, 17 Nov 2026 04:11:38 +0100 Subject: [PATCH] Revert "FFT indexer: histogram padded to the next 2-3-5-7-smooth length" This reverts commit 6f6e57b36 for the owner's decision. Bisected on 2026-11-17 across the rc188 builds: the padding alone moves results on knife-edge sets (nacl F 4 3 2 -> P 1, d_min shifts on two open and one private set, one private space group), where rc187, pocketfft, the CPU-refinement work and the build just before the padding all agree. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UqXYdJz9sA2BQBEgKkuVuL --- image_analysis/indexing/FFTIndexer.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/image_analysis/indexing/FFTIndexer.cpp b/image_analysis/indexing/FFTIndexer.cpp index e895689b4..cd76beb53 100644 --- a/image_analysis/indexing/FFTIndexer.cpp +++ b/image_analysis/indexing/FFTIndexer.cpp @@ -35,18 +35,7 @@ FFTIndexer::FFTIndexer(const IndexingSettings &settings) const float one_over_d_max = 1.0f / settings.GetFFT_HighResolution_A(); histogram_spacing = 1.0f / (2.0f * max_length_A); - // Then zero-padded a little further, to the next length whose prime factors are all 2, 3, 5 or 7: - // the default (500 A, 2 A) is 3142 = 2 x 1571, which both FFT libraries can only do the slow way. histogram_size = std::ceil(oversampling * one_over_d_max / histogram_spacing); - for (bool smooth = false; !smooth; ) { - int64_t v = histogram_size; - for (int p : {2, 3, 5, 7}) - while (v % p == 0) - v /= p; - smooth = (v == 1); - if (!smooth) - ++histogram_size; - } input_size = histogram_size * nDirections; output_size = (histogram_size / 2 + 1) * nDirections;