Skip to content

feat(domain): hinge-state sampler + cross-product scoring loop (Phase 4 task 3)#28

Merged
transfix merged 1 commit into
masterfrom
feature/f3dock-phase4-domain-states
May 19, 2026
Merged

feat(domain): hinge-state sampler + cross-product scoring loop (Phase 4 task 3)#28
transfix merged 1 commit into
masterfrom
feature/f3dock-phase4-domain-states

Conversation

@transfix

Copy link
Copy Markdown
Owner

Summary

Phase 4 task 3 of the F3Dock migration matrix: the FFT scoring loop now consumes a vector of domain transforms per candidate pose instead of a single 6-DoF transform.

Changes

  • New DomainSampler (inc/f3dock/domain/DomainSampler.h, src/f3dock-domain/DomainSampler.cpp)
    • DomainSamplingConfig holds per-hinge sweeps (parent_id, child_id, min_angle_rad, step_rad, num_steps).
    • DomainSampler::enumerate() walks the cross-product of hinge sweeps into a std::vector (lexicographic; last hinge varies fastest). Empty config yields a single empty state, so rigid receptors are bit-for-bit unaffected.
    • DomainSampler::parse_param() parses the new receptorJointHingeSweep parentId childId minAngleRad stepRad numSteps key.
  • �uild_graph_with_state() (added in src/f3dock-domain/DomainSpec.cpp, declared in DomainSampler.h): re-evaluates the rest-pose DomainGraph with per-state hinge-angle overrides, rejecting overrides that name an unknown or non-hinge joint.
  • PARAMS_IN carries new fields: domainSampling, domainStates, domainMaxStates (default 4096), �ctiveDomainStateIndex. setParamFromFile enumerates domain states after the existing flex-state enumeration with a cap check and prints a one-line summary.
  • Scoring loop:
    unFlexStates now iterates the cross-product n_flex_states × n_domain_states, setting �ctiveFlexStateIndex / �ctiveDomainStateIndex per iteration. Both FlexReceptorGuard* blocks apply the active domain state via �uild_graph_with_state + DomainPartition::apply() on top of any flex-state rewrite, so flex and domain states compose cleanly.

Tests

11 new GoogleTest cases in tests/unit/test_f3dock_domain_sampler.cpp cover the enumerator (empty / disabled / single / cross-product), the parser (round-trip, unknown keys, bad input), �uild_graph_with_state validation, and an end-to-end partition-with-sampled-state. All domain + flex unit tests pass locally under Ubuntu-24.04 / gcc-13.

Migration matrix

Task 3 entry in doc/F3DOCK_MIGRATION_MATRIX.md updated to Landed. Tasks 4 (ICP refinement) and 5 (integration test) remain.

Stacks on top of #27 (already merged into master).

… 4 task 3)

Adds DomainSampler/DomainSamplingConfig that enumerate a cross-product of per-hinge angle sweeps into a vector of DomainStates, and build_graph_with_state() that re-evaluates the receptor DomainGraph for each state. New parameter-file key receptorJointHingeSweep parentId childId minAngleRad stepRad numSteps drives the sweep; an empty config yields a single empty state so rigid receptors are unaffected.

runFlexStates now iterates the cross-product n_flex_states * n_domain_states, and the two FlexReceptorGuard blocks apply the active domain state via build_graph_with_state + DomainPartition::apply on top of any flex-state rewrite, so flex and domain states compose cleanly.

Adds 11 GoogleTest cases in test_f3dock_domain_sampler covering enumeration, parser, build_graph_with_state validation, and an end-to-end partition-with-sampled-state.
@transfix transfix merged commit 8c15c8d into master May 19, 2026
10 checks passed
@transfix transfix deleted the feature/f3dock-phase4-domain-states branch May 19, 2026 01:17
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