Bertini 2 d882924 (2026-10-06 19:56 UTC)
Numerical algebraic geometry library (C++ core)
Loading...
Searching...
No Matches
config_encoding.hpp File Reference

Canonical exact encoding + persistent digests for configuration structs (ADR-0043; the structured-output-directory arc, rung 1). More...

Include dependency graph for config_encoding.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  bertini
namespace  bertini::records

Functions

std::string bertini::records::CanonicalName (tracking::Predictor p)
 The fixed canonical name of a predictor choice (never its numeric value).
std::string bertini::records::CanonicalName (algorithm::classic::AlgoChoice a)
 The fixed canonical name of an algorithm (track-type) choice.
std::string bertini::records::CanonicalName (algorithm::classic::EndgameChoice e)
 The fixed canonical name of an endgame choice.
std::string bertini::records::CanonicalEncoding (tracking::SteppingConfig const &c)
 Canonical encoding of stepping settings.
std::string bertini::records::CanonicalEncoding (tracking::NewtonConfig const &c)
 Canonical encoding of Newton-corrector settings.
std::string bertini::records::CanonicalEncoding (tracking::FixedPrecisionConfig const &c)
 Canonical encoding of fixed-precision settings.
std::string bertini::records::CanonicalEncoding (tracking::AdaptiveMultiplePrecisionConfig const &c)
 Canonical encoding of adaptive-multiple-precision settings.
std::string bertini::records::CanonicalEncoding (tracking::Predictor p)
 Canonical encoding of a predictor choice (as a one-field pseudo-config).
std::string bertini::records::CanonicalEncoding (tracking::TrackerConfig const &c)
 Canonical encoding of the tracker's own settings (predictor and its two thresholds).
std::string bertini::records::CanonicalEncoding (endgame::SecurityConfig const &c)
 Canonical encoding of endgame security (divergence-bailout) settings.
std::string bertini::records::CanonicalEncoding (endgame::EndgameConfig const &c)
 Canonical encoding of common endgame settings.
std::string bertini::records::CanonicalEncoding (endgame::PowerSeriesConfig const &c)
 Canonical encoding of power-series-endgame settings.
std::string bertini::records::CanonicalEncoding (endgame::CauchyConfig const &c)
 Canonical encoding of Cauchy-endgame settings.
std::string bertini::records::CanonicalEncoding (endgame::TrackBackConfig const &c)
 Canonical encoding of track-back endgame settings.
std::string bertini::records::CanonicalEncoding (algorithm::TolerancesConfig const &c)
 Canonical encoding of Newton/path tolerances.
std::string bertini::records::CanonicalEncoding (algorithm::MidPathConfig const &c)
 Canonical encoding of midpath (path-crossing check) settings.
std::string bertini::records::CanonicalEncoding (algorithm::AutoRetrackConfig const &c)
 Canonical encoding of crossed-path auto-retrack settings.
std::string bertini::records::CanonicalEncoding (algorithm::SharpeningConfig const &c)
 Canonical encoding of solution-sharpening settings.
std::string bertini::records::CanonicalEncoding (algorithm::RegenerationConfig const &c)
 Canonical encoding of regeneration settings.
std::string bertini::records::CanonicalEncoding (algorithm::PostProcessingConfig const &c)
 Canonical encoding of post-processing (classification) settings.
std::string bertini::records::CanonicalEncoding (algorithm::ZeroDimConfig const &c)
 Canonical encoding of top-level zero-dim solve settings.
std::string bertini::records::CanonicalEncoding (algorithm::MetaConfig const &c)
 Canonical encoding of the algorithm (track-type) selection.
std::string bertini::records::CanonicalEncoding (algorithm::classic::EndgameChoiceConfig const &c)
 Canonical encoding of the endgame selection.
template<typename ConfigT>
detail::Digest256 bertini::records::ConfigDigest (ConfigT const &config)
 The persistent digest of one configuration: SHA-256 over its versioned canonical encoding.
template<typename... ConfigTs>
detail::Digest256 bertini::records::SettingsDigest (ConfigTs const &... configs)
 One digest for a solver's FULL settings: the versioned concatenation of several configs' canonical encodings, in the order given.
std::string bertini::records::ConfigTextAsJson (std::string const &canonical_text, std::string const &digest_hex)
 Render one or more canonical config encodings as pretty JSON, for archiving in a structured output directory.

Variables

constexpr char bertini::records::ConfigEncodingVersion [] = "b2cfgenc/4"
 The version tag baked into every config digest; bump on any encoding change.

Detailed Description

Canonical exact encoding + persistent digests for configuration structs (ADR-0043; the structured-output-directory arc, rung 1).

A solver's settings are half of a computation's ask identity: records reference the configuration a path was tracked under by digest, so equal settings must digest equally FOREVER – across runs, compilers, machines, and versions. Hence the same rules as the System encoding (ADR-0042):

  • versioned header (b2cfgenc/4) baked into every digest – a spec change is a new keyspace, never silent drift. A spec change is not only an encoder's output: WHICH configs a solver folds into its settings text is equally part of the identity, and changing that set bumps the version too (b2cfgenc/4 added MidPathConfig, which governs path-crossing detection and had been left out). The version registry hashes the encoders, so it does not see a composition change; the solver's own test does (the_settings_text_lists_every_config_the_solve_reads);
  • exact values only: doubles encode as their IEEE-754 bit pattern (d64:<16 hex>), NEVER decimal round-trips; rationals via exact .str(); enums via fixed string tables (never numeric values or typeid); strings as netstrings;
  • one encoder per struct, listing fields by name in declaration order. Adding a field to a config struct REQUIRES extending its encoder (and bumping b2cfgenc if the change is identity-affecting) – the golden fixture in config_digest_test.cpp fails loudly otherwise, and the append-only version registry (config_encoding_versions.txt, one keyspace hash per version ever used) fails if the encoding changes without the bump.

Deliberately excluded from encoding: algorithm::RandomConfig (the seed is its own slot in the ask identity, beside the config digest – never inside it) and the transient ZeroDimConfig::num_threads / ZeroDimConfig::recall (thread count and recall-vs-retrack change only whether/how the work runs, not what is computed).