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 more