Skip to main content

Crate bb_runtime

Crate bb_runtime 

Source
Expand description

bb-runtime — sans-IO engine. Hosts Node + Engine + framework primitives + role-runtime traits + syscall registration + snapshot. Consumes compiled ModelProtos from bb-compiler. Concrete components live in bb-ops.

Modules§

atomic
AtomicOpsetDecl, AtomicOpDecl, AtomicOpKind, DispatchResult. Engine-side atomic dispatch result. Catalog types (AtomicOpsetDecl, AtomicOpDecl, AtomicOpKind) live in bb_ir::atomic; re-exported here for one-import access.
bus
Typed in-Node event bus. Typed in-Node event bus. Cross-Component signaling per docs/ENGINE.md §13.1.
completion
CompletionHandle, CompletionSink, ContractResponse. CompletionHandle for async Contract methods. Implementations call [CompletionHandle::complete]; the handle routes through a [CompletionSink] (typically IngressQueue), which the engine drains on its next poll to unpark the suspended op.
component
AnyComponent, ErasedComponent, ComponentPackage, RestoreError. AnyComponent, ErasedComponent, ComponentPackage, RestoreError — the component-instance handle the engine stores and the bridge by which derives expose serialize/restore + downcast.
concrete
ConcreteComponent polymorphism contract + the ComponentHandle fn-pointer-capture wrapper. ConcreteComponent polymorphism contract + ComponentHandle fn-pointer-capture wrapper. See docs/AUTHORING_COMPONENTS.md §4 + §9.
contracts
User-facing Contract traits (Index, Backend, Aggregator, …). User-facing Contract traits — what a library maker implements when shipping a concrete component. The derives in bb-derive bridge these into the per-component dispatch_fn the engine holds.
engine
The sans-IO Engine state machine. The sans-IO Engine state machine
envelope
WireEnvelope codec; per-type decoders register through bb_ir::slot_value::register_type_node!. WireEnvelope codec
errors
Public error taxonomies. Public error taxonomies surfaced by the user-facing API.
exec_state
ExecState — per-poll execution-state bundle (frontier, slot table, pending state, scheduler, inbound contexts, monotonic ID allocator). Owned by Engine as one field. ExecState — the engine’s per-poll execution-state bundle.
fallible
try_reserve_exact wrapper at ingress boundaries so allocator failures surface as typed events. fallible::testing is a stub-allocator seam under test-components. Fallible Vec::try_reserve_exact wrapper used at engine ingress boundaries per docs/internal/superpowers/specs/2026-06-24-engine-boundary-fallibility-and-backend-owned-tensors.md §1 (Principle 1) + §2.1 sites S4 / S5.
framework
Framework primitives bundled into every RuntimeResourceRef. 9 framework primitives the engine bundles into the RuntimeResourceRef for every dispatch_atomic call per docs/ENGINE.md §10 + docs/internal/IMPLEMENTATION_PLAN.md //! lines 770-779.
ids
Engine identifier types — PeerId, NodeSiteId, OpRef, ComponentRef, ExecId, CommandId, RequestId, OpsetId, ComponentTag. Engine-internal IDs. Wire/IR IDs come from bb_ir::ids re-exported here for a single import surface.
ingress
Lock-free MPMC ingress queue. Lock-free MPMC ingress queue.
node
Public Node + lazy build chain. Node — the framework’s runtime construct, installed via [bytesandbrains::install] and driven through Node::poll.
registry
Global inventory-collected registry for custom ops. Global registries collected via inventory.
roles
The <Role>Runtime role traits. Framework-internal engine-side <Role>Runtime traits.
runtime
Runtime resource handle + ComponentTimerKind. Runtime resource handle threaded into every dispatch_atomic call.
slot_value
The universal SlotValue trait. The universal SlotValue trait — every value flowing through slot sites (DSL outputs, wire payloads, syscall returns, role-method returns) implements it via the blanket impl<T: Tensor> SlotValue and per-primitive impls.
snapshot
NodeSnapshot. NodeSnapshot
syscall
Foundation SlotValue impls - PeerIdValue, WireReqIdValue, TriggerValue, BytesValue, CommandIdValue. Foundation SlotValue impls - PeerIdValue, WireReqIdValue, TriggerValue, BytesValue, CommandIdValue. The polymorphism layer every syscall component consumes; kept in bb-runtime so components in bb-ops link against a single canonical source.
telemetry
Optional OpenTelemetry layer constructors for the engine’s tracing:: spans. Optional OpenTelemetry layer constructors for the engine’s tracing:: spans.