mod sorter¶
- module sorter¶
Structs and Unions
- struct EdgeRec¶
The fields of
noob.edge.Edgethe sorter cares about. The boundary layer is responsible for extracting these from python.- source_node: String¶
- source_signal: String¶
- target_node: String¶
- required: bool¶
Traits implemented
- struct NodeFlags¶
The fields of
noob.node.NodeSpecificationthe sorter cares about.statefulisbool | Nonein python -None(unresolved) is treated as stateless, seeNodeFlags::is_stateful.- enabled: bool¶
- stateful: Option<bool>¶
Implementations
- struct NodeRec¶
- nqueue: i64¶
- successors: FxIndexSet<ItemID>¶
- predecessors: FxIndexSet<ItemID>¶
- optional_predecessors: FxIndexSet<ItemID>¶
- optional_successors: FxIndexSet<ItemID>¶
- struct Sorter¶
Port of
noob.toposort.TopoSorter, operating on interned item ids.Uses
IndexSet/IndexMaprather than the std hash containers because their iteration is deterministic (reproducible scheduling and directly comparable test output, where std’s per-instance random hash seeds are not) and iterates a dense vec rather than sparse hash buckets. These sets are iterated constantly.- signals: FxHashMap<ItemID, FxIndexSet<ItemID>>¶
node item id -> signal items emitted by that node that the graph depends on
- info: FxIndexMap<ItemID, NodeRec>¶
mirrors
TopoSorter._node2info
- ready: FxIndexSet<ItemID>¶
- out: FxIndexSet<ItemID>¶
- done: FxIndexSet<ItemID>¶
- disabled: FxIndexSet<ItemID>¶
- ran: FxIndexSet<ItemID>¶
- npassedout: i64¶
- nfinished: i64¶
Implementations
- impl Sorter¶
Functions
- fn add(&mut self, interner: &mut Interner, node: ItemID, predecessors: &[ItemID], required: bool) -> CoreResult<()>¶
- fn clone_state(&self) -> SorterState¶
Get a cloned version of the internal sorter state This is an expensive method, since it clones… everything To be used when debugging
- fn done(&mut self, interner: &Interner, nodes: &[ItemID]) -> CoreResult<()>¶
- fn from_graph(interner: &mut Interner, nodes: &FxIndexMap<String, NodeFlags>, edges: &[EdgeRec]) -> CoreResult<Sorter>¶
Port of
TopoSorter.__init__from a node map and edge list
- fn is_active(&self) -> bool¶
- fn mark_out(&mut self, nodes: &FxIndexSet<ItemID>)¶
- fn resurrect(&mut self, interner: &Interner, nodes: &[ItemID]) -> CoreResult<()>¶
- fn source_nodes(&self) -> FxIndexSet<ItemID>¶
Nodes within the graph that have no dependencies (except PREVIOUS_EPOCH)