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
ShapeMismatch
DimMismatch
MatmulDim
IndexOutOfBounds
TokenIndex
InvalidEpsilon
ZeroWidth
SizeOverflow
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.
InvalidConfig(String)
ModelLoad
UnsupportedFormat(String)
MissingTensor
InputLengthMismatch
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.
SnnNan
NaN produced at the ANN↔SNN boundary (±Inf stays rankable).
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.
SnnStimulusLength
An encoder returned a stimulus whose length differs from the backend channel count. Raised before the backend ticks.
SnnSpikeOutOfRange
A spike addressed a channel the backend width cannot represent.
SnnDuplicateSpike
A backend reported the same channel more than once in one tick,
violating the at-most-once contract of SnnStepOutput::spikes.
SnnReadoutLength
A decoder returned a readout whose length differs from the backend channel count.
SnnInvalidReadout
A decoder readout was negative or infinite; spike activity must be a
finite, non-negative quantity (NaN is reported as SnnNan).
NanRoutingScore
NaN is rejected before ranking so it never participates in partial_cmp.
InvalidStageId
A stage identifier was not a valid dotted path (see crate::stage::StageId).
InvalidTopology
A topology failed structural validation (empty, duplicate ids, or a forward/self stage reference).
UnsupportedStage
An executor was asked to run a stage kind its capabilities do not cover.
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.
MissingStageParams
A stage descriptor was missing the parameters its kind requires.
StageParamsMismatch
Parameters are bound for the stage, but for a different stage kind
(expected / got are crate::stage::StageKindTag tokens).
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).
StageInputArity
A stage received the wrong number of inputs.
StageInputKind
A stage input had the wrong kind (e.g. tokens where a tensor was expected).
StageDTypeMismatch
A stage input or output used a dtype the executor does not support.
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.
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.
StageFailed
A stage’s execution failed; the wrapped error carries the cause.
Io(Error)
Serde(Error)
SerdeInputTooLarge
Msg(String)
Trait Implementations§
Source§impl Debug for CortexError
impl Debug for CortexError
Source§impl Display for CortexError
impl Display for CortexError
Source§impl Error for CortexError
impl Error for CortexError
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()
Source§impl From<Error> for CortexError
impl From<Error> for CortexError
Auto Trait Implementations§
impl !RefUnwindSafe for CortexError
impl !UnwindSafe for CortexError
impl Forget for CortexError
impl Freeze for CortexError
impl Move for CortexError
impl Send for CortexError
impl Sync for CortexError
impl Unpin for CortexError
impl UnsafeUnpin for CortexError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more