Expand description
bb-ops — every concrete component the framework ships.
Each component lives in one file colocating IR identity (re-exports
from bb_ir::syscall_ids), DSL helper, runtime invoke, and
inventory::submit! self-registration.
Re-exports§
Modules§
- aggregators
- Concrete
AggregatorContract implementations the framework ships out of the box. Each impl bridges the user-facingbb_runtime::contracts::Aggregatortrait to the engine’sdispatch_atomicpath through thebb_derive::Aggregatormacro and self-registers viainventory::submit!. - 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.- backends
- Concrete backend implementations. Each backend (cpu, cuda, …)
is one self-contained unit under
bb_ops::backends::<name>. - 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 — canonical home inbb-runtime::concrete. This module re-exports the type for authoring ergonomics sobb_dsl::concrete::ConcreteComponentkeeps resolving.- 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
- graph
- Recording context wrapping the in-progress
FunctionProto. The proto is the IR — semantic BB attributes ride on proto fields, not a parallel Rust shadow store. Seedocs/IR_AND_DSL.md§2. - 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. - 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. - module
- The
Moduletrait.Module::build()produces one pre-compileModelProtowherefunctions[0]is the top-level body andfunctions[1..]are composed sub-Modules (deduped byname()). - network
- Network components -
wire.Send+wire.Recv(the transport primitives). Each component self-registers viainventory::submit!. - output
- Non-generic
Outputhandle threaded through DSL method chains. - placeholders
- Role-method dispatch slot placeholders. Each
*Slotunit struct is a generic slot bound at compile time viaCompiler::new().bind_<role>::<T>("slot"). DSL methods record NodeProtos stamped with(required_trait, slot_id)for binding-resolution routing. - proto
- Prost-generated proto bindings.
- protocols
- Protocol implementations -
<Role>Runtimebridges for concrete coordination protocols. Each lives in a sub-directory and self-registers viainventory::submit!per the standard component-authoring contract. - 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. - syscall_
ids - Syscall identifier string constants — the IR-level contract between compiler (gate emission) and runtime (dispatch).
- syscalls
- Framework syscall components - each sub-directory hosts one or
more registerable ops. Self-registration is via
inventory::submit!;Engine::register_all_framework_syscallswalks the registry at Node::ensure_ready. - tensor
- Tensor + Scalar abstractions. The framework crate ships no concrete tensor type; backends implement these traits over their own storage of choice.
- 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. - wire
- Wire codec hash helper.
Functions§
- link_
force - Anchor every
inventory::submit!{}block against linker DCE. New components must add ablack_box(...)line; thetests/component_authoring.rsassertion catches omissions.