Skip to main content

RejectReason

Enum RejectReason 

Source
pub enum RejectReason {
    Atomic(&'static str),
    StrictFp(&'static str),
    TableOp(&'static str),
    GcOp(&'static str),
    MemoryResize(&'static str),
    LargeMemcpy(&'static str),
    HostCall(&'static str),
    FloatOp(&'static str),
    IntDivRem(&'static str),
    BackEdge(&'static str),
    Trap(&'static str),
}
Expand description

A reason a Cranelift instruction cannot be lowered to a crate::lowered_ir::LoweredOp.

Each variant carries the offending opcode’s mnemonic (&'static str) so error messages and logs are grep-able against the mapping table. The mnemonic is the same string Cranelift’s own Opcode Display impl prints (e.g. "atomic_rmw", not "AtomicRmw"), making it stable across the cranelift-codegen version bumps that periodically rename enum variants but keep the textual mnemonic.

Variants§

§

Atomic(&'static str)

Atomic memory operation. Deferred — Wasm-threads-on-GPU is a memory-model problem out of scope for wave 2. Covers atomic_load, atomic_store, atomic_rmw, atomic_cas.

§

StrictFp(&'static str)

Floating-point opcode with strict-FP exception semantics PTX default rounding cannot match. Covers fcvt_to_sint_sat and fcvt_to_uint_sat — both saturate-on-out-of-range, behaviour the PTX cvt does not provide by default. The full strict-FP scope (NaN propagation, denormals-as-zero) is broader; wave 2 limits itself to the trap-carrying conversions.

§

TableOp(&'static str)

Wasm table.get / table.set. Tables live host-side; lowering them would require device-resident table mirrors. Hard-rejected.

Not currently wired in the detector: cranelift-codegen 0.111 has no direct Opcode::TableGet / Opcode::TableSet variant — cranelift-wasm lowers these to load/store+libcall sequences in the translator, so a Wasm module reaches us with the table access already expanded into a call to a runtime helper (and therefore is caught by RejectReason::HostCall). Pre-declared here so a future direct Wasm front-end or a Cranelift bump that introduces table opcodes natively does not have to reshuffle the public enum.

§

GcOp(&'static str)

Wasm GC / reference-type opcode (ref.func, ref.null, ref.is_null on a non-i31 ref). No device-side representation possible. Hard-rejected.

Not currently wired for the same reason as RejectReason::TableOp: in cranelift-codegen 0.111 the GC proposal opcodes either do not exist as direct enum variants (ref.func) or are translated into other ops by cranelift-wasm before the detector sees them. Pre-declared for forward compatibility.

§

MemoryResize(&'static str)

memory.grow / memory.size. Linear-memory resizing requires a host round-trip; PTX kernels must run with a fixed memory snapshot.

Not currently wired: cranelift-codegen 0.111 has no direct Opcode::MemoryGrow / Opcode::MemorySize — Wasm memory.grow reaches us as a libcall (a Call instruction targeting the runtime helper) and is therefore caught by RejectReason::HostCall. Pre-declared for the same forward- compatibility reason as the other absent categories.

§

LargeMemcpy(&'static str)

memory.copy / memory.fill above the inline-copy threshold. PTX has cp.async.bulk (sm_90+) but the wave-2 baseline is sm_80 — the cuda-oxide PTX target version pinned via crate::ptx_emit::DEFAULT_TARGET.

Not currently wired: same translator-expansion situation as the other absent categories — memory.copy / memory.fill reach us as Call instructions to the runtime, caught by RejectReason::HostCall. Pre-declared for forward compatibility. Wave 3+ will refine RejectReason::HostCall to distinguish device-internal calls from runtime-helper calls and may at that point route small memory.copy libcalls back to an inline Load/Store sequence instead of a hard reject.

§

HostCall(&'static str)

call / call_indirect / return_call / return_call_indirect. Host-callback prohibition: PTX has no path back into the Wasmtime runtime, so every call is rejected at the wave-2 detector. Wave 3+ will distinguish device-internal calls (legal: lowered to func.call) from host round-trips (illegal: rejected).

§

FloatOp(&'static str)

Any floating-point opcode (fadd, fmul, fdiv, fma, sqrt, fcmp, the float conversions, …).

jit MED fix (finding 4): the reject-list previously admitted non-saturating FP ops. PTX default rounding (add.rn.f32 etc.) is bit-exact IEEE for the basic ops, but the broader strict-FP scope (NaN payload propagation, denormal-as-zero behaviour, transcendental approximations) is NOT yet proven equivalent to the Wasm/CPU reference across this lowering path. Until a differential proof of bit-exact rounding lands, ALL float opcodes are rejected so a float function deopts to the CPU path rather than risk silent numerical divergence. (The basic-op subset can be re-admitted once the differential oracle proves equivalence — narrow this then.)

§

IntDivRem(&'static str)

Integer divide / remainder (sdiv, udiv, srem, urem).

jit MED fix (finding 4): Wasm i32.div_u etc. TRAP on divide-by- zero (and signed div traps on INT_MIN / -1 overflow). PTX div has undefined behaviour on divide-by-zero — it does not trap. Until the lowering emits an explicit divisor-zero guard that reproduces the Wasm trap, integer div/rem is rejected so it stays on the CPU path rather than producing a non-trapping (wrong) result on the GPU.

§

BackEdge(&'static str)

A control-flow back-edge: a branch whose target is a block at or before the branching block in layout order (i.e. a loop).

jit MED fix (finding 4): the wave-2 lowering does not yet model loop carried dependencies / convergence on the GPU, so any function containing a loop back-edge is rejected. Straight-line and forward-only (if/else, switch) control flow remains admissible.

§

Trap(&'static str)

An explicit trap or unreachable (trap, trapz, trapnz, resumable_trap, debugtrap; Wasm unreachable lowers to trap).

jit MED fix (finding 4): PTX has no equivalent of the Wasm trap machinery (which unwinds back into the host with a trap code). A function that can trap mid-kernel cannot be faithfully offloaded, so it is rejected.

Implementations§

Source§

impl RejectReason

Source

pub fn opcode_mnemonic(&self) -> &'static str

The Cranelift opcode mnemonic that triggered this rejection.

Convenience accessor for log lines / error formatting that want the offending opcode name without match-ing on the variant.

Trait Implementations§

Source§

impl Clone for RejectReason

Source§

fn clone(&self) -> RejectReason

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RejectReason

Source§

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

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

impl Eq for RejectReason

Source§

impl PartialEq for RejectReason

Source§

fn eq(&self, other: &RejectReason) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for RejectReason

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts 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>

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

Converts &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)

Converts &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
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

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

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
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> 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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