pub enum EmitError {
NotYetImplemented(&'static str),
InvalidEntryName {
entry: String,
},
TooManyRegisters,
EmissionBudgetExceeded {
what: &'static str,
},
}Expand description
Errors produced by the PTX emitter.
Variants§
NotYetImplemented(&'static str)
The blueprint contains an op the emitter does not yet lower to PTX. Callers should treat this as “keep this function on the CPU path”.
InvalidEntryName
The blueprint’s entry field is not a valid PTX identifier.
Today every legitimate caller constructs entry via
format!("func{idx}") so this can never fire — but the Pliron
UserFuncName::Testcase path can carry tenant-controlled bytes that
would otherwise be interpolated unescaped into the PTX template
(closing the kernel scope, emitting a second adversary kernel, etc.).
Closes jit S-1.
Fields
TooManyRegisters
The blueprint demands more SSA registers than the %fN index space
(u32) can address. Previously the allocator saturated at
u32::MAX, which silently aliased two distinct SSA values onto the
same physical register and corrupted results. We now refuse the
blueprint so the caller (rewrite.rs) deopts to the CPU path rather
than launch a miscompiled kernel. Closes jit L1.
EmissionBudgetExceeded
The blueprint’s emission budget (per-op lanes, or total ops *
lanes across the stream) exceeds the emitter’s DoS guardrails.
The lane-bearing ops (VecAdd/VecMul/VecFma/LoadUnified/
StoreUnified) each drive a 0..lanes emission loop. The
production auto-offload path pins lanes to DEFAULT_LANES = 4,
but the PUBLIC TensorWasmKernelBlueprint::push + emit/emit_with
API accepts arbitrary lanes (up to u32::MAX). An embedder
building blueprints from untrusted dimensions could request billions
of PTX lines and exhaust CPU/memory before a byte of output is
returned. We bound lanes by MAX_LANES and the aggregate
(ops * lanes) emission budget by MAX_EMITTED_OPS and refuse up
front rather than rely on every caller to pre-bound. Closes jit L2
(unbounded lanes / op-count emission DoS).
Trait Implementations§
impl Eq for EmitError
Source§impl Error for EmitError
impl Error for EmitError
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()
impl StructuralPartialEq for EmitError
Auto Trait Implementations§
impl Freeze for EmitError
impl RefUnwindSafe for EmitError
impl Send for EmitError
impl Sync for EmitError
impl Unpin for EmitError
impl UnsafeUnpin for EmitError
impl UnwindSafe for EmitError
Blanket Implementations§
impl<T> AnyError for T
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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