pub enum SignatureError {
Unmarked,
EmptyPayload,
DegenerateLayer {
layer: usize,
n_kv_heads: usize,
head_dim: usize,
},
RaggedPayload {
layer: usize,
field: &'static str,
expected: String,
found: String,
},
PayloadMismatch {
field: &'static str,
recorded: String,
actual: String,
},
Incompatible {
field: &'static str,
expected: String,
found: String,
},
BlockSizeMismatch {
block_size: usize,
tokens: usize,
},
BadLayout(BlockLayoutError),
UnsupportedFormat {
found: u32,
readable: &'static [u32],
},
}Expand description
Why a stored block was refused. Every variant is a refusal to guess.
Variants§
Unmarked
The block carries no signature. Not treated as “probably fine”: an unmarked block was written by something whose layout is unknown, which is precisely the case that must not be trusted.
EmptyPayload
A block with no layers describes nothing and can vouch for nothing.
DegenerateLayer
A layer with no heads or zero head dimension.
RaggedPayload
The payload does not agree with itself: layers of different
shapes or lengths, or a layer whose buffers contradict its own
seq_len.
PayloadMismatch
The recorded signature claims something the payload is not. The stamp is wrong (or was written by a build with a different layout); the payload is the truth.
Incompatible
The payload is coherent and honestly stamped, but it is not what this reader needs – a different model, a config change, a different block size.
BlockSizeMismatch
The stamp claims a block size the payload’s token depth is not. A stored block is exactly one whole block, so these are the same number or the stamp is wrong.
BadLayout(BlockLayoutError)
The block layout itself is not usable – most importantly, a
block size that does not divide the sliding window. See
kv_swa.
UnsupportedFormat
Written by a build whose payload layout this one cannot read.
Trait Implementations§
Source§impl Clone for SignatureError
impl Clone for SignatureError
Source§fn clone(&self) -> SignatureError
fn clone(&self) -> SignatureError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SignatureError
impl Debug for SignatureError
Source§impl Display for SignatureError
impl Display for SignatureError
impl Eq for SignatureError
Source§impl Error for SignatureError
impl Error for SignatureError
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()
Source§impl From<BlockLayoutError> for SignatureError
impl From<BlockLayoutError> for SignatureError
Source§fn from(err: BlockLayoutError) -> Self
fn from(err: BlockLayoutError) -> Self
Source§impl PartialEq for SignatureError
impl PartialEq for SignatureError
impl StructuralPartialEq for SignatureError
Auto Trait Implementations§
impl Freeze for SignatureError
impl RefUnwindSafe for SignatureError
impl Send for SignatureError
impl Sync for SignatureError
impl Unpin for SignatureError
impl UnsafeUnpin for SignatureError
impl UnwindSafe for SignatureError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more