#[non_exhaustive]pub enum FkcError {
Show 48 variants
TabIndentation {
line: usize,
},
AnchorDisallowed {
line: usize,
},
AliasDisallowed {
line: usize,
},
MergeKeyDisallowed {
line: usize,
},
NorwayToken {
token: String,
line: usize,
},
MalformedFrontMatter(String),
MissingFkcBlock {
section: String,
},
MultipleFkcBlocks {
section: String,
count: usize,
},
OrphanFkcBlock {
line: usize,
},
Yaml(String),
MissingRequiredField {
section: String,
field: String,
},
BlurbMismatch {
section: String,
structured: String,
prose: String,
},
OpTargetAmbiguous {
section: String,
op_kind: Option<String>,
fused_op: Option<String>,
},
UnknownOpKind {
section: String,
op_kind: String,
},
UnknownFusedOp {
section: String,
fused_op: String,
},
BadScalarType {
section: String,
operand: String,
token: String,
},
ReservedScalarType {
section: String,
operand: String,
token: String,
},
FanoutDtypeMismatch {
section: String,
operand: String,
expected: String,
found: String,
},
OptionalOperandNotLast {
section: String,
operand: String,
},
PassthroughNamesOptionalOperand {
section: String,
role: String,
},
UnknownBackend {
section: String,
backend: String,
},
UnknownEntryPoint {
section: String,
entry_point: String,
},
UnknownCostFn {
section: String,
cost_fn: String,
},
BadLayoutFlag {
section: String,
operand: String,
flag: String,
value: String,
},
CostExprParse {
section: String,
field: String,
expr: String,
reason: String,
},
PlaceholderPrecision {
section: String,
},
DuplicateKernelRef(String),
ProviderMismatch {
field: String,
expected: String,
found: String,
file: String,
},
Io {
path: String,
reason: String,
},
UnsupportedVersion {
found: u32,
supported: &'static [u32],
},
LayoutIncoherent {
section: String,
operand: String,
reason: String,
},
AwkwardStrategyIncoherent {
section: String,
operand: String,
strategy: String,
reason: String,
},
QuantIncoherent {
section: String,
operand: String,
reason: String,
},
ScaleDoubleDeclared {
section: String,
operand: String,
reason: String,
},
MxNotYetRegistrable {
section: String,
family: String,
reason: String,
},
BadOpParamsVariant {
section: String,
variant: String,
namespace: String,
},
CostProvenanceMissing {
section: String,
found: Option<String>,
},
PlaceholderCost {
section: String,
reason: String,
},
UnauditedPrecision {
section: String,
},
BundleSlotRankExceeded {
section: String,
slot: String,
rank: usize,
},
ShapeRuleMismatch {
section: String,
role: String,
expected: String,
actual: String,
},
BundleArityMismatch {
section: String,
expected: usize,
actual: usize,
},
UnparseableShapeConstraint {
section: String,
operand: String,
raw: String,
},
GatherIncoherent {
section: String,
operand: String,
reason: String,
},
GatherNotYetSupported {
section: String,
operand: String,
},
FdxTokenNotInTable {
section: String,
field: String,
token: String,
},
UnknownAdmissibilityEnum {
section: String,
field: String,
value: String,
},
MissingBlurb {
section: String,
},
}Expand description
A typed FKC import failure (Result-returning, never a panic).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TabIndentation
Tab indentation inside a YAML chunk (front-matter or an fkc block). YAML forbids tab indentation; §3.8 makes this a hard error with a line rather than a confusing downstream parse error.
AnchorDisallowed
A YAML anchor (&name) was used. §3.8 disables anchors so a diff
reviewer sees every value literally and the importer never resolves a
reference graph.
AliasDisallowed
A YAML alias (*name) was used. Disallowed for the same reason as
anchors (§3.8).
MergeKeyDisallowed
A YAML merge key (<<:) was used. Disallowed (§3.8).
NorwayToken
An unquoted Norway-problem token (no/yes/on/off/n/y) appeared
in a scalar value position. §3.8 disarms the Norway problem by requiring
such tokens to be quoted so they cannot silently coerce to a bool.
MalformedFrontMatter(String)
The file-level ----fenced YAML front-matter is missing or malformed.
MissingFkcBlock
A ## kernel section has no fenced ```fkc block (§3.1 requires
exactly one).
MultipleFkcBlocks
A ## kernel section has more than one fenced ```fkc block (§3.1
requires exactly one).
OrphanFkcBlock
A ```fkc fenced block appears outside any ## section (before the
first heading, or in a file with no ## headings). Such a block is
silently dropped by section scanning, so the import would succeed while
adopting nothing — a no-op that looks like success (§3.1).
Yaml(String)
serde_yaml_ng failed to deserialize a YAML chunk into the schema. The
string carries the underlying error (and the section name when known).
MissingRequiredField
A required schema field is absent (V-FKC-1, §10). field names the
missing key; section the kernel section it belongs to.
BlurbMismatch
The structured blurb: does not equal the prose blurb (V-FKC-2,
§10.11). Reserved here; the prose-vs-structured comparison is wired in a
later step.
OpTargetAmbiguous
Neither op_kind nor fused_op is present, or both are present.
Exactly one must be declared (a primitive vs fused contract; §3.7,
V-FKC-5). The structural check happens at lower time.
UnknownOpKind
An op_kind string did not match any as-built OpKind variant
(§2.1; the lower-time match is exhaustive over OpKind).
UnknownFusedOp
A fused_op string did not match any registered FusedOpId name
(the name table is built from fuel-graph’s default_registry();
§2.2).
BadScalarType
A dtype token (or a dtype_class shorthand expansion) did not
match any as-built DType/shorthand (§3.4). The explicit match
makes a bad token a typed error rather than a silent skip.
ReservedScalarType
A dtype token that KISS-CLASSIFY §6.1 RESERVES at this schema
version. It is a real, specified layout (the AMD fnuz FP8 forms) that
Fuel recognizes and deliberately does not compute on.
§Why this is not FkcError::BadScalarType
A reserved token and an unknown one imply different actions: reserved
means wait for a schema bump, unknown means fix your contract.
Reporting a correctly-spelled F8E5M2FNUZ as a “bad dtype token” sends
a contract author hunting for a typo that isn’t there. FKC files are
external, hand-authored input, so this is a real ingest surface — which
is what makes the distinction worth a variant here.
§What this is NOT
It is not KISS-CLASSIFY §6.1-0001 conformance. That clause binds a
reader of a structure_key, and Fuel has none — it derives and
emits keys and treats foreign ones as opaque bytes (K1 opacity). This
is the reserved vocabulary of §6.1 applied to a surface Fuel actually
ingests.
§This decline EXPIRES, on an external trigger (GAP-161)
A decline for want of a kernel becomes wrong the moment the kernel
lands. This one becomes wrong when KISS activates the tokens — sk4
§6.1-0001 calls that “a future additive schema event”. So it expires
too; what differs is that its trigger is external and announced,
and cannot quietly become true through a Fuel-side change. See
fuel_ir::RESERVED_DTYPE_TOKENS, the single grep target to flip.
FanoutDtypeMismatch
Two operands that both vary (enumerate >1 dtype) in one section disagree on their fan-out dtype list (§3.4 multi-dtype fan-out). ALL varying operands must enumerate the SAME dtype list in the SAME order so the importer can fan the section into one per-dtype binding without silently picking one operand’s list over another’s.
OptionalOperandNotLast
An optional: true operand is NOT the LAST input (§3.4 optional-operand
fan-out). Only the last input may be optional — omitting the last input
yields a CONTIGUOUS valid key ending just before the outputs, whereas an
earlier optional operand would leave a hole in the middle of the key and
mis-align every following operand. This is a typed error, never a silent
mis-key.
PassthroughNamesOptionalOperand
A passthrough(role) output names the OPTIONAL operand as its dtype
source (§3.4 / §5.1). When the optional operand is absent the passthrough
cannot resolve, so its two keys (with / without the operand) would carry
DIFFERENT output dtypes — an output may not derive its dtype from an
operand that can be omitted. A typed error, never a silent mis-key.
UnknownBackend
A backend string did not match any as-built BackendId (§2.1).
UnknownEntryPoint
The entry_point symbol was absent from the provider link
registry (§12.6; P9 — the importer never fabricates a pointer).
UnknownCostFn
A cost.cost_fn NAME was absent from the provider link registry’s
cost-fn table (§4.4 cost-fn trampoline; the cost-model analogue of
Self::UnknownEntryPoint). The importer never fabricates a cost-fn
pointer nor silently falls back to unknown_cost — a named-but-unknown
cost fn is a typed error.
BadLayoutFlag
A layout tri-state flag carried a value outside the legal set
(required / accepted / rejected / n/a); §4.1, §6.
CostExprParse
A cost expression failed to parse against the §2.3 grammar (V-FKC-8, §4.4). Carries the offending field + the raw expression.
PlaceholderPrecision
A precision block is a bare placeholder (no audited, no bounds,
no notes) — there is nothing to lower (§4.8, PlaceholderPrecision).
DuplicateKernelRef(String)
A registration drove the same KernelRef function pointer onto one
(op, dtypes, backend) decision point twice (§3 / V-FKC-3). The
importer never panics on this; it surfaces the
crate::kernel::KernelBindingTable::finalize gate as a typed
error after all inserts. The string carries the dispatch-layer
message (which names the offending (op, dtypes, backend) key).
ProviderMismatch
import_glob collected files whose front-matter disagrees: the
provider.name / provider.backend / provider.kernel_source
must match across every file merged into one provider (§9.2).
Io
A glob / file-read I/O failure (no readable file, an unreadable path, a bad glob pattern). Carries the offending path/pattern + the underlying error text.
UnsupportedVersion
fkc_version is not in the importer’s declared supported set (V-FKC
§10.1; KISS #450 — membership, not a <= max bound, so 0 is rejected).
LayoutIncoherent
Layout flags are mutually incoherent (V-FKC §10.4): neither
contiguous nor strided is acceptable; or broadcast_stride0 /
reverse_strides accepted without strided: accepted.
AwkwardStrategyIncoherent
A per-operand (or kernel-wide) awkward_layout_strategy contradicts
the operand’s own layout flags, or carries an unknown value
(V-FKC §10.5; an unknown value is meaning-bearing per §11.1).
QuantIncoherent
A quant block is internally incoherent (V-FKC §10.6): a GGML_BLOCK
with a ScalePair/granularity, an MX without granularity: PerBlock, an AFFINE_* with a bad granularity, an AFFINE_BLOCK
missing its block geometry, a ggml_dtype that is not a real
GgmlDType variant, a sub-byte operand with no fdx.quant, etc.
ScaleDoubleDeclared
A scale was declared in two places at once (V-FKC §10.6): both an
fdx.quant.scale_operand (separate-input scale) and a sidecar-bundled
scale for the same scale. Each scale lives in exactly one place.
MxNotYetRegistrable
A contract is describable but NOT yet registrable on today’s types
(V-FKC §10.6): MX (no ScaleGranularity::PerBlock) or AFFINE_BLOCK
(no block-quant descriptor target). The contract parse-validates; this
gates it at registration time (§6).
BadOpParamsVariant
An op-param variant is not a real variant in the correct
namespace (V-FKC §10.7): OpParams for an op_kind contract,
FusedOpParams for a fused_op contract (§3.7).
CostProvenanceMissing
The required cost.provenance marker is absent or not one of
{declared, judge_measured} (V-FKC §10.8a; the COST_RULE).
PlaceholderCost
A cost block is a bare / placeholder / zero-sentinel cost under either
provenance marker (V-FKC §10.8a) — not the honest class: free
metadata-only case.
UnauditedPrecision
An audited:false + all-null (UNAUDITED) precision on a non-reference contract (V-FKC §10.9). (Reserved; the lint treats UNAUDITED as a non-fatal note unless a stricter mode is requested.)
BundleSlotRankExceeded
A bundle slot’s shape rule yields rank > 6 (V-FKC §10.13), which the
serialized FDXOutputView ([u64; 6]) cannot represent.
ShapeRuleMismatch
A fused_op contract’s declared §5.1/§5.2 return rule disagrees with the
real registered FusedOpEntry fn at a probe shape (V-FKC-7, Finding 5.1).
expected/actual render either a shape or a dtype.
BundleArityMismatch
A return.bundle slot count disagrees with the registered
output_views arity (V-FKC-7, Finding 5.2).
UnparseableShapeConstraint
A shape_constraint: segment committed to §3.5 vocabulary but its
argument is malformed (rank=banana, an unclosed divisible(, an empty
dim[0]=). Non-vocabulary segments degrade to free text (a warning), not
this error — this fires only on a real authoring mistake in the grammar.
GatherIncoherent
A paged/gather operand is incoherent (V-FKC §10.14): kind: paged_blocks without requires_ext: true / symbolic_extent: required, or block_table/context_lens naming a non-existent
accept.inputs role.
GatherNotYetSupported
A gather-bearing operand reached registration before the FDX gather
codes / Capability::DlpackExtGather landed (V-FKC §10.14; the
MxNotYetRegistrable discipline for gather).
FdxTokenNotInTable
A dtype / quant family / granularity / ggml_dtype token is not a member of FDX’s normative code table (V-FKC §10.16 drift-guard) — so FKC’s token set stays a subset of FDX’s.
UnknownAdmissibilityEnum
An admissibility-affecting enum (extent_kind, gather.kind, quant
family) carried an unknown value (V-FKC §10.5/§10.14/§10.15;
meaning-bearing per §11.1 — a typed error, never a silent default).
MissingBlurb
The structured blurb: does not match the prose blurb when the prose
is available (V-FKC §10.11). Distinct from Self::BlurbMismatch
(which is reserved for the prose-vs-structured comparison wired with
the prose-bearing parse).
Trait Implementations§
Source§impl Error for FkcError
impl Error for FkcError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Forget for FkcError
impl Freeze for FkcError
impl Move for FkcError
impl RefUnwindSafe for FkcError
impl Send for FkcError
impl Sync for FkcErrorwhere
RawVecInner: Sync,
impl Unpin for FkcError
impl UnsafeUnpin for FkcError
impl UnwindSafe for FkcError
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> 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