pub struct BindingEntry {
pub kernel: KernelRef,
pub caps: KernelCaps,
pub precision: PrecisionGuarantee,
pub cost: CostFn,
pub kernel_source: &'static str,
pub is_generic: bool,
pub kernel_revision_hash: u64,
pub cost_expr: Option<&'static CompiledCostExpr>,
}Expand description
One concrete kernel registered against a (OpKind, dtypes, backend)
decision-point key. Phase 7.6 step 9a: a single key now carries
SmallVec<[BindingEntry; 2]> — multiple alternatives compete at
the same decision point (e.g. cuBLAS bf16 matmul + CUTLASS bf16
matmul at (MatMul, [BF16, BF16, BF16], Cuda)). The route picker
(step 9b) selects among them at plan time; today’s single-impl
callers (lookup, lookup_with_caps, lookup_precision,
lookup_cost) return the first entry, preserving the pre-9a
behavior for sites that haven’t migrated.
Fields§
§kernel: KernelRef§caps: KernelCaps§precision: PrecisionGuarantee§cost: CostFn§kernel_source: &'static strDiagnostic tag identifying the kernel’s implementation source
when multiple alternatives register at the same (op, dtypes, backend) key. Used to distinguish e.g. AOCL’s matmul from
MKL’s matmul from the portable scalar matmul — all three live
at (MatMul, [F32×3], Cpu) as siblings.
"" is the default for kernels that don’t need to distinguish.
Conventional values: "portable-cpu" for fuel-cpu-backend
scalar/gemm kernels, "aocl" for AOCL-BLAS, "mkl" for oneMKL,
"cublas" / "cutlass" for CUDA variants. The string is
diagnostic-only — never used for dispatch routing (the kernel
function pointer is the dispatch identifier).
is_generic: boolWhether this kernel’s FKC accept-contract is the GENERIC (fully-permissive strided) one — admissible anywhere because it imposes no structure tightness (FKC §4.12). This is the structural-miss fallback bit: when the winning contract at a dispatch cell is generic, a structure-specialized kernel would have fit but none is registered, and the Baracuda miss telemetry records the demand.
Computed once at registration by the FKC importer from the
kernel’s retained ResolvedLayout set
(crate::fkc::is_generic_contract) and stamped here, so
the live dispatch pick site reads a precomputed bool rather than
re-deriving genericity from the lossy single-bool KernelCaps.
Hand-written registrations default false. Every non-FKC
register* path routes through
KernelBindingTable::register_full_with_source, which sets this
false: genericity is a claim about being the FKC generic-fallback
contract in Baracuda’s structure-key specialization space, and a
hand-written kernel makes no such claim. This holds even for a
hand-written strided kernel (register_with_caps(strided_input=true)):
strided-capability is not the same as being the generic fallback, and
conflating them would fabricate a miss demand signal for cells that are
not part of Baracuda’s matrix. Only the FKC importer, which computed
genericity from the declared contract, ever sets this true.
kernel_revision_hash: u64Stable per-implementation-version hash — the fifth axis of the FKC
kernel-identity basis tuple (FKC §4.11), pinning the exact kernel build
so a persisted plan / telemetry record re-resolves to it. 0
(crate::fused::KernelRevisionHash::UNTRACKED) for hand-written
registrations (which carry no revision); the FKC importer threads the
contract-computed revision from ResolvedPrimitive.revision here. Read
by the Baracuda dispatch-telemetry ImplId at the plan pick site so the
chosen/candidates ids carry a real revision instead of a stamped 0.
cost_expr: Option<&'static CompiledCostExpr>The contract’s parsed cost-expression AST (FKC §4.4 / adoption plan
§2.3), when the kernel came from an FKC-imported contract that
declares one. &'static so the entry stays Copy (CompiledCostExpr
derives Debug, which is all &'static T needs to stay Copy /
Clone / Debug itself). None for every hand-written registration
(register/register_full*) — those carry no declared cost AST, only
a CostFn fn-pointer. Only the FKC importer, once it lowers a
contract’s cost block to a live CostFn (a later Group-2 task),
stamps Some(&CompiledCostExpr) here.
Trait Implementations§
Source§impl Clone for BindingEntry
impl Clone for BindingEntry
impl Copy for BindingEntry
Auto Trait Implementations§
impl Freeze for BindingEntry
impl RefUnwindSafe for BindingEntry
impl Send for BindingEntry
impl Sync for BindingEntry
impl Unpin for BindingEntry
impl UnsafeUnpin for BindingEntry
impl UnwindSafe for BindingEntry
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