Native ABIs, Rust crates and data formats

This page lists the native libraries GPRidge calls through C interfaces, the C interfaces it exposes for plugins, the one Rust crate in the tree, and the file formats it reads and writes. The stamp checks and their messages are on Native library ABI checks. The C API of libgpridge itself is on the C API page.

Reference

Native libraries called through C ABIs

Library

Used for

Checked

rgmin

minimisers behind the hyperparameter fit, lowest eigenpair

major 1, minor 43 or later at compile time; header and loaded stamps at start

readcon-core

.con input and output

header and loaded stamps at start

readcon-db

observation archive (LMDB-backed CON frames), dimer trace corpus

header and loaded stamps at start

rgpot-core

potentials

header and loaded stamps at start, when the build has rgpot.h

rgsaddle

band and saddle sessions, the index-1 test of a converged saddle

major 1, minor 71 or later; the library is linked at build time

anneal, minimage

box-ensemble stage, minimum-image distances

through their C headers (anneal-core.h, the mi_* functions)

The libraries are Meson subprojects pinned in subprojects/*.wrap. rgsaddle is linked (ABI major 1, minor 71 or later). RgsaddleClient::load checks that stamp. gprn --rgsaddle-library and RGSADDLE_LIBRARY store the index-test selection. The linked library runs the test.

Rust crate

rust/gpridge-sys is a -sys crate: bindgen generates the declarations from gpr/capi/gpridge_c.h and the crate links the installed libgpridge. It does not build the C++ core and does not call gpr_abi_check itself, so a program that uses it calls that function once at start. The crate is described on the Rust page. A CI job runs its test; no job publishes it.

Plugin ABIs gpridge implements

ABI

Symbols

Version

Errors

rgpot engine (libgpr_engine)

rgpot_engine_*

rgpot_engine_abi_version() returns 1; rgpot_engine_abi_stamp() returns 1.11, layout revision 1

0 success, positive recoverable, negative fatal; RGPOT_ENGINE_ERR_LOCK (-2) is fatal

Training product

gpr_training_product_*_v1

_v1 suffix

status plus caller-supplied message buffer

stdpar environment kernels

gpr_stdpar_environment_*_v1

_v1 suffix

status plus caller-supplied message buffer

libgpr_engine puts the learning GP behind the generic rgpot engine C ABI, so that eOn and ASE can hold the surrogate as an ordinary potential (comment at the target in meson.build). It checks an AOTInductor model package against the host CPU when it is created. The units are Angstrom for positions, eV for energy and eV/Angstrom for forces (rgpot_engine_c_abi.h). The base symbols are rgpot_engine_abi_version, _available, _create, _destroy and _force. eOn’s loader resolves four of them (rgpot_engine_abi_version, _create, _destroy, _force). The library also exports rgpot_engine_abi_stamp, which returns ABI 1.11, layout revision 1, the stamp of the header copy (RgpotEngineAbiStamp.cc). The engine loader of the pinned rgpot reads that fifth symbol. It accepts major 1 and layout revision 1 when the plugin minor is at most the host minor (11). A library without the symbol is served as 1.0, layout revision 1, without the later optional symbols. A newer minor, for example “engine ABI stamp 1.12 (layout 1) cannot serve host stamp 1.11 (layout 1)”, or a different major or layout, is refused. gpr/potentials/EnginePotential.cpp reads that stamp with the same rule. Minor 7 adds rgpot_engine_unload_policy. Minor 11 adds rgpot_engine_set_cache, rgpot_engine_cache_counts, rgpot_engine_taylor_jet, RgpotEngineDerivativeReport and the trailing RgpotEngineCaps.jet_order field. The host reads jet_order only when the plugin’s caps size covers it, calls rgpot_engine_hvp only when analytic_hvp is set, and honours the unload policy only from minor 7. GprEngineLoaderContractTest.cpp fails when the library drops one of the five symbols or reports another stamp. _force_batch, _model_state, _set_callbacks, _hint and _neighbor_options are optional; a host finds them with dlsym.

A training-product library is what --training-product-library PATH loads; libgpr_scheme2_product is the in-tree implementation over the CPU Scheme II engines. Symbols outside these sets are hidden. See Training matrix products for the products and Use an rgpot engine plugin for the engine plugins that gprn and gprd load.

Data formats

Format

Written by

Read back by

Test

.con multi-frame file

gprn --write-con, --trace-con; the Python NEB export

readcon-core

test_readcon_loader, python/tests/test_neb_con_roundtrip.py

Observation archive

every oracle call, with --gp-observation-archive auto (the default)

readcon-db, per-image model selection

the archive cases in tests/gpr/neb/GPNEBSessionTest.cpp

HDF5 band file

gprn --output (default gpr_neb_out.h5); the dimer’s HDF5 trace

HDF5, h5py, scripts/inspect_neb_band.py

test_h5_dump

The observation archive needs a readcon-db build; without one, gprn exits with status 2 unless the option is off (help text of the option). The dimer’s trajectory corpus (gprd --gp-dimer-trace) is also a readcon-db corpus.

The band itself is readcon output: gprn --write-con frames with energies and forces, the run summary on the first frame under neb_summary, the same frames in the .corpus beside it, and the training set in the observation archive. gprn --output holds the per-outer GP trace by default (root attribute schema = gprn-gp-trace/2, /trace/<outer>/ with band energies, measured mask, NEB force norms, acquisition variance, hyperparameters and oracle calls; global_gp/ only with --trace-band-history true), no file with --gp-trace false, and --full-h5 true writes the whole band in the shared NEB band layout instead (schema = neb-band/1): /path/{images, gradients} as (n_images, 3N), /path/{energies,f_para,rxn_coord}, /metadata/{atomic_numbers,cell,converged,oracle_calls,max_energy_image}, 2-D /training/, /summary/ and /trace/, every row a whole structure. Files of older runs carry /converged/<image>/ instead; only readers read that layout. test_h5_dump writes nested 1-D and 2-D datasets, an integer dataset and the schema attribute, reads them back through the HDF5 C API bit for bit, and checks that a rewrite replaces one dataset and keeps the others.

The command line as an interface

gprn takes every option on the command line, and --dump-cli-args prints the resolved values. gprd has no --dump-cli-args; it exits with “unrecognized option”. The CLI reference is generated from the option tables. gprn --config reads options from TOML or a Cap’n Proto message (schema page).