Loading...
Searching...
No Matches
OCINEBController.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright (c) gpridge developers
3// See LICENSE for details.
4
24
25#ifndef GPR_NEB_OCINEB_CONTROLLER_H_
26#define GPR_NEB_OCINEB_CONTROLLER_H_
27
28#include <Eigen/Dense>
29#include <cstddef>
30#include <cstdint>
31#include <functional>
32#include <limits>
33#include <optional>
34#include <stdexcept>
35#include <string>
36#include <unordered_map>
37#include <utility>
38#include <vector>
39
40#include "GPNEB.h"
41#include "Session.h"
42#include "gpr/AtomicDimer.h"
43
44namespace gpr {
45namespace neb {
46
48enum class MMFStatus : int {
49 Helped = 0,
51 Skipped = -1,
53};
54
65
70enum class MmfHandoffPolicy : std::uint8_t {
71 Auto = 0,
74};
75
79 double previousForce = std::numeric_limits<double>::quiet_NaN();
82 double newForce = 0.0;
84 bool convergedAfterMMF = false;
89 int oracle_calls = 0;
95 bool refinement_failed = false;
97 double alignment = 0.0;
100 double final_rotation_omega = std::numeric_limits<double>::quiet_NaN();
109 double final_mode_curvature = std::numeric_limits<double>::quiet_NaN();
137};
138
139struct OCINEBConfig;
140
141namespace detail {
142
143struct MmfRecoveryCandidate {
144 int phase = -1;
145 double curvature = 0.0;
146 double recovery_force = std::numeric_limits<double>::infinity();
147 double displacement = std::numeric_limits<double>::infinity();
148 double saddle_energy = std::numeric_limits<double>::infinity();
149 bool saddle_certified = false;
150 bool path_mode_certified = false;
151 bool measured_descent_certified = false;
152};
153
154struct MmfRecoverySelectionStats {
155 int negative_curvature_candidates = 0;
156 int invalid_candidates = 0;
157 int force_improving_candidates = 0;
158 int out_of_trust_candidates = 0;
159 int directional_out_of_trust_candidates = 0;
160 int threshold_rejected_candidates = 0;
161 int no_trust_threshold_rejected_candidates = 0;
162 int certified_lower_energy_candidates = 0;
163 int uncertified_lower_energy_candidates = 0;
164 int uncertified_energy_descent_candidates = 0;
165 int accepted_candidates = 0;
166};
167
168struct MmfRecoveryPhaseEvidence {
169 double energy = std::numeric_limits<double>::quiet_NaN();
170 Eigen::VectorXd gradient;
171 bool oracle_certified = false;
172};
173
177[[nodiscard]] MmfRecoveryPhaseEvidence recordedMmfRecoveryPhaseEvidence(
178 const atmd::AtomicDimer::DimerPhaseRecord& phase, double energy_zero,
179 Eigen::Index expected_dimension);
180
181void appendAcceptedMmfRecoveryObservation(ActiveLearningSession& session,
182 int image_idx, const Image& accepted);
183
184struct MmfRecoveryAcceptanceDecision {
185 bool accepted = false;
186 bool finite_input = false;
187 bool force_improves = false;
188 bool has_displacement_trust = false;
189 bool within_displacement_trust = false;
190 bool lower_valid_saddle_energy = false;
191 bool uncertified_energy_descent = false;
195 bool measured_trust_bounded_progress = false;
196 bool measured_path_continuation = false;
197 bool threshold_limited = false;
198 bool threshold_passed = false;
199};
200
201[[nodiscard]] MmfRecoveryAcceptanceDecision classifyMmfRecovery(
202 double pre_force, double recovery_force, double recovery_displacement,
203 double max_displacement, double acceptance_force_threshold,
204 bool keep_force_improving_burst,
205 double reference_saddle_energy = std::numeric_limits<double>::quiet_NaN(),
206 double candidate_saddle_energy = std::numeric_limits<double>::quiet_NaN(),
207 double reactant_energy = std::numeric_limits<double>::quiet_NaN(),
208 double product_energy = std::numeric_limits<double>::quiet_NaN(),
209 bool candidate_saddle_certified = false,
210 bool candidate_path_mode_certified = false,
211 bool candidate_measured_descent_certified = false);
212
213[[nodiscard]] bool shouldAcceptMmfRecovery(
214 double pre_force, double recovery_force, double recovery_displacement,
215 double max_displacement, double acceptance_force_threshold,
216 bool keep_force_improving_burst,
217 double reference_saddle_energy = std::numeric_limits<double>::quiet_NaN(),
218 double candidate_saddle_energy = std::numeric_limits<double>::quiet_NaN(),
219 double reactant_energy = std::numeric_limits<double>::quiet_NaN(),
220 double product_energy = std::numeric_limits<double>::quiet_NaN(),
221 bool candidate_saddle_certified = false,
222 bool candidate_path_mode_certified = false,
223 bool candidate_measured_descent_certified = false);
224
225[[nodiscard]] bool shouldRejectUncertifiedMmfRecoveryHandback(
226 double recovery_force, double recovery_displacement,
227 double max_displacement, double force_tolerance);
228
229[[nodiscard]] double effectiveMmfRecoveryDisplacementCap(double configured_cap,
230 double left_spacing,
231 double right_spacing);
232
233[[nodiscard]] bool shouldRejectUncertifiedHelpedDisplacement(
234 bool dimer_converged, bool helped_angle_certified,
235 double helped_displacement, double max_displacement);
236
240[[nodiscard]] bool shouldRejectForceOnlyHelpedBelowEndpoints(
241 bool dimer_converged, bool helped_angle_certified,
242 double dimer_final_energy, double reactant_energy, double product_energy);
243
244[[nodiscard]] std::string forceOnlyHelpedBelowEndpointDiagnostic(
245 double dimer_final_energy, double reactant_energy, double product_energy);
246
247[[nodiscard]] std::string trustedRecoveryAdvanceDiagnostic(
249 int recovery_phase, std::size_t phase_count, double curvature,
250 double recovery_baseline, double recovery_force, double raw_pre_force,
251 double raw_force, double reference_energy, double candidate_energy,
252 double reactant_energy, double product_energy, bool saddle_certified);
253
255[[nodiscard]] double mmfRecoveryForceBaseline(double pre_neb_force,
256 double pre_raw_force);
257
258[[nodiscard]] int chooseMmfRecoveryPhase(
259 const std::vector<MmfRecoveryCandidate>& candidates, double pre_force,
260 double max_displacement, double acceptance_force_threshold,
261 bool keep_force_improving_burst,
262 double reference_saddle_energy = std::numeric_limits<double>::quiet_NaN(),
263 double reactant_energy = std::numeric_limits<double>::quiet_NaN(),
264 double product_energy = std::numeric_limits<double>::quiet_NaN(),
265 MmfRecoverySelectionStats* stats = nullptr,
266 bool allow_directional_out_of_trust_recovery = false);
267
268[[nodiscard]] bool shouldRetainMmfObservation(
269 const Eigen::VectorXd& positions, const Eigen::VectorXd& anchor,
270 const gpr::AtomsConfiguration& atoms_config, double max_displacement);
271
272[[nodiscard]] bool shouldCommitMmfObservation(
273 const Eigen::VectorXd& positions, const Eigen::VectorXd& anchor,
274 const gpr::AtomsConfiguration& atoms_config, double max_displacement);
275
276[[nodiscard]] bool shouldHarvestRejectedMmfObservation(
277 bool helped, bool trusted_recovery_advanced,
278 const Eigen::VectorXd& positions, const Eigen::VectorXd& anchor,
279 const gpr::AtomsConfiguration& atoms_config, double max_displacement);
280
281[[nodiscard]] double successThresholdAfterMmf(double handoff_force,
282 double mmf_force,
283 double baseline_threshold);
284
285[[nodiscard]] double rejectedMmfBackoffThreshold(double current_force,
286 double force_tolerance,
287 double baseline_threshold);
288
292enum class MmfInformationGate : std::uint8_t {
293 Open = 0,
294 AwaitingFirstTrainingGrowth = 1,
297 AwaitingActionChange = 3,
298};
299
300using MmfSurrogateFingerprint = ActiveLearningSession::SurrogateFingerprint;
301
303struct MmfPosteriorActionFingerprint {
304 MmfSurrogateFingerprint surrogate;
305 atmd::DimerSurrogateActionCertificate action;
306};
307
308[[nodiscard]] MmfPosteriorActionFingerprint probeMmfPosteriorAction(
309 ActiveLearningSession& session, int image_idx, bool dimer_use_global_gp,
310 const Eigen::VectorXd& seed, const Eigen::VectorXd& seed_gradient,
311 const Eigen::VectorXd& initial_mode, const GPNEBConfig& neb_config,
312 const OCINEBConfig& oci_config);
313
316[[nodiscard]] bool mmfPosteriorActionChanged(
317 const MmfPosteriorActionFingerprint& action_now,
318 const MmfPosteriorActionFingerprint& action_at_last_reject);
319
322[[nodiscard]] MmfInformationGate advanceMmfInformationGateOnSurrogateChange(
323 MmfInformationGate gate, const MmfSurrogateFingerprint& surrogate_now,
324 const MmfSurrogateFingerprint& surrogate_at_last_reject,
325 bool* refresh_snapshot);
326
327[[nodiscard]] bool mmfSurrogateChanged(
328 const MmfSurrogateFingerprint& surrogate_now,
329 const MmfSurrogateFingerprint& surrogate_at_last_reject);
330
331[[nodiscard]] bool shouldSuppressMmfUntilTrainingGrows(MmfInformationGate gate);
332
333[[nodiscard]] double mmfThresholdForce(double neb_force, double raw_force);
334
338[[nodiscard]] bool ciPosteriorConfident(const NEBPath& path, int ci_idx,
339 double kappa);
340
346[[nodiscard]] bool isPrematureForceOnlyHelped(bool is_helped_status,
347 bool force_certified,
348 bool helped_angle_certified,
349 int ci_stable_outer_count,
350 bool helped_negative_curvature);
351
356[[nodiscard]] bool forceOnlyHelpedPathCertified(bool helped_angle_certified,
357 double alignment,
358 double alignment_cos_tol);
359
362[[nodiscard]] bool shouldSearchMmfRecoveryPortfolio(bool dimer_converged,
363 bool helped_ran_away,
364 bool helped_path_certified,
365 bool found_saddle_mode);
366
367[[nodiscard]] bool mmfForceCertifiedForConvergence(double dimer_force,
368 double band_force,
369 double force_tolerance);
370
376[[nodiscard]] bool mmfBurstConvergedAfterAcceptance(
377 MMFStatus status, bool force_certified, bool helped_angle_certified,
378 double final_mode_curvature, bool helped_path_certified = false);
379
380[[nodiscard]] bool applyDimerSaddleSummary(GPNEBResult& result,
381 int dimer_saddle_image_idx);
382
383[[nodiscard]] bool shouldPureLockAfterMmfReject(
384 MMFStatus status, bool force_improved, bool adaptive_threshold_seeded,
385 MMFRejectKind reject_kind = MMFRejectKind::None);
386[[nodiscard]] bool shouldPureLockAfterMmfReject(
387 MMFStatus status, bool force_improved, bool trusted_recovery_advanced,
388 bool adaptive_threshold_seeded,
389 MMFRejectKind reject_kind = MMFRejectKind::None);
390
393[[nodiscard]] bool isRecoveryPortfolioExhaustedReject(
394 bool recovery_selection_exhausted, int accepted_candidates);
395
398[[nodiscard]] bool isMmfRecoveryPortfolioExhausted(bool found_saddle_mode,
399 int selected_phase,
400 int accepted_candidates);
401
409[[nodiscard]] bool shouldAcquireMmfMinModeProbe(
410 bool found_saddle_mode, int selected_phase, int accepted_candidates,
411 int negative_curvature_candidates, int force_improving_candidates,
412 int out_of_trust_candidates = 0);
413
417[[nodiscard]] bool shouldHoldMmfForExpectedImprovement(
418 bool wait_for_true_sample, Eigen::Index ntrain,
419 Eigen::Index ntrain_at_hold);
420
424[[nodiscard]] double mmfMinModeProbeStep(double recovery_disp_cap,
425 double seed_kick,
426 double max_burst_displacement);
427
430[[nodiscard]] Eigen::VectorXd minModeProbePosition(const Eigen::VectorXd& seed,
431 const Eigen::VectorXd& mode,
432 double step);
433
434[[nodiscard]] bool isMmfAdaptiveThresholdSeeded(double current_threshold);
435
438[[nodiscard]] bool shouldLeaseAfterPureRejectProgress(
439 bool pure_reject_lock, bool improved_under_backoff,
440 bool improved_since_pure_reject = false);
441
448[[nodiscard]] bool shouldLeaseAfterExhaustedQuietStall(
449 bool pure_reject_lock, bool exhausted_recovery_reject_applies,
450 bool oie_quiet_handoff_stalled, bool oie_acquisition_quiet,
451 bool current_chain_certificate, bool current_saddle_stencil_certificate,
452 bool ci_posterior_confident, bool ci_is_energy_maximum);
453
457[[nodiscard]] bool shouldBlockRejectedSeedReplay(
458 bool rejected_seed_replay, bool trap_detected,
459 bool improved_since_pure_reject, bool exhausted_quiet_stall_lease);
460
463[[nodiscard]] bool shouldSkipMmfAfterSpentMinModeProbe(
464 bool min_mode_probe_spent, bool rejected_seed_replay,
465 bool rejected_seed_position_matches);
466
469[[nodiscard]] bool isTruePesRecoverySaddleEnergyCertified(
470 double true_energy, double reactant_energy, double product_energy);
471
474[[nodiscard]] bool isTruePesRecoverySaddleCertified(double true_energy,
475 double recovery_force,
476 double force_tolerance,
477 double reactant_energy,
478 double product_energy);
479
484struct PureLockHopState {
485 bool pure_reject_lock = false;
486 double pure_reject_force = std::numeric_limits<double>::quiet_NaN();
487 bool force_improving_recovery_active = false;
488 bool trusted_recovery_active = false;
489};
490[[nodiscard]] PureLockHopState pureLockStateAfterCiHop(PureLockHopState state);
491
492[[nodiscard]] double resolveMmfSeedDisplacement(
493 double configured_displacement, bool force_improving_recovery_active,
494 bool trusted_recovery_active);
495
499[[nodiscard]] bool shouldImmediateRereleaseAfterFi(
500 bool force_improving_recovery_active, double post_force,
501 double current_threshold, double force_tolerance);
502
503[[nodiscard]] bool shouldImmediateRereleaseAfterOciRecovery(
504 bool force_improving_recovery_active, bool trusted_recovery_active,
505 double post_force, double current_threshold, double force_tolerance,
506 bool current_saddle_stencil_certificate = false);
507
508[[nodiscard]] bool shouldImmediateRereleaseAfterOciRecovery(
509 const MMFRunResult& burst, double current_threshold, double force_tolerance,
510 bool current_saddle_stencil_certificate = false);
511
515[[nodiscard]] bool mmfAttemptConsumedAfterRecovery(
516 bool mmf_attempted, bool trusted_recovery_advanced,
517 bool requires_outer_path_refresh);
518
523template <typename ThresholdProvider, typename StencilProvider,
524 typename SessionRestartProvider, typename RereleaseRunner>
525MMFRunResult continueImmediateOciRecovery(
526 MMFRunResult burst, double force_tolerance,
527 ThresholdProvider current_threshold, StencilProvider current_stencil,
528 SessionRestartProvider session_restart_requested, RereleaseRunner rerelease)
529{
530 const std::function<bool()> restart_requested =
531 std::move(session_restart_requested);
532 for (;;) {
533 throwIfOracleSessionRestartRequested(restart_requested);
534 if (burst.convergedAfterMMF) break;
535 const double threshold = current_threshold();
536 if (!shouldImmediateRereleaseAfterOciRecovery(
537 burst, threshold, force_tolerance, current_stencil())) {
538 break;
539 }
540 burst = rerelease(burst, threshold);
541 }
542 return burst;
543}
544
545template <typename ThresholdProvider, typename StencilProvider,
546 typename RereleaseRunner>
547MMFRunResult continueImmediateOciRecovery(MMFRunResult burst,
548 double force_tolerance,
549 ThresholdProvider current_threshold,
550 StencilProvider current_stencil,
551 RereleaseRunner rerelease)
552{
553 return continueImmediateOciRecovery(
554 std::move(burst), force_tolerance, std::move(current_threshold),
555 std::move(current_stencil), [] { return false; }, std::move(rerelease));
556}
557
558[[nodiscard]] bool shouldPreserveFiRecoveryGateAfterRetry(
559 bool force_improving_recovery_active, double pre_force,
560 double current_threshold, double force_tolerance,
561 bool recovery_selection_exhausted = false);
562
563[[nodiscard]] bool shouldPreserveTrustedRecoveryGateAfterRetry(
564 bool trusted_recovery_active, MMFStatus status, bool force_improved,
565 bool trusted_recovery_advanced, bool rejected_helped_handback,
567 bool recovery_selection_exhausted = false);
568
569[[nodiscard]] bool shouldRecordRejectedSeedForRecoveryGate(
570 bool preserve_fi_recovery_gate, bool preserve_trusted_recovery_gate);
571
572[[nodiscard]] double trustedRetryRejectForceAfterRetry(
573 bool preserve_trusted_recovery_gate,
574 double existing_trusted_retry_reject_force, double retry_reject_force);
575
576[[nodiscard]] bool shouldHarvestAcceptedRecoveryObservation(
577 bool trusted_recovery_advanced);
578
579[[nodiscard]] bool shouldKeepTrustedRecoveryGateAfterAdvance(
580 bool trusted_recovery_advanced, bool force_improved);
581
585[[nodiscard]] bool shouldPromoteCurrentCiHandoffMismatchToTrap(
586 int handoff_outer_iter, int hook_outer_iter, double gp_force,
587 double oracle_force, double handoff_threshold);
588
591[[nodiscard]] bool shouldRefreshCurrentCiHandoffPrediction(
592 bool pending_request, int pending_ci, bool current_request,
593 int current_ci) noexcept;
594
600[[nodiscard]] bool isBandInformationExhaustedForMmf(
601 double max_chain_energy_variance, double likelihood_noise_variance,
602 double posterior_variance_threshold, double inner_unc_relative);
603
609[[nodiscard]] bool isOieAcquisitionQuietForMmf(
610 double max_chain_energy_variance, double posterior_variance_threshold);
611
615[[nodiscard]] bool hasCurrentOciSaddleStencilCertificate(
616 const ActiveLearningSession& session, const NEBPath& path, int ci_idx);
617
622[[nodiscard]] bool isOracleTransitionFocalHandoff(
623 int configured_focal_image, int ci_image_idx,
624 bool current_chain_certificate, bool current_saddle_stencil_certificate);
625
630[[nodiscard]] bool isOciMmfHandoffDataReady(
631 bool band_acquisition_quiet, bool current_saddle_stencil_certificate,
632 bool ci_posterior_confident, bool ci_is_energy_maximum);
633
634[[nodiscard]] bool isForceImprovingRecoveryStalledHandoff(
635 bool force_improving_recovery_active, bool ci_posterior_confident,
636 bool current_chain_certificate, bool oie_acquisition_quiet,
637 bool oie_quiet_handoff_stalled);
638
639[[nodiscard]] bool isTrustedRecoveryStalledHandoff(
640 bool trusted_recovery_active, bool ci_posterior_confident,
641 bool current_chain_certificate, bool ci_is_energy_maximum,
642 bool oie_acquisition_quiet, bool oie_quiet_handoff_stalled);
643
644[[nodiscard]] bool shouldUseTrustedRecoveryStalledHandoff(
645 bool trusted_retry_progress_pending, bool trusted_recovery_stalled_handoff);
646
647[[nodiscard]] bool isTrustedRecoveryProgressHandoff(
648 bool trusted_recovery_active, double trusted_retry_reject_force,
649 double conv_force, double current_threshold, bool ci_posterior_confident,
650 bool ci_is_energy_maximum, bool rejected_seed_replay,
651 bool current_chain_certificate, bool oie_quiet_handoff_stalled,
652 bool oie_acquisition_quiet);
653
654[[nodiscard]] bool isCurrentChainCertifiedHandoff(
655 bool trusted_retry_progress_pending, bool current_chain_certificate,
656 bool rejected_seed_replay, bool ci_posterior_confident,
657 bool ci_is_energy_maximum, bool oie_acquisition_quiet,
658 bool exhausted_recovery_reject_active = false);
659
660[[nodiscard]] bool exhaustedRecoveryRejectAppliesToCi(
661 bool exhausted_recovery_reject_active, long reject_climbing_image,
662 long climbing_image);
663
666[[nodiscard]] bool shouldRequestCurrentCiOracleForExhaustedRecovery(
667 bool exhausted_recovery_reject_active, long reject_climbing_image,
668 long climbing_image);
669
672[[nodiscard]] bool isRefreshedExhaustedRecoveryHandoff(
673 bool exhausted_recovery_reject_applies, bool current_chain_certificate,
674 bool current_saddle_stencil_certificate, bool rejected_seed_replay,
675 bool rejected_seed_position_matches, bool ci_posterior_confident,
676 bool ci_is_energy_maximum);
677
680[[nodiscard]] bool activeMmfRecoveryOwnsClimbingImage(
681 bool force_improving_recovery_active, bool trusted_recovery_active);
682
683[[nodiscard]] int activeOieRecoveryOwnerImage(
684 int recorded_owner_image, int current_ci_image,
685 bool force_improving_recovery_active, bool trusted_recovery_active);
686
690[[nodiscard]] bool shouldHoldOieFixedImage(bool force_improving_recovery_active,
691 bool trusted_recovery_active);
692
693[[nodiscard]] bool shouldHoldOieFixedImage(bool force_improving_recovery_active,
694 bool trusted_recovery_active,
695 bool rejected_recovery_seed);
696
697[[nodiscard]] bool shouldRequestOieRecoveryModelGrowth(
698 bool force_improving_recovery_active, bool trusted_recovery_active,
699 bool rejected_recovery_seed, MmfInformationGate info_gate);
700
701[[nodiscard]] bool shouldSuppressMmfRecoveryRetry(
702 bool force_improving_recovery_active, bool trusted_recovery_active,
703 MmfInformationGate info_gate);
704
705[[nodiscard]] bool shouldReleaseOieRecoveryForCertifiedHandover(
706 bool active_recovery, int recovery_owner_image, int candidate_image,
707 bool candidate_posterior_confident, bool candidate_chain_certificate,
708 bool candidate_saddle_stencil_certificate);
709
710[[nodiscard]] bool shouldReleaseOieExhaustedRecoveryForCertifiedHandover(
711 bool exhausted_recovery_reject_active, int rejected_image,
712 int candidate_image, bool candidate_posterior_confident,
713 bool candidate_chain_certificate,
714 bool candidate_saddle_stencil_certificate);
715
716[[nodiscard]] bool shouldReleaseOieRecoveryForInvalidatedOwner(
717 bool active_recovery, int recovery_owner_image, int retry_image,
718 bool recovery_model_growth_ready, bool band_force_converged,
719 bool owner_chain_certificate, bool owner_saddle_stencil_certificate,
720 bool owner_posterior_confident, bool owner_is_energy_maximum);
721
722[[nodiscard]] bool shouldAdvanceOieRecoveryInformationGate(
723 bool active_recovery, int recovery_owner_image, int retry_image);
724
725[[nodiscard]] OieFixedImageLease makeOieRecoveryFixedImageLease(
726 int ci_image_idx, bool force_improving_recovery_active,
727 bool trusted_recovery_active, bool rejected_recovery_seed,
728 MmfInformationGate info_gate, bool recovery_retry_blocked = false);
729
732[[nodiscard]] OieFixedImageLease makeOieExhaustedRecoveryFixedImageLease(
733 int ci_image_idx, bool exhausted_recovery_reject_active,
734 long reject_climbing_image);
735
739[[nodiscard]] OieFixedImageLease makeOieExhaustedRecoveryEvidenceLease(
740 int ci_image_idx, bool exhausted_recovery_reject_active,
741 long reject_climbing_image, int candidate_image);
742
743[[nodiscard]] bool isOieRecoveryOwnerModelGrowthReady(
744 bool model_growth_requested, const MmfSurrogateFingerprint& surrogate_now,
745 const MmfSurrogateFingerprint& surrogate_at_request);
746
747[[nodiscard]] bool isOieRecoveryModelGrowthCertified(
748 int recovery_owner_image, int retry_image, bool recovery_model_growth_ready,
749 bool current_chain_certificate, bool current_saddle_stencil_certificate,
750 bool recovery_owner_is_energy_maximum);
751
752[[nodiscard]] bool isOieExhaustedRecoveryModelGrowthCertified(
753 int recovery_owner_image, int retry_image, bool recovery_model_growth_ready,
754 bool current_chain_certificate, bool current_saddle_stencil_certificate,
755 bool recovery_owner_is_energy_maximum, bool rejected_seed_replay);
756
757[[nodiscard]] bool shouldUseSurfaceUpdatedTrapRetryForCurrentCiOracle(
758 bool trap_surface_updated, bool trusted_recovery_active,
759 double trusted_retry_reject_force, double conv_force,
760 double current_threshold);
761
762[[nodiscard]] bool shouldRetireTrustedRetryAfterProgress(
763 bool trusted_recovery_active, double trusted_retry_reject_force,
764 double conv_force, double current_threshold);
765
766[[nodiscard]] bool shouldTriggerMmf(
767 const OCINEBConfig& cfg, double convForce, bool ci_active,
768 long climbingImage, long numImages, bool ci_posterior_confident,
769 double current_threshold, bool trap_detected, bool trap_backoff_active,
770 bool trap_surface_updated = false,
771 MmfInformationGate info_gate = MmfInformationGate::Open,
772 bool ci_is_energy_maximum = false, bool band_information_exhausted = false,
773 bool oie_acquisition_quiet = false, bool oie_acquisition_stalled = false,
774 bool certified_recovery_stalled_handoff = false,
775 bool certified_handoff = false);
776
777[[nodiscard]] double resolveDimerVarianceTauRelative(
778 const GPNEBConfig& neb_config, const OCINEBConfig& oci_config);
779
780[[nodiscard]] bool shouldInstallOciMmfHook(const GPNEBConfig& neb_config,
781 const OCINEBConfig& oci_config);
782
783[[nodiscard]] MmfHandoffPolicy resolveMmfHandoffPolicy(
784 MmfHandoffPolicy configured, NEBMode mode);
785
786[[nodiscard]] bool shouldUseHssvdAnalyticDimerCurvature(
787 const GPNEBConfig& neb_config);
788[[nodiscard]] bool shouldUseHssvdAnalyticDimerCurvature(
789 const GPNEBConfig& neb_config, bool has_spectral_posterior);
790
791[[nodiscard]] double resolveOciForceTolerance(const OCINEBConfig& oci_config);
792
796[[nodiscard]] double mmfLeaseForceTolerance(const OCINEBConfig& oci_config);
797
798[[nodiscard]] gpr::InputParameters buildDimerParameters(
799 const GPNEBConfig& neb_config, const OCINEBConfig& oci_config,
800 gpr::AtomsConfiguration& tmp);
801
802[[nodiscard]] gpr::InputParameters buildDimerParameters(
803 const GPNEBConfig& neb_config, const OCINEBConfig& oci_config,
804 gpr::AtomsConfiguration& tmp, bool use_analytic_hssvd);
805
806} // namespace detail
807
813 bool use_mmf = false;
814
818 bool rg_minmode_dimer = false;
819
825
833 double trigger_force = 0.0;
834
841 double trigger_factor = 0.31;
842
845 long max_steps = 0;
846
854 double alignment_cos_tol = 0.85;
855
859 double force_tolerance = 0.05;
862 std::function<double()> effective_force_tolerance;
863
868
873
878
880 double dimer_kappa_beta = 0.0;
881
885 bool dimer_eval_image1 = true;
886
898
902 Eigen::VectorXd initial_orient;
903
910
916
925 double dimer_variance_tau_rel = std::numeric_limits<double>::quiet_NaN();
926
931
941
944};
945
947 double current_threshold = -1.0;
948 double baseline_force = -1.0;
950 bool pure_reject_lock = false;
959 std::numeric_limits<double>::quiet_NaN();
960 detail::MmfInformationGate info_gate = detail::MmfInformationGate::Open;
961 detail::MmfSurrogateFingerprint mmf_surrogate_at_last_reject;
964};
965
969// One dimer-trajectory row held back for the band model: the geometry the
970// dimer visited and what the oracle returned there.
972 Eigen::VectorXd positions;
973 double energy = 0.0;
974 Eigen::VectorXd gradient;
975};
976
977namespace detail {
978[[nodiscard]] std::vector<StagedDimerObservation> stageDimerObservationUpdates(
979 const gpr::Observation& initial, const gpr::Coord& positions,
980 const gpr::FieldMatrixd& energies, const gpr::Coord& gradients,
981 double energy_origin);
982
987void configureBurstDimerSecant(atmd::AtomicDimer& dimer,
989} // namespace detail
990
992public:
993 explicit OCINEBController(OCINEBConfig cfg);
994
998 void initBaseline(double baseline_force);
999 bool baselineSet() const
1000 {
1001 return baseline_force_ > 0.0;
1002 }
1003 void recordMmfHandoffForce(double handoff_force,
1004 bool handoff_data_ready = false);
1005
1009 [[nodiscard]] bool shouldPrepareMmfHandoff(
1010 bool trap_detected = false, bool band_information_exhausted = false,
1011 bool current_chain_certificate = false) const;
1012
1023 bool shouldTrigger(double convForce, bool ci_active, long climbingImage,
1024 long numImages, bool ci_posterior_confident,
1025 bool trap_detected = false, std::size_t ntrain_now = 0,
1026 bool ci_is_energy_maximum = false,
1027 bool band_information_exhausted = false,
1028 bool oie_acquisition_quiet = false,
1029 bool rejected_seed_replay = false,
1030 bool current_chain_certificate = false,
1031 bool current_saddle_stencil_certificate = false,
1032 bool rejected_seed_position_matches = false,
1033 bool stagnation_handoff = false) const;
1034
1038
1041 detail::MmfSurrogateFingerprint surrogate);
1042
1045 detail::MmfPosteriorActionFingerprint action);
1046
1049 void noteMmfSurrogateChange(detail::MmfSurrogateFingerprint surrogate);
1050
1053 void noteMmfActionChange(detail::MmfPosteriorActionFingerprint action);
1054
1057 {
1058 min_mode_probe_spent_ = true;
1059 pending_min_mode_probe_lease_ = false;
1060 trap_surface_updated_ = false;
1061 uncertified_hook_reject_active_ = false;
1062 }
1063
1067 [[nodiscard]] detail::MmfPosteriorActionFingerprint previewMmfAction(
1068 ActiveLearningSession& session, const NEBPath& path, int ci_image_idx,
1069 const GPNEBConfig& neb_config) const;
1070
1074 const Eigen::VectorXd& owner_position, long owner_image);
1075
1079
1091 const Eigen::VectorXd& ci_position,
1092 detail::MmfSurrogateFingerprint surrogate_now, long climbingImage = -1)
1093 {
1094 if (uncertified_hook_reject_active_) return;
1095 if (detail::shouldSuppressMmfRecoveryRetry(
1096 force_improving_recovery_active_, trusted_recovery_active_,
1097 mmf_info_gate_)) {
1098 return;
1099 }
1100 // A fresh dimer replays the rejected trajectory only when its seed
1101 // geometry AND the surrogate it consumes are both unchanged. Once
1102 // the surrogate has grown since the reject (the burst's own oracle
1103 // rows or recovery-growth evidence), re-firing acts on new
1104 // information; vetoing on position alone pins a converged-quiet CI
1105 // on the rejected seed forever while its true force sits above
1106 // tolerance.
1107 if (rejectedMmfSeedReplay(ci_position, surrogate_now, climbingImage)) {
1108 return;
1109 }
1110 mmf_info_gate_ = detail::MmfInformationGate::Open;
1111 // Rejected-action evidence remains the baseline for replay checks.
1112 // Do NOT clear pure_reject_lock_ here: noise-floor open is not a
1113 // Helped certificate. Only Helped (updateThresholdSuccess) or a
1114 // climbing-image marker change should re-arm MMF after a pure
1115 // restore-reject.
1116 }
1117
1118 [[nodiscard]] bool rejectedMmfSeedPositionMatches(
1119 const Eigen::VectorXd& ci_position,
1120 const gpr::AtomsConfiguration* atoms_config = nullptr,
1121 long climbingImage = -1) const;
1122
1125 [[nodiscard]] bool rejectedMmfSeedReplay(
1126 const Eigen::VectorXd& ci_position,
1127 detail::MmfSurrogateFingerprint surrogate, long climbingImage = -1,
1128 const gpr::AtomsConfiguration* atoms_config = nullptr) const;
1129
1130 [[nodiscard]] bool rejectedMmfSeedReplay(
1131 const Eigen::VectorXd& ci_position,
1132 const detail::MmfPosteriorActionFingerprint& action,
1133 long climbingImage = -1,
1134 const gpr::AtomsConfiguration* atoms_config = nullptr) const;
1135
1138 void noteMmfRejectCiPosition(const Eigen::VectorXd& ci_position,
1139 long climbingImage = -1)
1140 {
1141 mmf_reject_ci_position_ = ci_position;
1142 mmf_reject_climbing_image_ = climbingImage;
1143 }
1144
1148 double convForce, const Eigen::VectorXd& ci_position,
1149 detail::MmfSurrogateFingerprint surrogate, long climbingImage = -1);
1150
1152 double convForce, const Eigen::VectorXd& ci_position,
1153 detail::MmfPosteriorActionFingerprint action, long climbingImage = -1);
1154
1157 bool wantsCurrentCiOracle(double convForce, bool ci_active,
1158 long climbingImage, long numImages, int outerIter,
1159 bool ci_posterior_confident,
1160 bool trap_detected = false,
1161 std::size_t ntrain_now = 0,
1162 bool ci_is_energy_maximum = false);
1163
1168 void updateStability(long climbingImage);
1169
1171 void updateStabilityForOuter(long climbingImage, int outerIter);
1172
1182 MMFRunResult run(NEBPath& path, int ci_image_idx, NEBOracle& oracle,
1183 const GPNEBConfig& neb_config,
1184 ActiveLearningSession& session,
1185 bool trap_detected = false);
1186
1188 double threshold() const
1189 {
1190 return current_threshold_;
1191 }
1192
1194 [[nodiscard]] OCINEBDiagnostics diagnostics() const
1195 {
1196 return {current_threshold_,
1197 baseline_force_,
1198 soft_quiet_blocked_after_reject_,
1199 pure_reject_lock_,
1200 trap_backoff_active_,
1201 trap_surface_updated_,
1202 uncertified_hook_reject_active_,
1203 oie_quiet_handoff_stalled_,
1204 force_improving_recovery_active_,
1205 trusted_recovery_active_,
1206 exhausted_recovery_reject_active_,
1207 trusted_retry_reject_force_,
1208 mmf_info_gate_,
1209 mmf_surrogate_at_last_reject_,
1210 mmf_reject_climbing_image_,
1211 recovery_owner_image_};
1212 }
1213
1214private:
1215 // Run the burst against the session GP under a model lease. The lease keeps
1216 // the band-warm model and its scoped restore returns the hyperparameters at
1217 // exit, so the whole sequence has to live inside one scope.
1218 void runBurstUnderSessionModelLease(
1219 int ci_image_idx, NEBOracle& oracle, const GPNEBConfig& neb_config,
1220 ActiveLearningSession& session, const Eigen::VectorXd& initialMode,
1221 const gpr::Observation& middle_point, atmd::AtomicDimer& dimer,
1222 bool per_image_ready, MMFRunResult& result,
1223 std::vector<StagedDimerObservation>& staged_dimer_observations);
1224
1225 // Run the burst directly on the true potential, as gprd does: no model
1226 // lease, no session GP, the dimer builds its own surrogate from the oracle
1227 // calls it makes.
1228 void runBurstOnTruePotential(
1229 NEBOracle& oracle, const GPNEBConfig& neb_config,
1230 ActiveLearningSession& session, bool trap_detected,
1231 const Eigen::VectorXd& initialMode,
1232 const gpr::Observation& middle_point, atmd::AtomicDimer& dimer,
1233 double pre_neb_force, bool has_gp, MMFRunResult& result,
1234 std::vector<StagedDimerObservation>& staged_dimer_observations);
1235
1236 // Classify how the burst ended -- helped, a trusted advance, or neither --
1237 // and apply the band writeback and adaptive-threshold bookkeeping each
1238 // outcome implies.
1239 void recordBurstOutcome(NEBPath& path, int ci_image_idx,
1240 const GPNEBConfig& neb_config,
1241 ActiveLearningSession& session,
1242 const Eigen::VectorXd& savedPositions,
1243 bool adaptive_threshold_seeded, bool force_improved,
1244 double threshold_pre_force,
1245 double threshold_post_force, MMFRunResult& result);
1246
1247 struct CiAdaptiveState {
1248 double current_threshold = -1.0;
1249 double baseline_force = -1.0;
1250 bool trap_backoff_active = false;
1251 bool trap_surface_updated = false;
1252 bool has_cached_mode = false;
1253 bool mmf_attempted = false;
1254 bool soft_quiet_blocked_after_reject = false;
1255 bool uncertified_hook_reject_active = false;
1256 bool oie_quiet_handoff_stalled = false;
1257 bool exhausted_recovery_reject_active = false;
1258 double best_oie_quiet_handoff_force =
1259 std::numeric_limits<double>::quiet_NaN();
1260 double trusted_retry_reject_force =
1261 std::numeric_limits<double>::quiet_NaN();
1262 Eigen::VectorXd cached_mode;
1263 };
1264
1265 OCINEBConfig cfg_;
1266 [[nodiscard]] double forceTolerance() const;
1267 [[nodiscard]] std::optional<Eigen::VectorXd> initialModeForPath(
1268 const NEBPath& path, int ci_image_idx) const;
1269
1270 // Adaptive trigger state (matches eOn members).
1271 double current_threshold_ = -1.0;
1272 double baseline_force_ = -1.0;
1273
1277 bool soft_quiet_blocked_after_reject_ = false;
1278
1284 bool pure_reject_lock_ = false;
1287 double pure_reject_force_ = std::numeric_limits<double>::quiet_NaN();
1288
1289 // Per-climbing-image adaptive-state tracking (no stability counter:
1290 // the GP posterior confidence is the handover gate).
1291 long previousClimbingImage_ = -1;
1292 int lastStabilityOuter_ = -1;
1293 long lastStabilityClimbingImage_ = -1;
1294 long mmf_iterations_used_ = 0;
1295 long mmf_bursts_fired_ = 0;
1296 bool mmf_attempted_ = false;
1297 bool trap_backoff_active_ = false;
1298 bool trap_surface_updated_ = false;
1299 bool uncertified_hook_reject_active_ = false;
1300 bool oie_quiet_handoff_stalled_ = false;
1301 bool force_improving_recovery_active_ = false;
1302 bool trusted_recovery_active_ = false;
1303 int recovery_owner_image_ = -1;
1304 bool exhausted_recovery_reject_active_ = false;
1305 bool pending_min_mode_probe_lease_ = false;
1306 bool min_mode_probe_spent_ = false;
1307 bool mmf_wait_for_true_sample_ = false;
1308 Eigen::Index mmf_wait_ntrain_ = 0;
1309 double trusted_retry_reject_force_ =
1310 std::numeric_limits<double>::quiet_NaN();
1311 double best_oie_quiet_handoff_force_ =
1312 std::numeric_limits<double>::quiet_NaN();
1313 detail::MmfInformationGate mmf_info_gate_ =
1314 detail::MmfInformationGate::Open;
1315 detail::MmfSurrogateFingerprint mmf_surrogate_at_last_reject_;
1316 detail::MmfPosteriorActionFingerprint mmf_action_at_last_reject_;
1317 Eigen::VectorXd mmf_reject_ci_position_;
1318 long mmf_reject_climbing_image_ = -1;
1319
1320 // Mode caching: previous burst's converged eigenvector seeds
1321 // the next, dramatically cuts rotation cost when the CI
1322 // image is moving along a stable reaction coordinate.
1323 bool has_cached_mode_ = false;
1324 Eigen::VectorXd cached_mode_;
1325 std::unordered_map<long, CiAdaptiveState> ci_adaptive_state_;
1326
1327 void saveAdaptiveState(long climbingImage);
1328 void loadAdaptiveState(long climbingImage);
1329 void retireTrustedRetryIfProgressed(double handoff_force);
1330 void updateThresholdSuccess(double convForce, double newForce);
1331 void updateThresholdBackoff(double convForce);
1332};
1333
1369
1373inline bool ciIndexCertificateRefuted(const OCINEBResult& result)
1374{
1375 return result.ci_index_evaluated && result.ci_index_verified &&
1376 !result.ci_index_certified;
1377}
1378
1382inline bool ocinebReportsConverged(const OCINEBResult& result)
1383{
1384 const bool converged =
1385 result.dimer_ran ? result.dimer_converged : result.neb_result.converged;
1386 return converged && !ciIndexCertificateRefuted(result) &&
1387 !result.neb_result.index_refused;
1388}
1389
1405
1412int reduceOracleProviderCalls(int local_calls);
1413
1415public:
1416 void record(const OCINEBResult& attempt)
1417 {
1418 const auto& neb = attempt.neb_result;
1419 const int neb_breakdown =
1420 neb.oracle_calls_endpoints + neb.oracle_calls_initial +
1421 neb.oracle_calls_outer + neb.oracle_calls_validation;
1422 if (neb_breakdown != neb.oracle_calls ||
1423 attempt.dimer_oracle_calls < 0) {
1424 throw std::logic_error("inconsistent OCINEB oracle accounting");
1425 }
1426 ++attempts_;
1427 endpoints_ += neb.oracle_calls_endpoints;
1428 initial_ += neb.oracle_calls_initial;
1429 outer_ += neb.oracle_calls_outer;
1430 validation_ += neb.oracle_calls_validation;
1431 dimer_ += attempt.dimer_oracle_calls;
1432 outer_iterations_ += neb.outer_iterations;
1433 hyperparameter_refits_ += neb.hyperparameter_refits;
1434 fixed_theta_refreshes_ += neb.fixed_theta_refreshes;
1435 }
1436
1440 void recordPolish(int calls)
1441 {
1442 if (calls < 0) throw std::logic_error("negative polish oracle count");
1443 outer_ += calls;
1444 }
1445
1449 void recordCertificate(int calls)
1450 {
1451 if (calls < 0)
1452 throw std::logic_error("negative certificate oracle count");
1453 certificate_ += calls;
1454 }
1455
1457 void recordValidation(int calls)
1458 {
1459 if (calls < 0)
1460 throw std::logic_error("negative validation oracle count");
1461 validation_ += calls;
1462 }
1463
1464 [[nodiscard]] OCINEBOracleCallSummary reconcile(int provider_calls) const
1465 {
1466 const int completed_calls = endpoints_ + initial_ + outer_ +
1467 validation_ + dimer_ + certificate_;
1468 if (provider_calls < completed_calls) {
1469 throw std::logic_error(
1470 "provider oracle count is smaller than completed attempts (" +
1471 std::to_string(provider_calls) + " < " +
1472 std::to_string(completed_calls) + ")");
1473 }
1475 summary.attempts = attempts_;
1476 summary.endpoints = endpoints_;
1477 summary.initial = initial_;
1478 summary.outer = outer_;
1479 summary.validation = validation_;
1480 summary.dimer = dimer_;
1481 summary.certificate = certificate_;
1482 summary.transition = provider_calls - completed_calls;
1483 summary.to_convergence = provider_calls - validation_;
1484 summary.total = provider_calls;
1485 summary.outer_iterations = outer_iterations_;
1486 summary.hyperparameter_refits = hyperparameter_refits_;
1487 summary.fixed_theta_refreshes = fixed_theta_refreshes_;
1488 return summary;
1489 }
1490
1491private:
1492 int attempts_ = 0;
1493 int endpoints_ = 0;
1494 int initial_ = 0;
1495 int outer_ = 0;
1496 int validation_ = 0;
1497 int dimer_ = 0;
1498 int certificate_ = 0;
1499 int outer_iterations_ = 0;
1500 int hyperparameter_refits_ = 0;
1501 int fixed_theta_refreshes_ = 0;
1502};
1503
1509OCINEBResult runOCINEB(NEBOracle oracle, const Eigen::VectorXd& initial,
1510 const Eigen::VectorXd& final_state, int n_images,
1511 const GPNEBConfig& neb_config,
1512 const OCINEBConfig& oci_config,
1513 ActiveLearningSession& session);
1514
1518
1527OCINEBResult runOCINEBRefined(NEBOracle oracle, const Eigen::VectorXd& initial,
1528 const Eigen::VectorXd& final_state, int n_images,
1529 GPNEBConfig neb_config,
1530 const OCINEBConfig& oci_config,
1531 ActiveLearningSession& session);
1532
1536void certifyOCINEBResult(OCINEBResult& result, NEBOracle oracle,
1537 const Eigen::VectorXd& initial,
1538 const Eigen::VectorXd& final_state, int n_images,
1539 const GPNEBConfig& neb_config,
1540 const OCINEBConfig& oci_config,
1541 ActiveLearningSession& session);
1542
1551 bool converged = false;
1552 bool wall_clock_limit = false;
1554 int phases = 0;
1555 double force = std::numeric_limits<double>::quiet_NaN();
1556 double curvature = std::numeric_limits<double>::quiet_NaN();
1557 Eigen::VectorXd positions;
1558 double energy = std::numeric_limits<double>::quiet_NaN();
1559 Eigen::VectorXd gradient;
1560};
1561
1570 const OCINEBConfig& oci_config, const GPNEBConfig& neb_config,
1571 ActiveLearningSession& session, NEBOracle& oracle,
1572 const Eigen::VectorXd& x_seed, double e_seed, const Eigen::VectorXd& g_seed,
1573 const Eigen::VectorXd& mode_seed, double energy_ceiling);
1574
1575} // namespace neb
1576} // namespace gpr
1577
1578#endif // GPR_NEB_OCINEB_CONTROLLER_H_
GP-accelerated NEB: AIE and OIE variants.
ActiveLearningSession: shared GP + training data across GP-NEB and GP-Dimer phases.
Atomic dimer.
NEB path: chain of images between two endpoints.
Definition NEBPath.h:57
void noteMmfRejectActionSnapshot(detail::MmfPosteriorActionFingerprint action)
Enter the information wait with the posterior action MMF would consume.
void recordUncertifiedMmfHookReject(double convForce, const Eigen::VectorXd &ci_position, detail::MmfSurrogateFingerprint surrogate, long climbingImage=-1)
MMFRunResult run(NEBPath &path, int ci_image_idx, NEBOracle &oracle, const GPNEBConfig &neb_config, ActiveLearningSession &session, bool trap_detected=false)
bool wantsCurrentCiOracle(double convForce, bool ci_active, long climbingImage, long numImages, int outerIter, bool ci_posterior_confident, bool trap_detected=false, std::size_t ntrain_now=0, bool ci_is_energy_maximum=false)
void updateStabilityForOuter(long climbingImage, int outerIter)
Idempotent stability update keyed by GP-NEB outer iteration.
void noteMmfRejectSurrogateSnapshot(detail::MmfSurrogateFingerprint surrogate)
Enter AwaitingFirstTrainingGrowth with the model lease MMF consumed.
bool shouldTrigger(double convForce, bool ci_active, long climbingImage, long numImages, bool ci_posterior_confident, bool trap_detected=false, std::size_t ntrain_now=0, bool ci_is_energy_maximum=false, bool band_information_exhausted=false, bool oie_acquisition_quiet=false, bool rejected_seed_replay=false, bool current_chain_certificate=false, bool current_saddle_stencil_certificate=false, bool rejected_seed_position_matches=false, bool stagnation_handoff=false) const
void releaseRecoveryOwnerForCertifiedHandover(const Eigen::VectorXd &owner_position, long owner_image)
bool rejectedMmfSeedReplay(const Eigen::VectorXd &ci_position, detail::MmfSurrogateFingerprint surrogate, long climbingImage=-1, const gpr::AtomsConfiguration *atoms_config=nullptr) const
void noteMmfActionChange(detail::MmfPosteriorActionFingerprint action)
void noteMmfSurrogateChange(detail::MmfSurrogateFingerprint surrogate)
void initBaseline(double baseline_force)
OCINEBDiagnostics diagnostics() const
Snapshot of trigger-gate state for verbose run diagnostics.
bool rejectedMmfSeedPositionMatches(const Eigen::VectorXd &ci_position, const gpr::AtomsConfiguration *atoms_config=nullptr, long climbingImage=-1) const
double threshold() const
Current adaptive trigger threshold (eOn ~current_threshold_~).
bool shouldPrepareMmfHandoff(bool trap_detected=false, bool band_information_exhausted=false, bool current_chain_certificate=false) const
void noteMmfMinModeProbeConsumed()
Record that the rejected action consumed a true-potential mode probe.
void openInformationGateAtNoiseFloor(const Eigen::VectorXd &ci_position, detail::MmfSurrogateFingerprint surrogate_now, long climbingImage=-1)
detail::MmfPosteriorActionFingerprint previewMmfAction(ActiveLearningSession &session, const NEBPath &path, int ci_image_idx, const GPNEBConfig &neb_config) const
void noteMmfRejectCiPosition(const Eigen::VectorXd &ci_position, long climbingImage=-1)
void updateStability(long climbingImage)
void recordMmfHandoffForce(double handoff_force, bool handoff_data_ready=false)
OCINEBOracleCallSummary reconcile(int provider_calls) const
void record(const OCINEBResult &attempt)
void recordValidation(int calls)
Independent force measurements made solely to validate the final saddle.
int status
eon_relax_band_t * band
DimerRelaxationTerminationReason
The nudged elastic band: path, GP-NEB driver, configuration and result, acquisition,...
int reduceOracleProviderCalls(int local_calls)
void certifyOCINEBResult(OCINEBResult &result, NEBOracle oracle, const Eigen::VectorXd &initial, const Eigen::VectorXd &final_state, int active_n_images, const GPNEBConfig &neb_config, const OCINEBConfig &oci_config, ActiveLearningSession &session)
double testingHelpedModeCurvature()
std::function< std::pair< double, Eigen::VectorXd >( const Eigen::VectorXd &positions)> NEBOracle
Oracle function: positions -> (energy, gradient).
Definition GPNEB.h:82
OCINEBResult runOCINEB(NEBOracle oracle, const Eigen::VectorXd &initial, const Eigen::VectorXd &final_state, int n_images, const GPNEBConfig &neb_config, const OCINEBConfig &oci_config_in, ActiveLearningSession &session)
bool ciIndexCertificateRefuted(const OCINEBResult &result)
bool ocinebReportsConverged(const OCINEBResult &result)
IndexEscapeResult runIndexEscapeGpDimer(const OCINEBConfig &oci_config, const GPNEBConfig &neb_config, ActiveLearningSession &session, NEBOracle &oracle, const Eigen::VectorXd &x_seed, double e_seed, const Eigen::VectorXd &g_seed, const Eigen::VectorXd &mode_seed, double energy_ceiling)
OCINEBResult runOCINEBRefined(NEBOracle oracle, const Eigen::VectorXd &initial, const Eigen::VectorXd &final_state, int n_images, GPNEBConfig neb_config, const OCINEBConfig &oci_config, ActiveLearningSession &session)
MMFStatus
Outcome of one MMF burst, mirroring eOn's enum class.
@ Helped
Mode converged, alignment in tol.
@ MaxIterations
Hit dimer iter cap; usable but no signal.
@ Skipped
Invalid input or mode drifted outside tol.
@ PositiveCurvature
CI was a minimum; restore position.
NEBMode
NEB evaluation mode.
Definition GPNEB.h:68
Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
Definition Macros.h:16
FieldMatrixd Coord
Definition Macros.h:35
Eigen::Matrix< double, EigenDynamic, EigenDynamic, FieldMatrixStorage > FieldMatrixd
Definition Macros.h:25
Stores configurations of all atoms in the system.
Definition Structures.h:832
Observation data: energy, gradient and positions.
Configuration for GP-NEB.
Definition GPNEB.h:246
bool index_refused
A force-quiet point failed the index-1 gate and no budget remains.
Definition GPNEB.h:3690
Eigen::VectorXd positions
final midpoint
int oracle_calls
oracle rows the search paid
bool converged
true-force convergence at the midpoint
int phases
measured dimer phases
Eigen::VectorXd gradient
true gradient at the final midpoint
bool wall_clock_limit
shared search deadline expired
Result of one ~OCINEBControllerrun~ invocation.
MMFRejectKind reject_kind
Reason for rejected_helped_handback, used by recovery-gate policy.
bool shouldResetOptimizer
Whether the caller should reset its outer optimiser state.
double alignment
Alignment of final mode to current path tangent.
bool convergedAfterMMF
True iff newForce < force_tolerance.
bool trusted_recovery_advanced
A non-Helped recovery phase was accepted and written to the chain.
MMFStatus status
Final dimer-status for reporting / accounting.
double previousForce
Oracle force at CI image before this MMF burst.
bool recovery_selection_exhausted
The recovery selector found no acceptable phase to hand back.
MmfHandoffPolicy handoff_policy
bool use_mmf
Master switch. False -> ~runOCINEB~ degenerates to bare NEB.
int dimer_imspe_history_size
EMD-filtered ring-buffer size for the dimer IMSPE soft-skip.
std::function< double()> effective_force_tolerance
Eigen::VectorXd initial_orient
double dimer_kappa_beta
Xiao contour curvature restraint; zero disables, paper uses 5 Angstrom.
detail::MmfInformationGate info_gate
detail::MmfSurrogateFingerprint mmf_surrogate_at_last_reject
int refinements
Number of band refinements (image doublings) folded into this result.
bool ci_index_evaluated
Climbing-image index certificate (see certifyClimbingImageIndex).
bool band_midpoint_evaluated
Surrogate midpoint check of the returned band (certifyBandMidpoints).
Eigen::VectorXd ci_final_position