Expand description
Foundation IR crate. Hosts prost-generated ONNX + bb.core
bindings and the cross-crate types every other crate depends on:
ids—PeerId,NodeSiteId,OpRef,ComponentRef,ExecId,CommandId,RequestId.wire—TypeNodedenotations + canonical statics.tensor—Scalar,Tensortraits +Dense<T>storage.slot_value— universalSlotValuetrait.atomic—AtomicOpsetDecl,AtomicOpDecl,AtomicOpKind.
Re-exports§
pub use tensor_primitives::opset_covers_primitives;pub use tensor_primitives::MissingPrimitives;pub use tensor_primitives::TENSOR_PRIMITIVES_DOMAIN;pub use tensor_primitives::TENSOR_PRIMITIVES_OPS;pub use tensor_primitives::TENSOR_PRIMITIVES_VERSION;pub use inventory;pub use bincode;
Modules§
- atomic
- Atomic-op opset declaration types. Returned from
<Role>Runtime::atomic_opset(); engine-sideDispatchResultlives inbb_runtime::atomicbecause it carriesCommandId. - component
- Foundation polymorphism plumbing shared by
bb-dsl(authoring) andbb-runtime(dispatch). - ids
- Wire-format and compiler-bound identifier types.
- keys
- Single source of truth for metadata-key string constants shared
across DSL → Compiler → Runtime. Reference these constants rather
than re-typing
"ai.bytesandbrains.*"literals. - peer_
class - Peer-class metadata for partitioning by “what kind of Node does
this op run on.”
PEER_CLASS_KEYtagsOutput<PeerId>producers;HOME_CLASS_KEYtags each NodeProto with the class of Node it runs on (stamped byinfer_peer_classes). - proto
- Prost-generated proto bindings.
- registry
- Concrete-component inventory registry. Derive macros submit
per-type entries; the linker preserves them if the type is
referenced. Custom-op registry lives in
bb_runtime::registry. - slot_
value - Universal slot value trait. The blanket impl is the only path,
so anything
Any + Send + Sync + Clone + Serialize + DeserializeOwnedis aSlotValueby construction. Type identity per slot rides onValueInfoProto.type_node; consumers downcast to the graph-guaranteed concrete type. - syscall_
ids - Syscall identifier string constants — the IR-level contract between compiler (gate emission) and runtime (dispatch).
- tensor
- Tensor + Scalar abstractions. The framework crate ships no concrete tensor type; backends implement these traits over their own storage of choice.
- tensor_
primitives - The framework’s curated floor of primitive tensor ops.
- types
- Hierarchical type system resolved at compile time by the
compiler’s TypeSolver. The tree is open via inventory: backends
and DSL authors register new leaves via
inventory::submit!. TheLatticeis built once at startup;is_subtype_ofwalks the parent chain with caching. The runtime never sees abstract types. - verify
- IR well-formedness checkers run between compiler passes. Each
function is a pure check returning
Result<(), VerifyError>; the compiler invokes them at the per-pass seams described indocs/COMPILER.md. - version
- Framework-wide version constants.
- wire
- Wire codec hash helper.
- wire_
shape - Canonical Send / Recv NodeProto shape — the contract every wire-IR-touching pass + runtime gate agrees on.
Macros§
- register_
charged_ bytes - Register a carrier’s wire-byte resolver.
- register_
type_ node - Register a concrete type’s lattice
TypeNode+ wire decoder. Emits both aRuntimeTypeBindingand aWireDecoderBinding. Unregistered types resolve tocrate::types::TYPE_ANYand their wire payloads cannot be decoded.