Skip to main content

Crate fuel_dispatch

Crate fuel_dispatch 

Source
Expand description

§fuel-dispatch

Dispatch infrastructure for fuel — extracted from fuel-storage 2026-05-31 per the picker-work phasing (docs/session-prompts/dispatch-move-to-fuel-core.md).

§What lives here

  • KernelBindingTable + registration wrappers — backends register their per-(op, dtypes, BackendId) kernels into a process-wide table. The picker / optimizer queries this table to enumerate candidate alternatives at each graph decision point.
  • CompiledNode + compile_node — the dispatch-time (KernelRef, KernelCaps, OpParams) resolution result that the executor invokes.
  • ExecutionPlan + compile_plan + PlanOptions — Phase 1.5 reshape of the plan-time picker around per-decision-point AlternativeSets. Replaced the pre-1.5 NodeKernelBinding/ TolerancePolicy/resolve_kernel triple (which had zero executor consumers; the verified-empty consumer list let the rewrite ship without breakage).
  • FusedKernelRegistry + PrecisionGuarantee + KernelRevisionHash — fused-op dispatch substrate.
  • PipelinedExecutor — the production executor that walks a graph, calls compile_node per kernel-bearing node, and runs the resolved KernelRef against the input/output Storage Arcs.
  • Cost functions — Layer-1 static cost estimates per op family; the optimizer composes these along candidate routes.
  • Cast fusion rule — cast-elision graph rewrite (lives near dispatch because it inspects binding-table coverage).

§What’s NOT here

  • BackendStorage enum + Storage wrapper — stays in fuel-storage until retired via Phase 0.2c (move to fuel-core-types).
  • SystemTopology + Judge + ProbeReport — stays in fuel-core today; Phase 1’s optimizer ranker will decide whether to relocate.
  • Backend-specific kernels themselves — those live in their backend crates (fuel-cpu-backend, fuel-cuda-backend, fuel-vulkan-backend). This crate hosts the dispatch wrappers that bridge erased Storage ↔ typed backend storage.

Re-exports§

pub use compiled::CompiledNode;
pub use compiled::Completion;
pub use compiled::CompletionHandle;
pub use compiled::compile_node;
pub use compiled::dispatched_kernel_ident;
pub use compiled::execute_compiled;
pub use driver::FrontierConvergenceOptimizer;
pub use driver::OptimizationContext;
pub use driver::Optimizer;
pub use driver::PassRegistry;
pub use driver::Pathfinder;
pub use driver::PlacementForkPathfinder;
pub use kernel::KernelBindingTable;
pub use kernel::KernelDTypes;
pub use kernel::KernelRef;
pub use kernel::OpParams;
pub use optimize::OptimizedGraph;
pub use optimize::optimize_graph;
pub use pipelined::PipelinedExecutor;
pub use plan::ExecutionPlan;
pub use plan::PlanOptions;
pub use plan::compile_plan;
pub use ranker::AlternativeFilter;
pub use ranker::AlternativeSet;
pub use ranker::BitStablePreferenceFilter;
pub use ranker::Candidate;
pub use ranker::CapabilitiesLookup;
pub use ranker::CouplingAdjustment;
pub use ranker::FilterClass;
pub use ranker::FilterContext;
pub use ranker::HashMapJudge;
pub use ranker::JudgeOracle;
pub use ranker::KEEP_PER_DEVICE;
pub use ranker::PrecisionFloorFilter;
pub use ranker::PrecisionRequirement;
pub use ranker::StridedInputPreferenceFilter;
pub use ranker::TransferEstimator;
pub use ranker::apply_filter_chain;
pub use ranker::apply_inbound_transfer_costs;
pub use ranker::composite_ns;
pub use ranker::compute_static_costs;
pub use ranker::default_chain;
pub use ranker::enumerate_candidates;
pub use residency::EvictReload;
pub use residency::LiveRange;
pub use residency::ResidencyPlanner;
pub use residency::ResidencyReport;
pub use residency::insert_residency_evictions;

Modules§

cast_fusion
Cast-fusion capability predicate — builds the fuel_graph::opt::CapabilityPredicate consumed by CastFusionRule from the live KernelBindingTable.
compiled
Compiled-node representation. Phase 7.5 B4 (interface only).
cost
Phase 7.6 step 8 — Layer-1 cost model for primitive ops.
decode_flash
Decode flash-arm emission — the safe, gated Op::Branch that makes the CUDA flash_decoding binding (commit f693da2c) reachable in decode.
dispatch
Capability-driven dispatch tables. Phase 7.5 A5.
driver
The optimize_graph lock-step pass driver — Phase B PR-B3 of the “plan IS the graph” rebuild (../../docs/session-prompts/plan-is-graph-rebuild.md capability 5; ../../docs/architecture/04-optimization.md §“The two-stage transformation”, §“Relationship to PR 3”).
fkc
FKC kernel-contract importer (fkc)
fused
FusedOpRegistry — kernel-side payload. Phase 7.6 step 1 (skeleton).
fused_cost
Fused-op Layer-1 cost composed from its decomposition (docs/session-prompts/fused-op-cost-from-decompose.md).
judge_cache
Ranked dispatch tables — Phase 6b’s O(1) runtime lookup.
judge_report_path
The on-disk path for the Judge’s persisted fuel_ir::dispatch::ProfileReport.
kernel
Kernel reference + op parameters + binding table. Phase 7.5 B1+B5.
optimize
optimize_graph — the new “plan IS the graph” entry point.
pipelined
Pipelined compile + execute. Phase 7.5 B4.
plan
Execution plan — per-realize compilation output, Phase 1.5 reshape of the picker-work arc.
ranker
Optimizer ranker (Picker 1) substrate — Phase 1.1 of the picker-work arc.
residency
Residency analysis + eviction for the pipelined executor.
runtime_fused_arm
Runtime-fused-op arm emission — the gated Op::Branch that makes an adopted (JIT-synthesized / imported) fused op reachable, mirroring crate::decode_flash.
runtime_fused_kernels
Runtime fused-op kernel registration — the adopt/gate facade over the ONE binding registry.
runtime_fused_pathfinder
Runtime-fused-op arm pathfinder — the match-finder crate::runtime_fused_arm’s module doc names as its remaining half: “the pathfinder that finds matches + splices reconverge points registers it into optimize_graph.” This module is that pathfinder.
topology
SystemTopology — single source of truth for what backends exist, what devices they target, which backends share Storage substrate, and what transfer paths connect devices.
variant_bake
Optimize-time kernel-variant baking — the same-device arm selector.

Macros§

register_fused
Register a BackendImpl into a FusedKernelRegistry via the step-6 macro shape. Hides the boilerplate of constructing the BackendImpl struct so registration sites read as a flat list of (id, backend, dtypes, kernel, cost, precision) tuples.