Skip to content

feat(nfft): plumb opt-in NFFT acceleration flag and startup diagnostic (Phase 5 task 1)#31

Merged
transfix merged 1 commit into
masterfrom
feature/f3dock-phase5-nfft-plumbing
May 19, 2026
Merged

feat(nfft): plumb opt-in NFFT acceleration flag and startup diagnostic (Phase 5 task 1)#31
transfix merged 1 commit into
masterfrom
feature/f3dock-phase5-nfft-plumbing

Conversation

@transfix

Copy link
Copy Markdown
Owner

Summary

Adds the first piece of Phase 5: an opt-in nfftAccelerate boolean 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-nfft FastGaussianSum wrapper, then electrostatics integration).

What it does

  • New bool nfftAccelerate field in inc/f2dock/Docking.h (default false).
  • New parser branch in src/f2dock/F2Dock.cpp that reads nfftAccelerate <true|false> from input files.
  • Parse-time rejection when nfftAccelerate=true is requested but the build is missing F2DOCK_HAVE_NFFT -- misconfigured inputs fail fast with an actionable error message.
  • Stdout-only startup diagnostic:
    NFFT acceleration: requested=<on|off> available=<yes|no> active=<yes|no>
    
  • 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 contributes nothing to the link line when libnfft3 is unavailable.

Why the .out baselines are unchanged

The diagnostic is printf to 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.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.

Verification

  • clang-format-18 --dry-run --Werror -- clean
  • cmake --build . -j 8 on WSL Ubuntu-24.04 / gcc-13 -- green
  • 190/190 unit tests pass
  • 5/5 integration tests pass (integration_1ACB, integration_1A2K, integration_1A2K_flex, integration_1A2K_domain, integration_F2DockServer)
  • Manual: nfftAccelerate true on a non-NFFT build is rejected with the expected error
  • Manual: nfftAccelerate false (default) prints requested=off available=no active=no

Follow-ups (next PRs in Phase 5)

  • PR B (task 2): f3dock-nfft static library exposing a FastGaussianSum wrapper around NFFT3 fastsum, with deterministic unit tests vs the direct O(N*M) reference.
  • PR C (task 3): Wire FastGaussianSum into the electrostatics gridding path under the nfftAccelerate switch; integration smoke 1A2K_nfft_smoke.
  • PR D (task 4): libcvc geometry consumer audit -- find any remaining Blurmaps/GOA/PRGN call sites, route through libcvc, file upstream issues for missing capability.

…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 transfix merged commit 756491a into master May 19, 2026
10 checks passed
@transfix transfix deleted the feature/f3dock-phase5-nfft-plumbing branch May 19, 2026 06:29
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.
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