pub struct ArchitectureFingerprint {
pub digest: String,
pub nodes: BTreeMap<String, String>,
pub edges: Vec<EdgeRef>,
pub n_nodes: usize,
pub n_edges: usize,
pub node_config: BTreeMap<String, String>,
}Expand description
Structural identity of a graph, exact and fuzzy.
Written to fingerprint.json in every tracked run directory and
copied into the ExperimentRecord so the pool can rank past work by
architectural resemblance without re-reading any graph.
Fields§
§digest: StringHex SHA-256 of the canonical form — exact, id-sensitive.
nodes: BTreeMap<String, String>Node id → type token, in id order. Keeping the ids is what lets two fingerprints be diffed (which node was swapped) and not only compared; the token bags below deliberately drop them.
edges: Vec<EdgeRef>Every edge as (source id, target id, kind), sorted.
n_nodes: usizeNode count — cheap size signal for ranking without opening nodes.
n_edges: usizeEdge count — same role as n_nodes.
node_config: BTreeMap<String, String>Per-node filter config hash, keyed by node id. Empty unless the caller had a filter registry to hand (soma-core has no access to filter instances; the Python binding fills this in at run start).
Implementations§
Source§impl ArchitectureFingerprint
impl ArchitectureFingerprint
Sourcepub fn of(graph: &Graph) -> Result<Self>
pub fn of(graph: &Graph) -> Result<Self>
Fingerprint graph. Errors only if the canonical form is not
serializable, which for a Graph means a bug, not bad input.
Sourcepub fn with_node_config(self, node_config: BTreeMap<String, String>) -> Self
pub fn with_node_config(self, node_config: BTreeMap<String, String>) -> Self
Attach per-node config hashes (node id → hex hash).
Sourcepub fn node_tokens(&self) -> Vec<String>
pub fn node_tokens(&self) -> Vec<String>
One type token per node, sorted, duplicates kept (two scalers are structurally different from one). Carries no node ids, so it survives renaming — the fuzzy half of the fingerprint.
Sourcepub fn edge_tokens(&self) -> Vec<String>
pub fn edge_tokens(&self) -> Vec<String>
One sourceToken>targetToken token per edge (~> for control
edges), sorted, duplicates kept. Also id-free.
Trait Implementations§
Source§impl Clone for ArchitectureFingerprint
impl Clone for ArchitectureFingerprint
Source§fn clone(&self) -> ArchitectureFingerprint
fn clone(&self) -> ArchitectureFingerprint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ArchitectureFingerprint
impl Debug for ArchitectureFingerprint
Source§impl Default for ArchitectureFingerprint
impl Default for ArchitectureFingerprint
Source§fn default() -> ArchitectureFingerprint
fn default() -> ArchitectureFingerprint
Source§impl<'de> Deserialize<'de> for ArchitectureFingerprint
impl<'de> Deserialize<'de> for ArchitectureFingerprint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ArchitectureFingerprint
impl PartialEq for ArchitectureFingerprint
Source§fn eq(&self, other: &ArchitectureFingerprint) -> bool
fn eq(&self, other: &ArchitectureFingerprint) -> bool
self and other values to be equal, and is used by ==.