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: Stringprovider.name (front-matter).
backend: BackendIdprovider.backend (front-matter), the registry key backend.
kernel_source: &'static strprovider.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
impl ImportedProvider
Sourcepub fn register_into(
&self,
table: &mut KernelBindingTable,
fused: &mut FusedKernelRegistry,
) -> Result<(), FkcError>
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
impl Clone for ImportedProvider
Auto Trait Implementations§
impl Freeze for ImportedProvider
impl RefUnwindSafe for ImportedProvider
impl Send for ImportedProvider
impl Sync for ImportedProvider
impl Unpin for ImportedProvider
impl UnsafeUnpin for ImportedProvider
impl UnwindSafe for ImportedProvider
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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