bb_dsl/recorded.rs
1//! `RecordedModule` - the compiler's input type.
2//!
3//! Bundles the recorded `FunctionProto` body. Per the chosen-path
4//! install contract, the IR carries no concrete instance state —
5//! install constructs every concrete via the inventory's
6//! `construct_fn`, so the recorder doesn't capture
7//! `(serialize_fn, restore_fn)` side tables.
8
9use bb_ir::proto::onnx::FunctionProto;
10
11/// Hand-off bundle between the DSL `Graph` (recording surface) and
12/// the compiler (consumer).
13#[derive(Debug, Default)]
14pub struct RecordedModule {
15 /// The root recorded FunctionProto body. Top-level
16 /// `with_module(self.name(), …)` wraps fold into this entry.
17 pub function: FunctionProto,
18
19 /// Sub-functions created by nested `with_module(name, …)`
20 /// calls. Each becomes its own FunctionProto in the compiled
21 /// `ModelProto.functions[1..]` so the compiler + runtime can
22 /// chase them via `ai.bytesandbrains.module` CALL NodeProtos
23 /// emitted in `function` (or in other sub-functions).
24 pub sub_functions: Vec<FunctionProto>,
25}