feat(nfft): plumb opt-in NFFT acceleration flag and startup diagnostic (Phase 5 task 1)#31
Merged
Merged
Conversation
…c (Phase 5 task 1) Adds a new fftAccelerate boolean input parameter to the F2Dock dock-parameters parser plus a stdout-only startup diagnostic that reports whether NFFT support was compiled in (F2DOCK_HAVE_NFFT) and whether acceleration is active for the current run. The flag defaults to false and is rejected at parse time when the build does not have NFFT support, so misconfigured inputs fail fast. This PR is intentionally a no-op for all scoring paths: the flag is not yet wired into electrostatics gridding. That follows in subsequent PRs (f3dock-nfft FastGaussianSum wrapper, then electrostatics integration). The diagnostic is printf to stdout only and is NOT written to the .out file, so existing integration baselines (1ACB, 1A2K, 1A2K_flex, 1A2K_domain) are unchanged. All 190 unit tests pass; all 5 integration tests pass locally on WSL Ubuntu-24.04. Also reframes the Phase 5 section of F3DOCK_MIGRATION_MATRIX.md around the project owner's guiding principle: 'most of F2Dock functionality will end up in libcvc eventually -- consume from libcvc and push gaps upstream rather than porting downstream copies.' Blurmaps/GOA/PRGN rows now point at libcvc consumption (Phase 5 task 4 audit) instead of in-tree ports. src/f2dock/CMakeLists.txt now links the optional f3dock_science_stack INTERFACE target when present so F2DOCK_HAVE_NFFT is visible at compile time. The INTERFACE target adds nothing to the link line when libnfft3 is not available.
transfix
pushed a commit
that referenced
this pull request
May 19, 2026
…aluator reference (Phase 5 task 2) Adds a new static library 3dock-nfft exposing 3dock::nfft::FastGaussianSum, a thin wrapper that evaluates a 3D Gaussian sum f(y_j) = sum_k alpha_k * exp(-c * |y_j - x_k|^2). The wrapper has two evaluation paths: * evaluate_direct(out) -- always-available O(N*M) reference loop. Used as ground truth in unit tests. * evaluate(out) -- selects the NFFT3 fastsum fast path when is_accelerated() returns true; otherwise delegates to the direct evaluator. The NFFT3 hookup is intentionally a no-op fallback in this PR (so the library compiles and runs identically on every platform in the CI matrix) and lands in a follow-up patch once libnfft3 is available in CI. This is the building block that Phase 5 task 3 will route the F2Dock electrostatics gridding through under the fftAccelerate opt-in flag landed in PR #31. Build / test plumbing: * src/f3dock-nfft/CMakeLists.txt builds the static library and links the optional 3dock_science_stack INTERFACE target when present, so F2DOCK_HAVE_NFFT (and any related include/link plumbing) propagates automatically once libnfft3 is discovered. * Library is built under the existing F2DOCK_ENABLE_F3DOCK_EXPERIMENTAL gate alongside 3dock-domain/3dock-flex/3dock-icp/3dock-loop-closure. * 7 new gtest cases in ests/unit/test_f3dock_nfft_fast_gaussian_sum.cpp lock in: constructor validation (positive c, non-null sources), direct evaluator vs a hand-written reference, evaluate()=evaluate_direct() bit-for-bit when unaccelerated, single-point identity bound, empty-source short-circuit, and inspector accessors. Verification: 197/197 unit tests pass; clang-format-18 --Werror clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the first piece of Phase 5: an opt-in
nfftAccelerateboolean input flag in the F2Dock dock-parameters parser plus a startup diagnostic that reports whether NFFT support was compiled in (F2DOCK_HAVE_NFFT) and whether acceleration is active for the current run.This PR is intentionally a no-op for all scoring paths -- the flag is not yet wired into electrostatics gridding. That follows in the next two PRs (
f3dock-nfftFastGaussianSum wrapper, then electrostatics integration).What it does
bool nfftAcceleratefield ininc/f2dock/Docking.h(defaultfalse).src/f2dock/F2Dock.cppthat readsnfftAccelerate <true|false>from input files.nfftAccelerate=trueis requested but the build is missingF2DOCK_HAVE_NFFT-- misconfigured inputs fail fast with an actionable error message.src/f2dock/CMakeLists.txtnow links the optionalf3dock_science_stackINTERFACE target when present soF2DOCK_HAVE_NFFTis visible at compile time. The INTERFACE target contributes nothing to the link line whenlibnfft3is unavailable.Why the .out baselines are unchanged
The diagnostic is
printfto stdout only -- it is not written to the dock output file. All four existing integration baselines (integration_1ACB,integration_1A2K,integration_1A2K_flex,integration_1A2K_domain) are unaffected.Migration matrix reframe
Also reframes the Phase 5 section of
doc/F3DOCK_MIGRATION_MATRIX.mdaround the project owner's guiding principle:Blurmaps / GOA / PRGN rows now point at libcvc consumption (Phase 5 task 4 audit) instead of in-tree ports.
Verification
clang-format-18 --dry-run --Werror-- cleancmake --build . -j 8on WSL Ubuntu-24.04 / gcc-13 -- greenintegration_1ACB,integration_1A2K,integration_1A2K_flex,integration_1A2K_domain,integration_F2DockServer)nfftAccelerate trueon a non-NFFT build is rejected with the expected errornfftAccelerate false(default) printsrequested=off available=no active=noFollow-ups (next PRs in Phase 5)
f3dock-nfftstatic library exposing aFastGaussianSumwrapper around NFFT3 fastsum, with deterministic unit tests vs the direct O(N*M) reference.FastGaussianSuminto the electrostatics gridding path under thenfftAccelerateswitch; integration smoke1A2K_nfft_smoke.