Skip to main content

Module builtins

Module builtins 

Source
Expand description

Built-in TypeNode constants the framework + DSL ship out of the box.

Every framework primitive’s type is listed here and submitted to the inventory so the super::Lattice picks it up at startup. Custom application or library types follow the same pattern from any downstream crate.

Statics§

TYPE_ADDRESS_VEC
Concrete Vec<Address> - the ordered local-or-peer address list stamped on every wire.Send envelope, the carrier for the local address bag installed by bb::install, and the payload shape for the multi-address AddressBook syscalls. Distinct wire hash from TYPE_MULTIADDRESS so receivers can disambiguate single vs many.
TYPE_ANY
The universal supertype. Every other type is a (transitive) subtype of Any. Used as a port bound when no narrower constraint applies.
TYPE_BYTES
Concrete Bytes - opaque byte buffer.
TYPE_COMPOSITE
Concrete Composite - envelope holding N typed child payloads, each tagged with its source type_hash and bincode-encoded bytes. The DSL g.bundle recorder produces this on the output of a Bundle op; the matching Unbundle op decomposes it back into per-child BytesValue outputs whose ValueInfoProto.denotation is stamped from the declared child-type list. Parent is Any because a composite can wrap any wire-eligible child types.
TYPE_MULTIADDRESS
Concrete Multiaddress - sequence of typed protocol segments describing a delivery path. The framework’s canonical address type; binds to framework::Address in bb-runtime. Lives directly under Any (no abstract address parent — there is no second address-shaped concrete). The 0x03xx wire-hash range is reserved for address-related leaves.
TYPE_PEER_ID
Concrete PeerId - canonical peer identifier (multihash).
TYPE_PEER_ID_VEC
Concrete Vec<PeerId> - fan-out destination list for g.net_out.
TYPE_SCALAR
Abstract Scalar - matches any Scalar<T> concrete leaf.
TYPE_SCALAR_F16
Concrete Scalar<F16> - single f16 value.
TYPE_SCALAR_F32
Concrete Scalar<F32> - single f32 value.
TYPE_SCALAR_F64
Concrete Scalar<F64> - single f64 value.
TYPE_SCALAR_I32
Concrete Scalar<I32> - single i32 value.
TYPE_SCALAR_U8
Concrete Scalar<U8> - single u8 value.
TYPE_TENSOR
Abstract Tensor - matches any Tensor<T> concrete leaf.
TYPE_TENSOR_BF16
Concrete Tensor<BF16> - dense bfloat16 tensor. Modern ML mixed-precision standard. Stored as half::bf16 (binary newtype around the 16-bit bfloat bit pattern).
TYPE_TENSOR_BOOL
Concrete Tensor<Bool> - dense bool tensor. Masks, predicates, comparison-op results.
TYPE_TENSOR_F16
Concrete Tensor<F16> - dense f16 tensor.
TYPE_TENSOR_F32
Concrete Tensor<F32> - dense f32 tensor.
TYPE_TENSOR_F64
Concrete Tensor<F64> - dense f64 tensor.
TYPE_TENSOR_I8
Concrete Tensor<I8> - dense i8 tensor. Edge quantization (the positional reason this is shipping as a v1 type, not a future feature: edge ML without int8 isn’t really edge ML).
TYPE_TENSOR_I16
Concrete Tensor<I16> - dense i16 tensor. Wider-than-byte quantization slots, audio samples.
TYPE_TENSOR_I32
Concrete Tensor<I32> - dense i32 tensor.
TYPE_TENSOR_I64
Concrete Tensor<I64> - dense i64 tensor. Index / embedding lookups (the canonical ‘Int’ kind default for most Burn underlying backends).
TYPE_TENSOR_U8
Concrete Tensor<U8> - dense u8 tensor.
TYPE_TENSOR_U16
Concrete Tensor<U16> - dense u16 tensor. Image bit-depth, count types.
TYPE_TENSOR_U32
Concrete Tensor<U32> - dense u32 tensor. Hash buckets, large counts.
TYPE_TENSOR_U64
Concrete Tensor<U64> - dense u64 tensor. Wide indices, IDs.
TYPE_TRIGGER
Concrete Trigger - zero-payload signal value.
TYPE_WIRE_REQ_ID
Concrete WireReqId - correlation token returned by g.net_out.

Functions§

lookup_denotation
Map a canonical denotation string to the corresponding TypeNode static. Returns None for denotations the framework doesn’t recognize; the solver leaves those values at TYPE_ANY (custom types can declare their own type_relations to seed concrete types).