Skip to main content

ImportedProvider

Struct ImportedProvider 

Source
pub struct ImportedProvider {
    pub name: String,
    pub backend: BackendId,
    pub kernel_source: &'static str,
    pub revision_base: Option<String>,
    pub link_registry: Option<String>,
    pub primitives: Vec<ResolvedPrimitive>,
    pub fused: Vec<ResolvedFused>,
    pub warnings: Vec<ImportWarning>,
}
Expand description

A parsed + validated provider bundle, holding the resolved per-kernel records ready to register. Construction (import_*) already ran the parse + restricted-YAML pre-pass + lowering (string → typed dispatch records); Self::register_into only does the registry inserts + the duplicate-detection gate.

Fields§

§name: String

provider.name (front-matter).

§backend: BackendId

provider.backend (front-matter), the registry key backend.

§kernel_source: &'static str

provider.kernel_source (front-matter), interned to &'static.

§revision_base: Option<String>

provider.revision_base (front-matter) — the provider build id folded into kernel_revision_hash.

Retained on the imported provider specifically so import_glob can enforce §9.2’s “front-matter must agree across files”. It was previously consumed during lowering and dropped, which made that agreement structurally uncheckable: two files of one globbed provider could declare different bases, and since revision_base feeds kernel_revision_hash — the key the verification ledger is looked up by — the merged provider would silently carry kernels whose revision hashes were computed against different roots.

§link_registry: Option<String>

provider.link_registry (front-matter) — the symbol path of the table this file’s entry_points are declared to resolve against.

Retained for the same reason as Self::revision_base: §9.2 requires it to AGREE across a glob’s files, and a field that is consumed during lowering and dropped cannot be compared at merge time. import_glob binds every file it merges through the single registry its caller supplied, so disagreement here means at least one file’s entry points were resolved against a table its author never named.

§primitives: Vec<ResolvedPrimitive>

Lowered op_kind contracts → the binding table.

§fused: Vec<ResolvedFused>

Lowered fused_op contracts → the fused registry.

§warnings: Vec<ImportWarning>

Soft import diagnostics (§3.5 warns, precision downgrades, etc.).

Implementations§

Source§

impl ImportedProvider

Source

pub fn register_into( &self, table: &mut KernelBindingTable, fused: &mut FusedKernelRegistry, ) -> Result<(), FkcError>

Register every primitive contract into table and every fused contract into fused, then run the duplicate-detection gate.

Describe-only sections (registrable: false, §3.10) are already excluded before this point: lower_file (called by the import_* constructors) filters them out, so self.primitives / self.fused contain only registrable kernels. A documentation-only section therefore never reaches the binding table / fused registry or the duplicate- KernelRef gate — it is honest docs, not a dispatch decision point.

Per slice (§2.1 / §2.2): each primitive becomes a KernelBindingTable::register_full_with_source insert; each fused op becomes a FusedKernelRegistry::register of a BackendImpl. Cost is the sentinel for every kernel this slice — unknown_cost for primitives, fused_unknown_cost for fused ops (see the module-level cost note); the parsed cost AST stays on the Resolved* record.

register_full_with_source is append-only and returns () today; the same KernelRef driven onto one (op, dtypes, backend) key twice is detected by KernelBindingTable::finalize, which this method calls after all inserts and maps to FkcError::DuplicateKernelRef (never a panic — the import path is Result end-to-end).

Trait Implementations§

Source§

impl Clone for ImportedProvider

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 Debug for ImportedProvider

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<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<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> 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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