[RF] Drop the FFTW3 dependency of RooFFTConvPdf #24012
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 287 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.339
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #24012"
general
weight: 0.35
vgvassilev
Replace the external FFT backend of RooFFTConvPdf with a self-contained implementation, so that the class works in any ROOT build regardless of whether fftw3 is available.
Until now, RooFFTConvPdf used the TVirtualFFT plugin when ROOT was compiled with
fftw3=ON, and otherwise fell back to declaring a wrapper around fftw3.h through the interpreter at runtime. The latter throws if the header cannot be found, so the PDF was effectively unusable in builds without fftw3, and the double code path had to be kept in sync.The new implementation is built on a single iterative radix-2 Cooley-Tukey FFT with a precomputed twiddle-factor table, which keeps the round-off error at the epsilon level independently of the transform size. Since the sampling size N2 is not guaranteed to be a power of two, the circular convolution for arbitrary N2 is computed exactly by zero-padding to the next power of two >= 2N2 - 1, which yields the linear convolution, and folding the result back modulo N2. Both real input sequences are packed into a single complex sequence and their spectra are recovered via Hermitian symmetry, so one convolution costs only two transforms. The transform is unnormalized, matching the FFTW convention; the absolute scale is irrelevant anyway since RooHistPdf renormalizes the cached histogram. Since the convolution of two non-negative inputs is mathematically non-negative, round-off negatives in bins whose true value is ~0 are clamped to zero, avoiding spurious "p.d.f value is less than zero" evaluation errors downstream.
The result agrees with the previous FFTW-based implementation at the level of machine precision (validated against a long-double reference convolution), and end-to-end cache refills are about a factor 3 slower than with FFTW, which is largely masked by the cost of sampling the input pdfs.
As a consequence:
RooFitCore no longer links against FFTW::Double and the ROOFIT_MATH_FFTW3 compile definition is gone.
The three TVirtualFFT plans are removed from FFTCacheElem.
The documentation on how to install FFTW manually is dropped.
* stressRooFit test 208 no longer needs to check for the fftw3 build feature and the TVirtualFFT plugin, and now always runs (except with the codegen backend).
🤖 Done with the help of AI