pub struct CostBlock {
pub provenance: Option<String>,
pub class: Option<String>,
pub cost_fn: Option<String>,
pub flops: Option<String>,
pub bytes_moved: Option<String>,
pub overhead_ns: Option<Value>,
pub memory: Option<CostMemory>,
}Expand description
Cost block (§4.4). Coefficient EXPRESSION fields stay String — FKC’s own
parser reads them later, NOT YAML. ~ (YAML null) deserializes to None.
Fields§
§provenance: Option<String>declared | judge_measured — REQUIRED, both first-class (§4.4).
class: Option<String>Coarse relative cost class bucket (§4.4).
cost_fn: Option<String>Names a REGISTERED cost fn to PIN as the binding’s CostFn (§4.4
cost-fn trampoline, Task-F). When present the importer resolves this
name through the provider’s LinkRegistry
(crate::fkc::LinkRegistry::resolve_cost_fn) and registers the
binding with THAT CostFn instead of the unknown_cost sentinel — so
the fill_unset_cost_for_backend pass does NOT overwrite it with the
op/backend default. This is the mechanism that lets a contract pin a
real, shape-aware cost model (e.g. the CUDA flash_decoding static
infeasibility gate cost_flash_decoding_cuda). An unresolved name is a
typed crate::fkc::FkcError::UnknownCostFn import error (never a
silent fallback). The name is opaque here (a String, disarming Norway);
the coefficient-expression fields below stay independent. Additive
(§11; no deny_unknown_fields). Serde key cost_fn.
flops: Option<String>Symbolic FLOPs expression over shape/param symbols (§4.4).
bytes_moved: Option<String>Symbolic bytes-moved expression (§4.4).
overhead_ns: Option<Value>Launch overhead. May be a literal number or ~; kept as a raw scalar.
memory: Option<CostMemory>Per-tier memory footprint (§4.4) — [consumer-ahead] beyond device_bytes.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CostBlock
impl<'de> Deserialize<'de> for CostBlock
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for CostBlock
impl RefUnwindSafe for CostBlock
impl Send for CostBlock
impl Sync for CostBlock
impl Unpin for CostBlock
impl UnsafeUnpin for CostBlock
impl UnwindSafe for CostBlock
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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