Skip to main content

ExecutionPath

Enum ExecutionPath 

Source
#[non_exhaustive]
pub enum ExecutionPath { NotRun, ZeroCopy, HostCopyElided, DeviceLocalCopy { copies: u8, reason: Option<&'static str>, }, BrowserGpuCopy, CacheHit, CpuBounceFallback { reason: &'static str, }, }
Expand description

Which path a frame went down. Carried on per-call result types (an interop layer’s import / export results) rather than process-global cells.

The reason in CpuBounceFallback is a &'static str deliberately — no allocation, no formatting, and CI can assert specific strings without string-slicing the whole output.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

NotRun

No run has completed yet — the initial state of a freshly-constructed processor’s metrics. Distinct from every “work happened” path so a caller can tell “no measurement yet” apart from “ran, took the CPU-bounce path”. A metrics record’s default reports this; it never appears after a completed run.

§

ZeroCopy

The source resource was aliased into a wgpu::Texture / wgpu::Buffer without any host or device-to-device copy on this frame.

§

HostCopyElided

A host-side full-buffer copy was elided: the consumer referenced the producer’s existing CPU allocation (a refcount bump) instead of memcpy-ing the payload into its own buffer. No GPU resource was aliased and no device was involved at all.

Deliberately NOT Self::ZeroCopy, which asserts a GPU aliasing import — conflating the two makes a pure-software path read as GPU zero-copy in every matrix report. Deliberately NOT Self::CpuBounceFallback either: no host memcpy ran, so it is not a bounce.

Reported by software-encode input paths that take a new reference to a decoded frame’s existing CPU planes instead of copying them into the encoder’s input frame.

§

DeviceLocalCopy

Zero-copy modulo a GPU-side staging copy (e.g. the wgpu-GL OES→2D blit, or a D3D11→D3D12 row-major stage). copies counts how many on-device copies happened: 1 for the “single staging copy” case; 2+ for forced bounce-and-rewrap. Distinguished from ZeroCopy so callers gating on “no driver-side copy at all” don’t conflate them, and from CpuBounceFallback because the staging cost is GPU-side.

reason is an optional &'static str tag — same no-alloc, CI-assertable rule as CpuBounceFallback::reason — naming the specific GPU-local route that ran (e.g. which bonded CUDA→GPU path), for diagnostics. None when the path has no finer label worth pinning. It does not participate in the “how much work happened” signal — copies does — but it is part of the variant’s Eq/Hash, so two DeviceLocalCopys with the same copies but different reason compare unequal.

Fields

§copies: u8
§reason: Option<&'static str>
§

BrowserGpuCopy

Web only. The operation went through a browser API that is a copy at the spec surface (copyExternalImageToTexture, new VideoFrame(canvas)) executed inside the browser — typically GPU-to-GPU, but unobservable and uncountable from wasm.

Distinct from Self::DeviceLocalCopy (which asserts a counted, known copy on a device the caller controls) and from Self::CpuBounceFallback (no CPU memcpy ran on the caller’s hot path). An option that silences cross-backend CPU-bounce warnings should never silence this — it is the expected default on the web and exists for visibility, not noise.

§

CacheHit

A prior import (any path) was reused this frame from the import cache; no work happened in this call. Distinct from ZeroCopy because the original import may have been a CPU upload — a caller gating “is this frame zero-copy aliased?” must not conflate the two.

§

CpuBounceFallback

A CPU host memcpy ran on the per-frame hot path. The reason disambiguates which call site flipped the path so a once-per- reason bounce logger can warn exactly once per cause.

Fields

§reason: &'static str

Trait Implementations§

Source§

impl Clone for ExecutionPath

Source§

fn clone(&self) -> Self

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 Copy for ExecutionPath

Source§

impl Debug for ExecutionPath

Source§

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

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

impl Eq for ExecutionPath

Source§

impl Hash for ExecutionPath

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ExecutionPath

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ExecutionPath

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> MaybeSend for T
where T: Send + ?Sized,

Source§

impl<T> MaybeSendSync for T
where T: Send + Sync + ?Sized,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,