pub enum Divergence {
EmptyCorpus,
Faulted {
side: Side,
input: usize,
fault: ChoreoFault,
},
MissingTensor {
side: Side,
input: usize,
tensor: TensorId,
},
Representation {
input: usize,
tensor: TensorId,
a: &'static str,
b: &'static str,
a_len: usize,
b_len: usize,
},
Element {
input: usize,
tensor: TensorId,
elem: usize,
a: Elem,
b: Elem,
differing: usize,
total: usize,
},
}Expand description
Why two programs are not the same program.
★ NEVER A BARE bool. “Not equivalent” is unactionable; a failed differential has to say which input
of the corpus broke it, which tensor, which element, and what the two sides put there — otherwise the
next person re-derives all of that by hand before they can start.
Variants§
EmptyCorpus
The caller passed no inputs. ★ Fail-closed: a validator handed nothing to check must never answer “equivalent”, because a vacuous pass reads exactly like a proof.
Faulted
One side could not be evaluated at all — a choreography fault, not an arithmetic disagreement.
MissingTensor
One side produced an output tensor the other never produced.
Representation
The same tensor came back in two different representations (int vs float, or two lengths).
Element
The two sides computed different numbers. elem is the FIRST differing flat index (row-major over
the tensor’s element shape); differing of total says how much of the tensor moved, which is what
separates “one rounding” from “the whole rewrite is wrong”.
Trait Implementations§
Source§impl Clone for Divergence
impl Clone for Divergence
Source§fn clone(&self) -> Divergence
fn clone(&self) -> Divergence
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Divergence
impl Debug for Divergence
Source§impl Display for Divergence
impl Display for Divergence
Source§impl PartialEq for Divergence
impl PartialEq for Divergence
impl StructuralPartialEq for Divergence
Auto Trait Implementations§
impl Freeze for Divergence
impl RefUnwindSafe for Divergence
impl Send for Divergence
impl Sync for Divergence
impl Unpin for Divergence
impl UnsafeUnpin for Divergence
impl UnwindSafe for Divergence
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.