Skip to main content

CompileError

Enum CompileError 

Source
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

§op_type: String

NodeProto.op_type.

§domain: String

NodeProto.domain.

§reason: String

Human-readable detail.

§

RoleMethodFailed

runtime.<op>() returned an error during role-method inlining.

Fields

§slot: String

Slot name (e.g. "backend", "model").

§op_type: String

NodeProto.op_type that triggered the inlining.

§source: String

Source error reported by the runtime impl.

§

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

§role: String

Role domain (e.g. "ai.bytesandbrains.role.index").

§concrete_type: String

Concrete TYPE_NAME providing the role.

§generic_slot_id: u32

Slot id of the conflicting generic placeholder.

§

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

§node_name: String

NodeProto.name of the offending send.

§peer_input: String

Value name of the peer input lacking a class.

§

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

§node_name: String

NodeProto.name of the offending consumer.

§home_a: String

One of the conflicting home classes.

§home_b: String

The other conflicting home class.

§

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.

Fields

§expected: u32

Version the compiler expects.

§got: u32

Version the input model carries.

§

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

§slot: String

Stable slot identifier (e.g. "ATTR_PEER", "backend", "required_trait:IndexRuntime").

§site: String

Where the requirement was raised (typically NodeProto.name or (function_name, node_index) as a composite string).

§

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).

Fields

§missing: String

Human-readable description of what’s missing.

§

Internal

Catch-all for orchestrator-level failures (e.g. ill-formed recorded module). Carries enough detail to debug.

Fields

§detail: String

Human-readable failure detail.

§

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

§op: String

Op the failing relation was attached to (domain::op_type).

§detail: String

Diagnostic detail from the relation.

§

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.

Fields

§value: String

Value name that didn’t narrow to a concrete leaf.

§

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

§component: String

TYPE_NAME of the concrete with the unsatisfied dep.

§bound_at_slot: String

Slot the component was bound at.

§required_role: String

The role the dependency requires (e.g. "Backend").

§required_slot: String

The slot name the dep points at.

§

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.

Fields

§module: String

Module that references the bad port.

§port: String

The bad port name.

§

PortUnwired

A declared port was neither read (input) nor written (output) inside its module’s body.

Fields

§module: String

Module declaring the unwired port.

§port: String

The unwired port name.

§direction: String

"Input" or "Output".

§

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

§module: String

Module hosting the off-boundary wire op.

§op_id: String

Op identifier (NodeProto.name).

§

InvalidSlotId

refine_polymorphic_value_info — a Contract-method NodeProto carries ai.bytesandbrains.slot_id metadata that is missing or not a valid u32.

Fields

§node: String

NodeProto.name of the offending node.

§value: String

The raw metadata value that failed to parse.

§

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

§node: String

NodeProto.name of the offending node.

§slot_id: u32

The slot_id that was not found.

§

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.

Fields

§node: String

NodeProto.name of the offending node.

§role: String

The unrecognised role string.

§

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.

Fields

§node: String

NodeProto.name of the offending node.

§

InvalidCodecPort

refine_polymorphic_value_info — a CodecRuntime NodeProto carries a ai.bytesandbrains.codec.port value that is neither "in" nor "out".

Fields

§node: String

NodeProto.name of the offending node.

§value: String

The invalid port value.

§

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

§role: String

The role string shared by multiple slots.

§slot_names: Vec<String>

Author-chosen slot names that share the role.

§

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.

Fields

§node: String

NodeProto.name of the offending node.

§

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

§component: String

TYPE_NAME of the concrete with the dep.

§bound_at_slot: String

Slot the component was bound at.

§required_role: String

The role the dep requires.

§required_slot: String

The slot name the dep points at.

§provided_role: String

The role(s) the bound concrete at required_slot actually provides.

§

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: String

Author-chosen role identifier (PascalCase Contract role name, e.g. "Backend", "Index").

§source: SlotSource

Where 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

§caller: String

Bootstrap function whose body emits the orphan CALL.

§target: String

Missing FunctionProto name the CALL points at.

§

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

§involves: Vec<String>

Function names traversed in the cycle, with the repeated node appearing at both ends so the path reads naturally.

§

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

§src: String

Value name produced by the upstream send-side node.

§dst: String

Value name expected by the downstream receive-side node.

§expected_id: &'static str

TypeNode.id string the receive side declares (e.g. "tensor.u8").

§actual_id: &'static str

TypeNode.id string the send side resolved to (e.g. "tensor.f32").

Trait Implementations§

Source§

impl Debug for CompileError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CompileError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for CompileError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<TypeError> for CompileError

Source§

fn from(e: TypeError) -> Self

Converts to this type from the input type.
Source§

impl From<ValidationError> for CompileError

Source§

fn from(e: ValidationError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> ErasedComponent for T
where T: Any + Send + Sync,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more