GP-OIE controller invariants and design record¶
Status: partially implemented. The invariants listed here hold in
gpr/neb/GPNEB.cpp, which runs the GP-OIE outer loop for NEBMode::GP_OIE
(gprn --nebmode gp_oie, the default, and the Python gpridge.neb driver). The object model
that an earlier draft of this page proposed (OIEController,
BandTransaction, SurrogateRelaxer, TrustPolicy, a Cap’n Proto
GpOieConfig, Python snapshot types) was not built. The section
“Proposed types that do not exist” lists each of them with the symbol that
does the same job in the code.
This page is developer reference. How the loop behaves for a user is in The surrogate loop and derivative observations. The default oracle-target ranking inside the variance tier is in TPE acquisition for GP-OIE.
Purpose¶
GP-OIE (optimal image evaluation) is a nudged elastic band search in which a Gaussian-process surrogate relaxes the whole band and the potential is called only for the images chosen by an acquisition rule. The controller has to keep three kinds of geometry apart:
the accepted band, the last band whose images are certified against measured data;
the trial band, which the surrogate relaxation proposes and the trust checks may reject;
the acquisition candidate, the one image whose energy and gradient the potential is asked for next.
A rejected trial must not change the accepted band. It only names the geometry to measure. Final convergence is certified from the accepted band and from forces returned by the potential, never from a trial.
What the code guarantees¶
Each rule below is stated by a comment or a test next to the symbol named in the right column.
Rule |
Where it is enforced |
|---|---|
A trial band that leaves the GP trust set is rejected, and every interior image returns to its accepted position. |
|
A joint-posterior deficit rejects the trial band and turns its selected image into an off-path energy-and-gradient acquisition. Only a resolved trial becomes the accepted band. |
|
A whole-band action that the controller stages for later measurement keeps its source band and trial positions together. |
|
The next oracle target comes from one planner with a fixed priority order. |
|
A posterior-based policy may replace only the replaceable arms of that order. |
|
Every point of an oracle step is evaluated once. A refusal on one rank reaches all ranks before values are exchanged. |
|
A refused trial point stays unmeasured and the points that returned are kept. |
|
Target selection order¶
OieOracleTargetPlanner::selectPriorityTarget returns an
OieOracleTargetDecision (image index plus an OieOracleSelectionArm). The
first rule that applies wins:
Accepted drift of kind
PredictionKernelBoundaryat an interior image: the held image itself (armPredictionKernelDrift), or the rejected proposal at that image (armRejectedProposal).The climbing image is not yet active and the variance gate is exceeded: the highest-variance image (arm
Variance).The climbing image is not yet active and the current-chain image has no oracle data: that image (arm
ActivationPriority).The convergence certificate needs current-chain data and the image clears the noise floor: arm
CurrentChainPriority, orCurrentClimbingImagewhen the image is the climbing image under convergence-only checking.A pending whole-band action, unless the sweep is frozen (arm
PSBAX).A rejected proposal at an interior image (arm
RejectedProposal).Frozen sweep: the climbing image if it lacks data, then the image with the largest variance, then the first unmeasured interior image (arm
FrozenSweep).A confident local recovery owns the replaceable work: no target (arm
None).Geometric trust-boundary drift under convergence-only checking (arm
AcceptedDrift).Convergence-only checking with an active climbing image: the climbing image if it lacks current data, then the current-chain image (arm
CertificateDeficit).The variance gate is exceeded (arm
Variance).Any other accepted drift that clears the noise floor, and a geometric trust-boundary drift without the floor test (arm
AcceptedDrift).A current-chain image without data that clears the noise floor (arm
CertificateDeficit).The climbing image without current data (arm
CurrentClimbingImage).The highest-variance image, then the first unmeasured interior image (arms
VarianceandFirstUnobserved).
The noise-floor test (clearsNoiseFloor) skips a target whose predictive
variance already sits at the likelihood floor, because a new measurement
there cannot change a certificate. The activation arm and the geometric
trust-boundary arm are exempt, as the comments in
selectPriorityTarget explain. The arms that a posterior policy may replace
are Variance, FirstUnobserved and CertificateDeficit; see
TPE acquisition for GP-OIE.
The names eval_next_i and eval_next_CI belong to the Koistinen OIE
algorithm. In the code only a comment in GPNEB.cpp mentions
eval_next_CI. The roles of the two latches are played by the
RejectedProposal and CurrentClimbingImage arms.
Formal model¶
docs/verification/gp_oie_state_machine.tla and its .cfg model the control
plane as a transition system. Geometry is reduced to an integer
accepted-band level. The phases are select, oracle, append, predict,
relax, check and done, and the model includes a four-rank MPI control
plane. The configuration uses MaxBand 2, MaxInner 2, MaxOracle 4 and
NumRanks 4. The .cfg checks these invariants and the Termination
property:
Obligation |
TLA+ invariant |
|---|---|
A failed-step target dominates the climbing-image and variance targets. |
|
Oracle and refit phases do not mutate the accepted band. |
|
A rejected trial rolls back to the pre-trial accepted band. |
|
Final convergence is certified only from the accepted band. |
|
A rejection cannot certify final convergence. |
|
All ranks have the same control phase, accepted band and training count after collectives. |
|
Each evaluated oracle slot has exactly one owner rank. |
|
The model is an abstraction of the code, not a proof about it. Its
TargetPriority has three tiers (failed step, climbing image, variance);
the planner above has more. The model does not cover kernel algebra,
floating-point behaviour, L-BFGS convergence or posterior variance formulas.
Nothing in .github/workflows runs it. The Pixi task
apalache-gp-oie-state-machine calls ${JAVA_HOME}/bin/java and the fixed
Apalache jar /usr/share/java/apalache/apalache.jar, so JAVA_HOME must name
the selected JDK and Apalache must be installed at that system-wide path.
MPI contract¶
The code follows the contract that the model states:
Every rank runs the same control flow. Decisions made on one rank, such as the chosen oracle image, the band vector or a no-oracle decision, are broadcast from the root so that all ranks agree (
gpr/neb/OieOracleConsensus.h).Oracle work is partitioned. Image \(i\) belongs to rank \(i \bmod P\) for \(P\) ranks (
ownerRankForImage), andpot::OracleBatchLayout(gpr/potentials/OracleBatch.h) shares the points of an oracle step among the ranks.After an oracle step every rank holds the owners’ energies and gradients bit for bit, at every rank count.
An oracle refusal on any rank is shared before the value exchange, so no rank waits in a collective for a rank that has left through an exception.
The consensus tests are in tests/gpr/neb/OieOracleConsensusTest.cpp. Meson
runs them through mpiexec -np 4 as test_gpneb_oie_consensus_np4, which
needs an MPI build. tests/gpr/neb/GPNEBOieTest.cpp covers the GP-OIE loop
itself.
Traces¶
Two opt-in records describe what the loop did. Neither is a controller state snapshot.
OuterIterCompositionTrace(gpr/neb/OuterIterCompositionTrace.h) records the decision state of each outer iteration: oracle target, hyperparameters, barrier estimate, convergence certificates, climbing-image index and the largest oracle force. SetGPNEBConfig::record_composition_traceand readGPNEBResult::composition_trace.OieBandTraceRecord(gpr/neb/BandTrace.h) records the band energies, posterior energy variances and NEB force norms at each recorded outer iteration.
Proposed types that do not exist¶
The earlier draft of this page proposed a type graph under
gpr::neb::oie. None of these types exists in the repository. The code
reaches the same goals with free functions and local state inside
gpNEB. The only files in gpr/neb/oie/ are AcquisitionPolicy.h and
AcquisitionPolicy.cpp.
Proposed |
What the code has instead |
|---|---|
|
The outer loop inside |
|
Local variables of |
|
|
|
|
|
|
|
The inner relaxation inside |
|
|
|
|
|
|
|
Not in the schema. GP-OIE keys live with the other NEB settings; see the configuration reference . |
|
Not in the Python package. The traces above are available from C++. |
If a future change builds the controller object model, this table is the
list of what has to move out of GPNEB.cpp. The invariants in the section
“What the code guarantees” and the TLA+ obligations are the acceptance
criteria for that move.
Open items¶
The TLA+ model is not run in CI.
The planner’s priority order has no TLA+ counterpart.
No test asserts the planner order as a whole. Single arms are covered inside
tests/gpr/neb/GPNEBOieTest.cppandtests/gpr/neb/AcquisitionPolicyTest.cpp.