Skip to main content

Crate bb_ops

Crate bb_ops 

Source
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§

pub use bb_ir::bincode;
pub use bb_ir::inventory;

Modules§

aggregators
Concrete Aggregator Contract implementations the framework ships out of the box. Each impl bridges the user-facing bb_runtime::contracts::Aggregator trait to the engine’s dispatch_atomic path through the bb_derive::Aggregator macro and self-registers via inventory::submit!.
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.
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. 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 — canonical home in bb-runtime::concrete. This module re-exports the type for authoring ergonomics so bb_dsl::concrete::ConcreteComponent keeps 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 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
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. See docs/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 from bb_ir::ids re-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 Module trait. Module::build() produces one pre-compile ModelProto where functions[0] is the top-level body and functions[1..] are composed sub-Modules (deduped by name()).
network
Network components - wire.Send + wire.Recv (the transport primitives). Each component self-registers via inventory::submit!.
output
Non-generic Output handle threaded through DSL method chains.
placeholders
Role-method dispatch slot placeholders. Each *Slot unit struct is a generic slot bound at compile time via Compiler::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>Runtime bridges for concrete coordination protocols. Each lives in a sub-directory and self-registers via inventory::submit! per the standard component-authoring contract.
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.
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_syscalls walks 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!. The Lattice is built once at startup; is_subtype_of walks 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 a black_box(...) line; the tests/component_authoring.rs assertion catches omissions.