Skip to main content

OpSpec

Struct OpSpec 

Source
pub struct OpSpec {
Show 33 fields pub id: &'static str, pub archetype: &'static str, pub category: Category, pub intrinsic_table: IntrinsicTable, pub signature: OpSignature, pub strictness: Strictness, pub cpu_fn: fn(&[u8]) -> Vec<u8>, pub wgsl_fn: fn() -> String, pub alt_wgsl_fns: Vec<(&'static str, fn() -> String)>, pub laws: Vec<AlgebraicLaw>, pub declared_laws: Box<[DeclaredLaw]>, pub spec_table: &'static [SpecRow], pub archetypes: &'static [&'static str], pub mutation_sensitivity: &'static [MutationClass], pub oracle_override: Option<OracleKind>, pub since_version: Version, pub docs_path: &'static str, pub equivalence_classes: Vec<EquivalenceClass>, pub boundary_values: Vec<BoundaryValue>, pub comparator: ComparatorKind, pub convention: Convention, pub version: u32, pub version_history: Vec<u32>, pub workgroup_size: Option<u32>, pub min_throughput_bytes_per_sec: Option<u64>, pub expected_output_bytes: Option<usize>, pub external_oracle_url: Option<&'static str>, pub property_invariants: &'static [&'static str], pub ir_program: Option<fn() -> Program>, pub no_algebraic_laws_reason: Option<&'static str>, pub admission_witness_cap: Option<usize>, pub cpu_fingerprint: Option<u64>, pub overflow_contract: Option<OverflowContract>,
}
Expand description

Complete executable specification for one vyre operation.

Fields§

§id: &'static str

Hierarchical identifier: “primitive.bitwise.xor”, “primitive.encoding.base64”

§archetype: &'static str

Archetype from the locked vocabulary (e.g. “binary-bitwise”). Empty string means “not yet classified” — the certify heuristic fills in a best-guess. New ops MUST set this from spec.toml.

§category: Category

A/C category declaration enforcing zero-cost composition or native intrinsic availability.

§intrinsic_table: IntrinsicTable

Per-backend intrinsic spellings required for Category C operations.

§signature: OpSignature

Type signature — what goes in, what comes out.

§strictness: Strictness

Bit-exact versus approximate conformance declaration.

§cpu_fn: fn(&[u8]) -> Vec<u8>

CPU reference function. THE specification. GPU must match byte-for-byte.

§wgsl_fn: fn() -> String

WGSL source for the op (defines a function named after the last id segment).

§alt_wgsl_fns: Vec<(&'static str, fn() -> String)>

Alternative WGSL sources to test against the same CPU reference.

§laws: Vec<AlgebraicLaw>

Algebraic laws this operation must satisfy.

§declared_laws: Box<[DeclaredLaw]>

Provenance-bearing law declarations for proof-aware phases.

§spec_table: &'static [SpecRow]

Concrete input/output examples that define load-bearing edge cases.

§archetypes: &'static [&'static str]

Archetype ids that this operation participates in.

§mutation_sensitivity: &'static [MutationClass]

Mutation classes that should be caught by this operation’s tests.

§oracle_override: Option<OracleKind>

Optional override for the default oracle selection order.

§since_version: Version

Semantic schema version when this operation became available.

§docs_path: &'static str

Repository-relative documentation path for this operation.

§equivalence_classes: Vec<EquivalenceClass>

Equivalence classes of the input space.

§boundary_values: Vec<BoundaryValue>

Explicit boundary values that must be tested.

§comparator: ComparatorKind

How to compare GPU vs CPU output.

§convention: Convention

Calling convention this op needs.

§version: u32

Spec version. Increment when behavior changes. Regressions are tagged with this.

§version_history: Vec<u32>

Previous spec versions for regression migration.

§workgroup_size: Option<u32>

Preferred workgroup size for conformance testing.

§min_throughput_bytes_per_sec: Option<u64>

Minimum throughput (input bytes/sec) for performance conformance.

§expected_output_bytes: Option<usize>

Expected output size in bytes for a single invocation.

§external_oracle_url: Option<&'static str>

External oracle URL (required when oracle_override is External).

§property_invariants: &'static [&'static str]

Declared property invariants (required when oracle_override is Property).

§ir_program: Option<fn() -> Program>

Optional IR program for the reference interpreter oracle.

§no_algebraic_laws_reason: Option<&'static str>

Documented justification when laws is empty (gate 6 admission).

§admission_witness_cap: Option<usize>

Per-spec override for the gate-4 generated witness cap.

§cpu_fingerprint: Option<u64>

Declared CPU fingerprint used when no oracle is declared (gate 5).

§overflow_contract: Option<OverflowContract>

Integer overflow contract (plan 3.6). None means the op was not declared to operate on integer types; every op that names DataType::U32 / DataType::I32 / DataType::U64 in its signature must declare one of the four OverflowContract variants or the overflow_contract gate fails red.

Implementations§

Source§

impl OpSpec

Source

pub fn builder(id: &'static str) -> OpSpecBuilder

Start building a complete operation specification.

Source

pub fn program(&self) -> Option<Program>

Return the IR program if one was registered.

Trait Implementations§

Source§

impl Clone for OpSpec

Source§

fn clone(&self) -> OpSpec

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OpSpec

Source§

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

Formats the value using the given formatter. Read more

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

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

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