Expand description
Runtime fused-op kernel registration — the adopt/gate facade over the ONE binding registry.
The transitional FusedOpId-keyed kernel sidecar that used to live here
is folded (the 2026-07-08 decisions-log end-state): a runtime kernel now
registers into the global binding table
(crate::dispatch::extend_global_bindings) under
BindingKey::RuntimeFused, exactly like a startup kernel registers under
BindingKey::Static — same table, same entry shape, same dtype-keyed
dispatch lookup. This module keeps the runtime-op-shaped API
(adopt_runtime_fused, fused_kernel_available,
lookup_runtime_kernel) so callers stay id-oriented, but there is no
second registry behind it.
Cost note: a runtime row is stored with the binding-native unknown_cost
sentinel (never a lying zero). Deriving its Layer-1 estimate from the op’s
recipe (decompose_region, keyed by the RuntimeFused id in the binding
key — no stored closure needed) is the plan-path pricing follow-up; today a
runtime arm is sparse-skip unpriced there, which is safe (arm 0 stays the
runnability fallback).
Structs§
- Runtime
Kernel Binding - A runtime-fused binding row, as
lookup_runtime_kernelreturns it — a diagnostic/test view (dispatch resolves dtype-precisely through the binding table itself; seecompile_one’sis_runtimearm).
Enums§
- Fused
Lookup Miss - Why a runtime-fused lookup returned no kernel. Two distinct facts, kept
distinct: an
Optionwould make them indistinguishable, and they have different fixes — not bound means register one, ambiguous means say which signature you want.
Functions§
- adopt_
runtime_ fused - Adopt a synthesized/imported runtime fused op: register its recipe (the
region) in thefuel-graphmetadata sidecar and bind its kernel in the global binding table, then return the freshly-allocated runtimeFusedOpId. After this the capability gate sees the op as fusable onbackend, and the executor’sis_runtimearm resolves it dtype-precisely from the same table every static kernel lives in. - fused_
kernel_ available - The capability predicate the optimizer’s gate consults: is there an
admissible kernel for
(id, backend)— static or runtime-registered? The dispatch layer passes|id| fused_kernel_available(id, backend)tocapability_gated_rules, so a runtime op fuses only once its kernel is bound. Id-level (coarse) by design; the dtype-precise check is the dispatch-time binding lookup itself. - fused_
kernel_ available_ in - Table-passing variant of
fused_kernel_available— reads the CALLER’S binding table (the oneoptimize_graphalready holds, threaded viaOptimizationContext::bindings) instead of re-acquiringglobal_bindings(). This is the non-nesting gate: a background adopt’sglobal_bindings()WRITE can never queue between two reads this function takes, because it takes none —tableis a plain reference the caller already resolved. - lookup_
runtime_ kernel - The runtime-fused binding for
(id, backend)when exactly one dtype tuple is registered. - register_
runtime_ kernel - Bind a kernel for a runtime fused op (id
>= RUNTIME_FUSED_BASE) into the global binding table underBindingKey::RuntimeFused(id).dtypesis the per-operand tuple (inputs in order, then output) — the same key shape every static registration uses.