pub trait NodeRegistry: Send + Sync {
// Required methods
fn node_meta(&self, node_id: &str) -> Option<NodeMeta>;
fn config_hash(&self, node_id: &str) -> Option<CacheKey>;
// Provided method
fn meta(&self, node_id: &str) -> Option<FilterMeta> { ... }
}Expand description
Registry that maps node IDs to their metadata.
The compiler needs metadata (cacheable, differentiable, schemas) but
not the implementations behind it. One required accessor, answering
for both kinds of node: an optional step_meta alongside a required
meta is how half the schema validation came to be skipped by
whichever registry forgot to override it.
Required Methods§
Sourcefn node_meta(&self, node_id: &str) -> Option<NodeMeta>
fn node_meta(&self, node_id: &str) -> Option<NodeMeta>
A node’s contract — schemas, cacheability, effectfulness — whichever
kind it is. None means the graph names a node nobody registered,
which the compiler reports rather than guesses around.
Sourcefn config_hash(&self, node_id: &str) -> Option<CacheKey>
fn config_hash(&self, node_id: &str) -> Option<CacheKey>
The node’s configuration identity, folded into cache keys. Required rather than derived because only the registry knows how a node’s configuration is canonicalized (Rust: canonical CBOR of fields; Python: qualname + config + source hash).
Provided Methods§
Sourcefn meta(&self, node_id: &str) -> Option<FilterMeta>
fn meta(&self, node_id: &str) -> Option<FilterMeta>
The computational view, for the phases that only make sense for a filter: gradient flow, differentiable collapsing.
None for an effectful node — deliberately. Those phases ask
“should a gradient pass through here”, and the answer for a step
is not “no, and warn about it” but “the question does not apply”.