Skip to main content

CortexError

Enum CortexError 

Source
pub enum CortexError {
Show 43 variants RankMismatch { expected: usize, got: usize, }, ShapeMismatch { expected: Vec<usize>, got: Vec<usize>, }, DimMismatch { op: &'static str, axis: usize, expected: usize, got: usize, }, MatmulDim { m: usize, k1: usize, k2: usize, n: usize, }, IndexOutOfBounds { axis: usize, index: usize, size: usize, }, TokenIndex { index: usize, vocab_size: usize, }, InvalidEpsilon { eps: f32, }, ZeroWidth { op: &'static str, axis: usize, }, SizeOverflow { shape: Vec<usize>, }, AllocationFailed { shape: Vec<usize>, bytes: usize, }, InvalidConfig(String), ModelLoad { path: String, reason: String, }, UnsupportedFormat(String), MissingTensor { name: String, path: String, }, InputLengthMismatch { expected: usize, got: usize, }, MoeForward(String), SnnBackend(String), SnnChannelMismatch { experts: usize, channels: usize, }, SnnNan { stage: &'static str, }, SnnInvalidStimulus { channel: usize, value: f32, }, SnnStimulusLength { expected: usize, got: usize, }, SnnSpikeOutOfRange { channel: usize, channels: usize, }, SnnDuplicateSpike { channel: usize, }, SnnReadoutLength { expected: usize, got: usize, }, SnnInvalidReadout { channel: usize, value: f32, }, NanRoutingScore { expert_id: usize, }, InvalidStageId { id: String, reason: String, }, InvalidTopology { reason: String, }, UnsupportedStage { backend: &'static str, stage_id: String, kind: String, }, UnsupportedOperation { backend: &'static str, stage_id: Option<String>, category: &'static str, detail: String, }, MissingStageParams { stage_id: String, }, StageParamsMismatch { stage_id: String, expected: String, got: String, }, InvalidStageParams { stage_id: String, reason: String, }, StageInputArity { stage_id: String, expected: usize, got: usize, }, StageInputKind { stage_id: String, index: usize, }, StageDTypeMismatch { stage_id: String, expected: String, got: String, }, MissingStageBinding { name: String, }, ConflictingStageBinding { name: String, reason: String, }, StageFailed { stage_id: String, source: Box<CortexError>, }, Io(Error), Serde(Error), SerdeInputTooLarge { max_bytes: usize, actual_bytes: usize, }, Msg(String),
}

Variants§

§

RankMismatch

Fields

§expected: usize
§got: usize
§

ShapeMismatch

Fields

§expected: Vec<usize>
§got: Vec<usize>
§

DimMismatch

Fields

§op: &'static str
§axis: usize
§expected: usize
§got: usize
§

MatmulDim

Fields

§

IndexOutOfBounds

Fields

§axis: usize
§index: usize
§size: usize
§

TokenIndex

Fields

§index: usize
§vocab_size: usize
§

InvalidEpsilon

Fields

§eps: f32
§

ZeroWidth

Fields

§op: &'static str
§axis: usize
§

SizeOverflow

Fields

§shape: Vec<usize>
§

AllocationFailed

The allocator refused the buffer for shape (bytes requested).

Distinct from SizeOverflow: the shape is representable, the machine just cannot back it. Returned instead of letting vec![0.0; n] abort the process through handle_alloc_error.

Fields

§shape: Vec<usize>
§bytes: usize
§

InvalidConfig(String)

§

ModelLoad

Fields

§path: String
§reason: String
§

UnsupportedFormat(String)

§

MissingTensor

Fields

§name: String
§path: String
§

InputLengthMismatch

Fields

§expected: usize
§got: usize
§

MoeForward(String)

§

SnnBackend(String)

An external SNN backend (e.g. neuromod) rejected a step.

§

SnnChannelMismatch

Each expert needs a dedicated backend channel for 1:1 encode/decode.

Fields

§experts: usize
§channels: usize
§

SnnNan

NaN produced at the ANN↔SNN boundary (±Inf stays rankable).

Fields

§stage: &'static str
§

SnnInvalidStimulus

A gate score or encoded stimulus sample was ±Inf. NaN is reported as SnnNan. Raised before the backend ticks; channel is the expert id for a gate score and the backend channel for an encoded sample. Also the mapping of neuromod::StepError::NonFiniteStimulus.

Fields

§channel: usize
§value: f32
§

SnnStimulusLength

An encoder returned a stimulus whose length differs from the backend channel count. Raised before the backend ticks.

Fields

§expected: usize
§got: usize
§

SnnSpikeOutOfRange

A spike addressed a channel the backend width cannot represent.

Fields

§channel: usize
§channels: usize
§

SnnDuplicateSpike

A backend reported the same channel more than once in one tick, violating the at-most-once contract of SnnStepOutput::spikes.

Fields

§channel: usize
§

SnnReadoutLength

A decoder returned a readout whose length differs from the backend channel count.

Fields

§expected: usize
§got: usize
§

SnnInvalidReadout

A decoder readout was negative or infinite; spike activity must be a finite, non-negative quantity (NaN is reported as SnnNan).

Fields

§channel: usize
§value: f32
§

NanRoutingScore

NaN is rejected before ranking so it never participates in partial_cmp.

Fields

§expert_id: usize
§

InvalidStageId

A stage identifier was not a valid dotted path (see crate::stage::StageId).

Fields

§reason: String
§

InvalidTopology

A topology failed structural validation (empty, duplicate ids, or a forward/self stage reference).

Fields

§reason: String
§

UnsupportedStage

An executor was asked to run a stage kind its capabilities do not cover.

Fields

§backend: &'static str
§stage_id: String
§kind: String
§

UnsupportedOperation

An external adapter refused an operation its capability report does not cover.

category is a stable negotiation key (stage_kind, dtype, device, policy, …), not a ranking of backends. stage_id is set when the refusal is about one stage.

Fields

§backend: &'static str
§stage_id: Option<String>
§category: &'static str
§detail: String
§

MissingStageParams

A stage descriptor was missing the parameters its kind requires.

Fields

§stage_id: String
§

StageParamsMismatch

Parameters are bound for the stage, but for a different stage kind (expected / got are crate::stage::StageKindTag tokens).

Fields

§stage_id: String
§expected: String
§

InvalidStageParams

Parameters are bound for the right stage kind but are internally inconsistent with it (e.g. a LayerNorm without a bias, or an RMSNorm with one).

Fields

§stage_id: String
§reason: String
§

StageInputArity

A stage received the wrong number of inputs.

Fields

§stage_id: String
§expected: usize
§got: usize
§

StageInputKind

A stage input had the wrong kind (e.g. tokens where a tensor was expected).

Fields

§stage_id: String
§index: usize
§

StageDTypeMismatch

A stage input or output used a dtype the executor does not support.

Fields

§stage_id: String
§expected: String
§

MissingStageBinding

A composition run had no binding for a named external ingress.

The field is deliberately not named source: thiserror would treat a field named source as the error cause and require it to implement std::error::Error, but here it is just the external ingress name.

Fields

§name: String
§

ConflictingStageBinding

A binding name was supplied twice (for example as both token ids and a tensor), or a bound stage output names a stage the topology itself produces. Rejected at bind / run time instead of shadowing silently.

Fields

§name: String
§reason: String
§

StageFailed

A stage’s execution failed; the wrapped error carries the cause.

Fields

§stage_id: String
§

Io(Error)

§

Serde(Error)

§

SerdeInputTooLarge

Fields

§max_bytes: usize
§actual_bytes: usize
§

Msg(String)

Trait Implementations§

Source§

impl Debug for CortexError

Source§

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

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

impl Display for CortexError

Source§

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

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

impl Error for CortexError

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

Replaced by Error::source.
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<Error> for CortexError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for CortexError

Source§

fn from(source: Error) -> 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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

impl<T> ToCompactString for T
where T: Display,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V