#[non_exhaustive]pub enum BackendError {
DeviceOutOfMemory {
requested: u64,
available: u64,
},
DeviceLost {
backend: String,
device: String,
generation: u64,
message: String,
},
UnsupportedFeature {
name: String,
backend: String,
},
PoisonedLock {
lock_error: String,
},
KernelCompileFailed {
backend: String,
compiler_message: String,
},
DispatchFailed {
code: Option<i32>,
message: String,
},
Validation {
source: ValidationError,
},
InvalidProgram {
fix: String,
},
CooperativeResidencyExceeded {
grid_blocks: u64,
resident_limit: u64,
detail: String,
},
Other(String),
}Expand description
Actionable backend dispatch failure.
Every error that flows through the frozen VyreBackend contract must
include remediation text beginning with Fix: . This guarantees that
conform reports are directly actionable for backend authors and that
consumers never receive an opaque failure string.
Use specific variants (DeviceOutOfMemory, KernelCompileFailed, etc.) when
the failure class is known. BackendError::Other carries actionable failures
that do not fit a structured variant.
§Examples
use vyre_driver::BackendError;
let err = BackendError::new("adapter not found. Fix: install a compatible device driver.");
assert!(err.message().contains("Fix:"));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DeviceOutOfMemory
Device ran out of memory during buffer allocation or dispatch.
Fields
DeviceLost
The acquired device generation was lost and all native handles are stale.
Fields
UnsupportedFeature
The backend does not support a required feature.
Fields
backend: StringBackend identifier (matches crate::backend::VyreBackend::id).
PoisonedLock
Internal lock poisoning was detected during backend synchronization.
KernelCompileFailed
GPU kernel-source compilation failed.
“Shader” in the variant name is historical and generalised
- the code applies to any kernel-source compile failure across
backends. A 2.0 rename to
KernelCompileFailedis tracked in the semver-policy doc.
Fields
DispatchFailed
Command dispatch or GPU queue submission failed.
Fields
Validation
Foundation validation rejected the program with a structured issue.
Fields
source: ValidationErrorStructured foundation-owned validation issue.
InvalidProgram
The program is structurally invalid for this backend.
CooperativeResidencyExceeded
A cooperative whole-grid launch could not be made fully resident: the grid has more blocks than the device can co-schedule for a grid-sync barrier. The orchestrator must fall back (loudly) to a recall-identical non-cooperative path rather than launch a kernel that would deadlock.
Fields
Other(String)
Actionable backend failure without a more specific structured class.
Implementations§
Source§impl BackendError
impl BackendError
Sourcepub fn new(message: impl Into<String>) -> Self
pub fn new(message: impl Into<String>) -> Self
Build an unclassified backend error from a complete actionable message.
The message is preserved verbatim. Callers that can identify the failure class use a structured variant instead.
§Examples
use vyre_driver::BackendError;
let err = BackendError::new("queue full. Fix: retry with a smaller dispatch size.");
assert_eq!(err.to_string(), "queue full. Fix: retry with a smaller dispatch size.");Sourcepub fn unsupported_extension(
backend: impl Into<String>,
extension_kind: &str,
debug_identity: &str,
) -> Self
pub fn unsupported_extension( backend: impl Into<String>, extension_kind: &str, debug_identity: &str, ) -> Self
Build an actionable unsupported-extension error for opaque IR payloads.
Sourcepub fn poisoned_lock<T>(error: PoisonError<T>) -> Self
pub fn poisoned_lock<T>(error: PoisonError<T>) -> Self
Build a structured lock-poisoning error.
This constructor accepts any PoisonError from RwLock operations
and returns an actionable error carrying the root poison metadata.
Sourcepub fn message(&self) -> String
pub fn message(&self) -> String
Human-readable failure message, equivalent to ToString::to_string.
Prefer explicit match on variants or ErrorCode for programmatic
error handling; avoid string-parsing this output.
Sourcepub fn into_message(self) -> String
pub fn into_message(self) -> String
Consume this error and return its message string.
Useful in map_err chains that expect String.
Trait Implementations§
Source§impl Clone for BackendError
impl Clone for BackendError
Source§fn clone(&self) -> BackendError
fn clone(&self) -> BackendError
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 BackendError
impl Debug for BackendError
Source§impl Display for BackendError
impl Display for BackendError
impl Eq for BackendError
Source§impl Error for BackendError
impl Error for BackendError
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 PartialEq for BackendError
impl PartialEq for BackendError
impl StructuralPartialEq for BackendError
Auto Trait Implementations§
impl Freeze for BackendError
impl RefUnwindSafe for BackendError
impl Send for BackendError
impl Sync for BackendError
impl Unpin for BackendError
impl UnsafeUnpin for BackendError
impl UnwindSafe for BackendError
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<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.