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 inbb_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.CompletionHandlefor async Contract methods. Implementations call [CompletionHandle::complete]; the handle routes through a [CompletionSink] (typicallyIngressQueue), 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
ConcreteComponentpolymorphism contract + theComponentHandlefn-pointer-capture wrapper.ConcreteComponentpolymorphism contract +ComponentHandlefn-pointer-capture wrapper. Seedocs/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 inbb-derivebridge these into the per-componentdispatch_fnthe engine holds. - engine
- The sans-IO Engine state machine. The sans-IO Engine state machine
- envelope
WireEnvelopecodec; per-type decoders register throughbb_ir::slot_value::register_type_node!.WireEnvelopecodec- 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 byEngineas one field.ExecState— the engine’s per-poll execution-state bundle.- fallible
try_reserve_exactwrapper at ingress boundaries so allocator failures surface as typed events.fallible::testingis a stub-allocator seam undertest-components. FallibleVec::try_reserve_exactwrapper used at engine ingress boundaries perdocs/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 theRuntimeResourceReffor everydispatch_atomiccall perdocs/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 frombb_ir::idsre-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 throughNode::poll. - registry
- Global inventory-collected registry for custom ops.
Global registries collected via
inventory. - roles
- The
<Role>Runtimerole traits. Framework-internal engine-side<Role>Runtimetraits. - runtime
- Runtime resource handle +
ComponentTimerKind. Runtime resource handle threaded into everydispatch_atomiccall. - slot_
value - The universal
SlotValuetrait. The universalSlotValuetrait — every value flowing through slot sites (DSL outputs, wire payloads, syscall returns, role-method returns) implements it via the blanketimpl<T: Tensor> SlotValueand per-primitive impls. - snapshot
NodeSnapshot.NodeSnapshot- syscall
- Foundation
SlotValueimpls -PeerIdValue,WireReqIdValue,TriggerValue,BytesValue,CommandIdValue. FoundationSlotValueimpls -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’stracing::spans.