Expand description
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.
For every op adopted at
runtime (JIT-synthesized or import-time), it scans the base map for
subgraphs whose shape matches the op’s region
(fuel_graph::jit::match_region) and offers each match as a gated
Op::Branch via offer_runtime_fused_arm — arm 0 stays the region’s
existing primitive subgraph (the correctness oracle), arm 1 is the
synthesized kernel, offered only when
fused_kernel_available_in
gates it open (reading the OptimizationContext-threaded binding table,
never re-acquiring the global lock). Same constitutional posture as
crate::decode_flash: the
optimizer emits/prunes arms, backends never decide, and a graph with no
adopted runtime op (or no structural match) is left byte-identical.
v1 scope mirrors fuel_graph::runtime_fused’s own v1 note: every offered
arm is pinned to BackendId::Cpu. A runtime op can be adopted for
multiple backends (adopt_runtime_fused is called once per backend), so
picking the right one — and potentially offering more than one fused
arm per match — is a follow-up; see the module-level “unsure” note in the
session report.
Structs§
- Runtime
Fused ArmPathfinder - The registered
Pathfinderwrapper aroundemit_runtime_fused_arms. Ignoresctx’s ranked plan / dispatch order: a runtime-op region match is a purely structural question over the whole base map, independent of placement — the same reasoncrate::decode_flash’s arm is emitted by a dedicated call site rather than readingctx.plan.
Functions§
- emit_
runtime_ fused_ arms - Scan
graphfor subgraphs matching an adopted runtime fused op’s region and offer each as a gatedOp::Branch(seeoffer_runtime_fused_arm). Returns the number of arms emitted —0for a graph with no adopted runtime op, or none whose region structurally matches anywhere in it.