ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
reusex::vision::sam3::EngineBuildProfiles Struct Reference

The full set of per-engine build recipes. More...

#include <EngineBuildProfiles.hpp>

Collaboration diagram for reusex::vision::sam3::EngineBuildProfiles:

Public Member Functions

std::string to_json () const
 Serialize back to engine-build.json form (no _comment).
std::optional< EngineProfile > find (const std::string &engine_name) const
 Look up one engine's recipe, or std::nullopt if absent.

Static Public Member Functions

static EngineBuildProfiles from_file (const std::filesystem::path &path)
 Parse engine-build.json from disk.
static EngineBuildProfiles from_string (const std::string &json_text)
 Parse from an in-memory JSON string (used by tests).
static const EngineBuildProfiles & builtin ()
 The canonical recipe (python/reusex_sam3/engine-build.json) embedded at build time.

Public Attributes

int schema_version = 1
int recipe_version = 1
 Revision of the recipe's contents (recipe_version, absent ⟹ 1).
std::map< std::string, EngineProfile > engines
std::vector< std::string > fallback_engines
 Only in an engine directory's stamp: the engines that were built with text_only_fallback() instead of their profile in engines (their geometry-prompt profile failed with a shape error).
std::map< std::string, std::string > fallback_onnx_sha256
 Only in a stamp, next to fallback_engines: the sha256 of each fallback engine's ONNX at the time its profile failed.

Detailed Description

The full set of per-engine build recipes.

Definition at line 61 of file EngineBuildProfiles.hpp.

Member Function Documentation

◆ builtin()

const EngineBuildProfiles & reusex::vision::sam3::EngineBuildProfiles::builtin ( )
static

The canonical recipe (python/reusex_sam3/engine-build.json) embedded at build time.

The fallback when an ONNX directory does not ship its own engine-build.json (a bare make -C python export does not).

◆ find()

std::optional< EngineProfile > reusex::vision::sam3::EngineBuildProfiles::find ( const std::string & engine_name) const
nodiscard

Look up one engine's recipe, or std::nullopt if absent.

◆ from_file()

EngineBuildProfiles reusex::vision::sam3::EngineBuildProfiles::from_file ( const std::filesystem::path & path)
static

Parse engine-build.json from disk.

Throws std::runtime_error on a missing file, malformed JSON, or an unsupported schema version.

◆ from_string()

EngineBuildProfiles reusex::vision::sam3::EngineBuildProfiles::from_string ( const std::string & json_text)
static

Parse from an in-memory JSON string (used by tests).

◆ to_json()

std::string reusex::vision::sam3::EngineBuildProfiles::to_json ( ) const
nodiscard

Serialize back to engine-build.json form (no _comment).

Used to stamp an engine directory with the recipe its engines were built from.

Member Data Documentation

◆ engines

std::map<std::string, EngineProfile> reusex::vision::sam3::EngineBuildProfiles::engines

Definition at line 67 of file EngineBuildProfiles.hpp.

◆ fallback_engines

std::vector<std::string> reusex::vision::sam3::EngineBuildProfiles::fallback_engines

Only in an engine directory's stamp: the engines that were built with text_only_fallback() instead of their profile in engines (their geometry-prompt profile failed with a shape error).

Serialized as fallback_engines, and only when non-empty.

Definition at line 72 of file EngineBuildProfiles.hpp.

◆ fallback_onnx_sha256

std::map<std::string, std::string> reusex::vision::sam3::EngineBuildProfiles::fallback_onnx_sha256

Only in a stamp, next to fallback_engines: the sha256 of each fallback engine's ONNX at the time its profile failed.

Together with the stamped profile in engines it makes the fallback permanent: the profile is retried only when the recipe or the ONNX changed (sam3::fallback_engines_to_retry). Serialized as fallback_onnx_sha256 (name -> hex digest), only when non-empty; a stamp without it (written before fingerprints existed) is retried once and then fingerprinted.

Definition at line 80 of file EngineBuildProfiles.hpp.

◆ recipe_version

int reusex::vision::sam3::EngineBuildProfiles::recipe_version = 1

Revision of the recipe's contents (recipe_version, absent ⟹ 1).

Bumped by build_engines.py whenever a profile changes, so a newer built-in recipe can supersede the one an older model bundle shipped.

Definition at line 66 of file EngineBuildProfiles.hpp.

◆ schema_version

int reusex::vision::sam3::EngineBuildProfiles::schema_version = 1

Definition at line 62 of file EngineBuildProfiles.hpp.


The documentation for this struct was generated from the following file: