pub enum CompileError {
Show 29 variants
Validation(ValidationError),
ExpansionFailed {
op_type: String,
domain: String,
reason: String,
},
RoleMethodFailed {
slot: String,
op_type: String,
source: String,
},
AmbiguousRole {
role: String,
concrete_type: String,
generic_slot_id: u32,
},
UnresolvedPeerClass {
node_name: String,
peer_input: String,
},
CrossClassDataflow {
node_name: String,
home_a: String,
home_b: String,
},
IrVersionMismatch {
expected: u32,
got: u32,
},
MissingBinding {
slot: String,
site: String,
},
EmptyFunctionTable,
RuntimeIncomplete {
missing: String,
},
Internal {
detail: String,
},
TypeConstraintFailed {
op: String,
detail: String,
},
UnresolvedType {
value: String,
},
UnboundDependency {
component: String,
bound_at_slot: String,
required_role: String,
required_slot: String,
},
UnknownPort {
module: String,
port: String,
},
PortUnwired {
module: String,
port: String,
direction: String,
},
NetworkOpNotAtBoundary {
module: String,
op_id: String,
},
InvalidSlotId {
node: String,
value: String,
},
UnknownSlotId {
node: String,
slot_id: u32,
},
UnknownRoleRuntime {
node: String,
role: String,
},
MissingCodecPortMetadata {
node: String,
},
InvalidCodecPort {
node: String,
value: String,
},
AmbiguousRoleBinding {
role: String,
slot_names: Vec<String>,
},
MissingRequiredTraitMetadata {
node: String,
},
DependencyRoleMismatch {
component: String,
bound_at_slot: String,
required_role: String,
required_slot: String,
provided_role: String,
},
UnboundSlot {
role: String,
source: SlotSource,
},
BootstrapCompositionGap {
caller: String,
target: String,
},
BootstrapCompositionCycle {
involves: Vec<String>,
},
IncompatibleStorageOnEdge {
src: String,
dst: String,
expected_id: &'static str,
actual_id: &'static str,
},
}Expand description
Errors surfaced by any compiler pass beyond validate.
Variants§
Validation(ValidationError)
Wrapped ValidationError from the structural validate pass.
ExpansionFailed
expand_ops failed for a specific op.
Fields
RoleMethodFailed
runtime.<op>() returned an error during role-method
inlining.
Fields
AmbiguousRole
A concrete impl satisfying role R coexists with a generic
placeholder of role R in the same Module. The runner
surfaces this as BuildError::AmbiguousRole.
Fields
UnresolvedPeerClass
infer_peer_classes - a wire.Send’s peer input has no
declared peer_class (neither on the input’s
ValueInfoProto nor on the producing NodeProto’s metadata).
The compiler can’t decide which class of Node owns the send’s
data output.
Fields
CrossClassDataflow
infer_peer_classes - a non-wire NodeProto consumes two values
from different home classes. Either the user threaded a value
from one peer’s partition into another’s compute without a
wire.send between them, or a frontend forgot to mark a peer
input as ambient.
Fields
IrVersionMismatch
the input ModelProto’s stamped
FRAMEWORK_IR_VERSION doesn’t match what this compiler was
built to consume. Surfaced by
crate::driver::Compiler::with_target_version / the
driver-entry check before any pass runs.
MissingBinding
a binding the compiler required (a generic-slot
concrete impl, a peer attribute, etc.) was not present at
the offending site. Replaces the catch-all Internal for
the missing-binding failure mode so consumers can match on
shape and surface actionable diagnostics.
Fields
EmptyFunctionTable
ModelProto.functions was empty when the
compiler needed at least the root function the recorder
produces from Module::body. Distinct from
Validation(ValidationError) because it surfaces from the
driver entry, not a pass body.
RuntimeIncomplete
validate_runtime_complete found the compiled
model is missing a runtime requirement (e.g. a NodeProto
whose op is not registered, or a gate that should have been
inserted but wasn’t).
Internal
Catch-all for orchestrator-level failures (e.g. ill-formed recorded module). Carries enough detail to debug.
TypeConstraintFailed
type_solver - a [TypeRelation] reported Failed while
running against the constraint network. The op’s relations
can’t be satisfied together with the seeded inputs.
Fields
UnresolvedType
type_solver (strict mode) - a value slot reached fixpoint
still bound to an abstract TypeNode. The graph is under-
constrained; either a seed is missing or an op’s
type_relations declarations are insufficient.
UnboundDependency
resolve_component_dependencies - a concrete component
declared #[depends(<role> = "<slot>")] for a slot that
has no binding in the compiled artifact’s spec. The user
supplied an index binding but forgot the backend
binding the index needs.
Fields
UnknownPort
A NodeProto references a port name the module didn’t
record in its body via g.input / g.output / g.net_out
/ g.net_in.
PortUnwired
A declared port was neither read (input) nor written (output) inside its module’s body.
Fields
NetworkOpNotAtBoundary
A wire.Send / wire.Recv op was found that doesn’t
land on a module’s declared network boundary. Internal
wire ops are forbidden — every wire boundary must coincide
with a g.net_out / g.net_in recording.
Fields
InvalidSlotId
refine_polymorphic_value_info — a Contract-method NodeProto
carries ai.bytesandbrains.slot_id metadata that is missing or
not a valid u32.
Fields
UnknownSlotId
refine_polymorphic_value_info — the slot_id on a
Contract-method NodeProto does not correspond to any slot in
the compiled artifact’s BindingSpec. Indicates the binding
chain is missing an entry for the role this node requires.
Fields
UnknownRoleRuntime
refine_polymorphic_value_info — a Contract-method NodeProto
declares a ai.bytesandbrains.required_trait value that the
pass does not recognise as a known role-runtime identifier.
MissingCodecPortMetadata
refine_polymorphic_value_info — a CodecRuntime NodeProto
is missing the ai.bytesandbrains.codec.port metadata entry
that indicates whether this node is an encode ("out") or
decode ("in") operation.
InvalidCodecPort
refine_polymorphic_value_info — a CodecRuntime NodeProto
carries a ai.bytesandbrains.codec.port value that is neither
"in" nor "out".
AmbiguousRoleBinding
refine_polymorphic_value_info — two or more slots in the
BindingSpec share the same role_runtime identifier (e.g.
two .bind_index::<A>("local").bind_index::<B>("remote")
calls produce two slots both with role = "IndexRuntime").
The pass uses lookup_by_role which returns only the first
match, so it would silently apply the wrong concrete’s storage
type to nodes belonging to the other slot. Until slot_id-keyed
lookup is implemented this ambiguity is a hard error.
Fields
MissingRequiredTraitMetadata
refine_polymorphic_value_info — a NodeProto carries
ai.bytesandbrains.slot_id metadata (marking it as a
Contract-method node) but lacks the companion
ai.bytesandbrains.required_trait metadata. The DSL recorder
always stamps both; a missing required_trait indicates a
malformed IR that would cause the pass to silently mis-route
the refinement.
DependencyRoleMismatch
resolve_component_dependencies - the slot a component’s
dep points at is bound to a concrete whose declared role
set does NOT include the required role. The user bound
the right slot to the wrong KIND of concrete.
Fields
UnboundSlot
validate_all_slots_bound - the compiled artifact has at
least one slot the install path would need a concrete for
that the bind chain didn’t supply. Source identifies why
the slot is required so the diagnostic can point the user
at exactly which .bind_<role>::<T>("…") is missing.
Fields
role: StringAuthor-chosen role identifier (PascalCase Contract
role name, e.g. "Backend", "Index").
source: SlotSourceWhere the requirement comes from.
BootstrapCompositionGap
validate_bootstrap_composition — a CALL inside a bootstrap
function points at a target name that has no matching
FunctionProto. The most common cause is a parent Module’s
bootstrap recording calling self.child.call().bootstrap(g)
without the child’s bootstrap recording reaching the
Module::build output (e.g. an empty bootstrap override that
build drops on the floor).
Fields
BootstrapCompositionCycle
validate_bootstrap_composition — the bootstrap function-call
graph contains a cycle. Bootstrap is a one-shot drain; a cycle
would wedge the engine in bootstrap_pending forever.
Fields
IncompatibleStorageOnEdge
type_solver — a wire edge carries a concrete storage type on
the send side that does not match the concrete storage type
declared on the receive side, and no Codec bridge is
wired between them. Reading the hint: add a
Codec<In=<actual_id>, Out=<expected_id>> node on the edge so
the encoder/decoder pair converts between the two storage
representations. Quantization methods are not substitutable
casts — the author must choose the right Codec impl.
Fields
Trait Implementations§
Source§impl Debug for CompileError
impl Debug for CompileError
Source§impl Display for CompileError
impl Display for CompileError
Source§impl Error for CompileError
impl Error for CompileError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()