pub struct ExecutionPlan {
pub order: Vec<NodeId>,
pub alternatives: HashMap<NodeId, AlternativeSet>,
pub off_device: HashMap<NodeId, AlternativeSet>,
pub generation: u64,
}Expand description
Per-realize execution plan. Built by compile_plan.
alternatives is sparse — view ops, Op::Const, and ops
op_to_op_kind returns None for get no entry. The executor’s
per-node dispatch reads alternatives.get(&id) and either takes
the winner (top entry after rank) or, in the long-term shape,
hands the full set to the runtime selector (Picker 2) for
layer-3-telemetry-driven choice.
Fields§
§order: Vec<NodeId>Topological order — same shape the executor walks.
alternatives: HashMap<NodeId, AlternativeSet>One AlternativeSet per kernel-bearing node. Sparse.
off_device: HashMap<NodeId, AlternativeSet>Candidates the placement DP priced and then pruned off a node because they sit on a device other than the one it committed (the single-device-set invariant above). Kept so a pathfinder can still see a second placement; nothing on the realize path reads this map. Sparse: only nodes that had off-device candidates.
generation: u64SystemTopology generation counter snapshotted at
compile_plan time. The executor (Phase 4.3) checks this
against crate::dispatch::topology_generation() at every
dispatch-chunk boundary; mismatch surfaces
Error::TopologyChanged so the realize layer can rebuild
the plan against the fresh topology.
0 for ExecutionPlan::empty() — empty plans by definition
have no alternatives to invalidate, so the executor’s chunk-
boundary check skips them.
Implementations§
Source§impl ExecutionPlan
impl ExecutionPlan
Sourcepub fn alternatives(&self, node: NodeId) -> Option<&AlternativeSet>
pub fn alternatives(&self, node: NodeId) -> Option<&AlternativeSet>
Read-only handle to a node’s alternative set. None for
nodes outside the plan’s map.
Sourcepub fn alternatives_mut(&mut self, node: NodeId) -> Option<&mut AlternativeSet>
pub fn alternatives_mut(&mut self, node: NodeId) -> Option<&mut AlternativeSet>
Mutable handle — used by post-plan refinement passes (Phase 3’s Judge integration may re-rank top-N after the plan is built).
Sourcepub fn off_device_alternatives(&self, node: NodeId) -> Option<&AlternativeSet>
pub fn off_device_alternatives(&self, node: NodeId) -> Option<&AlternativeSet>
Candidates of node on devices other than the one the DP committed (pruned from
Self::alternatives). None when there were none.
Trait Implementations§
Auto Trait Implementations§
impl Forget for ExecutionPlan
impl Freeze for ExecutionPlanwhere
*const u8 is !null: Freeze,
PhantomData<NodeId>: Freeze,
PhantomData<(NodeId, AlternativeSet)>: Freeze,
impl Move for ExecutionPlan
impl RefUnwindSafe for ExecutionPlanwhere
Candidate: RefUnwindSafe,
impl Send for ExecutionPlan
impl Sync for ExecutionPlan
impl Unpin for ExecutionPlan
impl UnsafeUnpin for ExecutionPlanwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<NodeId>: UnsafeUnpin,
PhantomData<(NodeId, AlternativeSet)>: UnsafeUnpin,
impl UnwindSafe for ExecutionPlan
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