pub enum Determinism {
BestEffort,
Topological,
NumericallyBounded,
Bitwise,
}Expand description
Reproducibility requirement.
These are three genuinely different contracts, not degrees of one. A backend
that reduces in a deterministic order satisfies Self::Topological while
still failing Self::Bitwise against a differently-scheduled backend, so
collapsing them into one flag lets two backends both claim “deterministic”
and still disagree. Ordered weakest to strongest.
Variants§
BestEffort
No guarantee. The backend may reorder, re-associate, and reschedule.
Topological
Same connectivity and same output ordering for the same inputs.
Coordinates may differ within tolerance. This is what a clash result or a topology commit needs; it does not promise identical floats.
NumericallyBounded
Topological determinism plus values within the operation’s stated numerical error bound.
Bitwise
Bit-for-bit identical output for the same inputs and options.
The only contract that supports hashing a result or comparing artifacts across machines.
Implementations§
Source§impl Determinism
impl Determinism
Sourcepub const fn satisfies(self, required: Determinism) -> bool
pub const fn satisfies(self, required: Determinism) -> bool
Whether this guarantee is at least as strong as required.
Strength is the declaration order, so a backend offering
Self::Bitwise satisfies a Self::Topological request but never
the reverse. Routing must use this instead of equality, or a stronger
backend gets rejected for being too good.
Trait Implementations§
Source§impl Clone for Determinism
impl Clone for Determinism
Source§fn clone(&self) -> Determinism
fn clone(&self) -> Determinism
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Determinism
impl Debug for Determinism
Source§impl Hash for Determinism
impl Hash for Determinism
Source§impl Ord for Determinism
impl Ord for Determinism
Source§fn cmp(&self, other: &Determinism) -> Ordering
fn cmp(&self, other: &Determinism) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for Determinism
impl PartialEq for Determinism
Source§impl PartialOrd for Determinism
impl PartialOrd for Determinism
impl Copy for Determinism
impl Eq for Determinism
impl StructuralPartialEq for Determinism
Auto Trait Implementations§
impl Freeze for Determinism
impl RefUnwindSafe for Determinism
impl Send for Determinism
impl Sync for Determinism
impl Unpin for Determinism
impl UnwindSafe for Determinism
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