GP-NEB to GP-Dimer state transfer

Status: implemented. The in-process path is AtomicDimer::attachExternalGP with ActiveLearningSession::ModelLease (gpr/neb/Session.h). The standalone path is gprn --gp-observation-archive followed by gprd --gp-seed-archive and --gp-seed-noise, tested in tests/gpr/GprdCliTest.cpp. This page describes the contract of the state transfer. It does not claim fewer oracle calls, saddle convergence or MPI scaling; those need their own measurements.

Shared model and observations

NEB locates a path and supplies a saddle guess. Dimer refinement can reuse its measured observations and fitted covariance. The source and destination must agree on atom identities, frozen geometry, boundary conditions, prior means, and the kernel components. Reusing observations avoids evaluating those geometries again; the reduction in total oracle calls requires a measured comparison of the searches.

An in-process refinement uses AtomicDimer::attachExternalGP to borrow the session’s regression object. The owner keeps that model alive, and the refinement retains its communicator and fitted covariance. The OCINEB controller uses this path for its local saddle model.

A standalone gprd process uses the observation archive and the seed kernel file written by gprn. The two processes do not share a factorization; the destination conditions its restored kernel on the retained observations.

Global and per-image models

An in-process refinement acquires an ActiveLearningSession::ModelLease. The lease selects either the global GP or an eligible climbing-image GP; an ineligible image falls back to the global model. Borrowing the selected object preserves its communicator and observation ownership.

The image models condition on their selected observations with the global model’s fitted pair parameters. A dimer burst may refit the borrowed model against its local observations. The lease’s scoped restore then reinstates the band parameter frame: output mean and scale, fixed likelihood variance, constant covariance, heat component, retained active posterior, and learned length-scale groups with their release evidence. Optimizer curvature memory is discarded when those parameter groups change. A global parameter or group policy change makes an image model stale, so its next acquisition synchronizes it with the global fit. Group policy participates in the model revision even when the numerical parameter vector is unchanged.

The shared parameter identity also includes the output mean and scale, the frozen-mean policy, fixed likelihood variance, and constant covariance. These quantities determine physical predictions independently of the fitted theta vector. Changing any of them invalidates an image model’s materialized posterior and advances its surrogate revision. If the global model changes during a local lease, handback records the entry state; the subsequent image acquisition therefore rebuilds with the global state. Regression tests hold theta and observations fixed and compare energies, Cartesian gradients, and predictive variances after each independent frame change.

Compatible EB and Laplace image models inherit the global hyperparameter quadrature, including its normalized weights. With global measurements D and the image subset D_i, the local mixture is

\[q_i(f_*) = \sum_k w_k\,p(f_*\mid D_i,\theta_k), \qquad w_k \simeq p(\theta_k\mid D).\]

Laplace prediction uses this mixture’s mean and covariance. EB uses its covariance with the MAP mean. The EB mean is therefore not generally the mean of q_i; its squared error about the MAP prediction also contains the squared displacement between those two means.

Only the conditional factors depend on the local rows. Multiplying these weights by the local likelihood again would count observations twice. The immutable HyperparameterPosterior holds the parameter points and weights; it transfers neither training factors nor ownership of the source GP. Recipients validate the parameter domain, length-scale groups, atom and pair identity, frozen geometry, periodic cell, descriptor cutoff, model profile, prior-mean selection, output coordinates, likelihood and constant variance, and numerical jitter. Moving coordinates belong to the conditioning rows and may differ between models. Immutable chart and heat component handles must match the retained model. A charted model can restore its own quadrature but cannot import one from another model. Prior components also participate in the validity check for an existing materialized quadrature.

The image lease retains this measure across a dimer refit. Handback restores the entry parameter frame and schedules local conditioning at the retained points. A global observation change invalidates the image’s shared measure, even when the fitted theta remains unchanged. A lost local factor follows the same shared-measure conditioning path. Failed conditioning does not trigger an independent local estimate of the hyperparameter weights.

Global conditioning records the training revision separately from factor ownership and the last parameter fit. A factor can belong to the correct GP and still represent an older observation set. Model acquisition conditions such a factor on the canonical rows without forcing a hyperparameter search. Refactorizing unchanged measured rows retains a compatible existing parameter measure and rebuilds its conditional factors. A global dimer lease retains the entry measure only when no canonical observation changes during the burst. The source and recipients use the same geometry assembly for their conditional factors, including the spectral backend’s statistical-noise convention.

This localization does not equal conditioning on all global observations. Different image subsets can produce different means and covariances at the same geometry; shared hyperparameters alone do not ensure continuity across image-model boundaries. Acquisition and trust decisions therefore retain the model identity and revision, and saddle acceptance requires measured forces.

Measurements return separately from temporary parameter changes. Harvesting includes corrected seed rows as well as appended geometries. A repeated measurement updates the canonical energy and gradient in every selected image model that contains that geometry. Training revisions identify these updates even when the number of rows is unchanged.

Attaching a retained band observation to an image is a separate operation from acquiring another measurement. attachImageObservation selects the canonical row and its averaged targets without increasing its multiplicity or the global training revision. The archive-retention flag only controls archive writes: a dimer acquisition recorded in the archive still updates the canonical mean when it is admitted to the band model.

Predictive uncertainty belongs to the borrowed GP. An OCINEB dimer therefore uses the selected band model’s uncertainty mode. The hyperparameter minimizer is a separate choice: fitting an INLA mode does not itself select integrated predictive uncertainty. With Cholesky conditioning, the EB and Laplace posterior representations are rebuilt against the restored training state. Tests compare energies, gradients, and variances across temporary refits for both global and per-image leases, including four-rank execution.

The dimer Hessian differentiates the selected predictive mean. The analytic descriptor contraction serves MAP means, including the EB mean; a Laplace mixture mean follows the common Hessian dispatcher. Energy-only acquisition queries use the same predictive uncertainty mode as joint energy and gradient queries.

For EB and Laplace integration, joint covariance includes both the conditional covariance at each hyperparameter point and the covariance of the conditional means. Linear force observations, such as a dimer curvature stencil, contract that same covariance. The contraction precedes the triangular solve and the rank-owned contributions use the model’s communicator. Latent covariance excludes reporting noise. Predictive variance adds that noise and applies the output scale once, including when integration falls back to MAP.

The EB and Laplace posterior uses the fitted length-scale groups as parameter constraints. If J maps free increments into the complete parameter vector, curvature probes assemble J^T H J directly. The integration grid lives in those free coordinates and lifts through J. If Q denotes the resulting free-coordinate precision after regularization, the ambient covariance is J Q^{-1} J^T. Ambient precision uses the transpose of the left inverse of J, so its quadratic form agrees with the free-coordinate density. The particle posterior projects its score updates into the same parameter space. Group changes invalidate the posterior representation through the model revision; a dimer lease therefore preserves both the numerical parameters and the constraints that define their uncertainty.

Directional covariance assembly reconstructs streamed geometry only on the MPI rank that owns the block. All ranks agree on descriptor or block failure before entering matrix reductions, using the model’s communicator. Rejection clears the partial derivative matrices; valid subsequent calls use the same assembly and reduction order.

Persistent handoff

gprn --gp-observation-archive selects the readcon-db archive. The archive contains acquired observations, including rows outside the final fitted subset. Its training/ subdirectory records the final subset used by the band GP, and kernel.txt records the corresponding covariance state.

gprd --gp-seed-archive loads that directory. It prefers training/ when present and uses the containing kernel.txt. --gp-seed-noise archive retains the source physical likelihood variance; the default destination policy keeps the destination’s configured variance. Archive noise requires a compatible seed with a positive recorded likelihood variance.

A seeded dimer refits its hyperparameters only on a measured contradiction, and draws the fit subset from its own footprint: the rows it measured and the seed rows no farther from the last measured center, in the pair-distance metric, than the farthest of them. Those rows can lie a few thousandths of an angstrom apart. A pair type’s length scale moves in that fit only when the subset’s inverse-distance features of that type span at least one length scale, where the kernel has fallen by 1/e; otherwise it keeps its seeded value and the signal and likelihood variances fit alone. The posterior is conditioned on every row either way.

Both drivers use gpr::io::writeSeedKernel and gpr::io::readSeedKernel. Their implementation belongs to the library, with declarations available through gpridge/SeedKernel.h. readSeedKernelAtomTypes restores a reactive type map before GP initialization while checking physical atom identity, frozen geometry, the cell, and pair ordering.

The pairCutoff record stores the descriptor cutoff and switching width. Both must match the destination atom configuration and covariance operator before any seed parameters are installed. A record without pairCutoff describes an unbounded inverse-distance descriptor. Importing such a seed into a cutoff model is rejected.

Independent covariance components

A seed with chart or heat components uses version-two identity metadata and an explicit component manifest. It retains:

  • The base signal and constant variances, likelihood variance, output mean, output scale, and frozen-mean policy.

  • Raw pair-type inverse-distance lengths independently of the chart length.

  • The chart anchor, primitive definitions, moving mask, and periodic cell.

  • The heat reference geometries, its own pair metric, and its fitted weight.

The chart is reconstructed from its defining geometry. The heat metric is restored from the heat record even when it differs from the base pair metric. The destination selects the exact composed execution paths, so training, prediction, variance, and Hessian actions use the same operator. Covariance weights in the file use the source training-output units; the recorded output transform and selected noise policy determine their physical interpretation.

The reader parses and validates component records before changing model parameters. A missing component or incompatible identity rejects the seed. Version-one pair-kernel seeds remain readable. A legacy chart seed without its chart definition cannot establish an equivalent covariance and is rejected.

Validation

The CLI suite exercises descriptor identity, output units, archive noise, independent component lengths, and incomplete-record rejection. Composed round trips compare the full joint covariance, posterior energy and Cartesian gradient, posterior variance, and mean Hessian action after conditioning both models on the same observations.

These checks establish a state-transfer contract. Saddle convergence, index certification, oracle-call counts, and MPI scaling are separate measurements; a successful seed round trip does not establish improvements in those quantities.