diff --git a/src/runtime/mod.rs b/src/runtime/mod.rs index 37b1dff24e324a9cd07455480885b1a47880bc06..34f8bcd79070695e834f42aa20bc2268c07a6b7f 100644 --- a/src/runtime/mod.rs +++ b/src/runtime/mod.rs @@ -93,7 +93,7 @@ struct SpecVal(u16); // native component can freely reflect on how it went, reading the messages received at their // inputs, and reflecting on which of their connector's synchronous batches succeeded. #[derive(Debug)] -struct RoundOk { +struct RoundEndedNative { batch_index: usize, gotten: HashMap, } @@ -265,7 +265,7 @@ struct ConnectorCommunication { endpoint_manager: EndpointManager, neighborhood: Neighborhood, native_batches: Vec, - round_result: Result, SyncError>, + round_result: Result, SyncError>, } #[derive(Debug)] struct ConnectorUnphased { @@ -317,8 +317,8 @@ struct SolutionStorage { // invariant: old_local U new_local solutions are those that can be created from // the UNION of one element from each set in `subtree_solution`. // invariant is maintained by potentially populating new_local whenever subtree_solutions is populated. - old_local: HashSet, - new_local: HashSet, + old_local: HashSet, // already sent to this connector's parent OR decided + new_local: HashSet, // not yet sent to this connector's parent OR decided // this pair acts as SubtreeId -> HashSet which is friendlier to iteration subtree_solutions: Vec>, subtree_id_to_index: HashMap, @@ -406,6 +406,12 @@ impl VecSet { } } impl CurrentState { + fn ports_owned_by(&self, owner: ComponentId) -> impl Iterator { + self.port_info + .iter() + .filter(move |(_, port_info)| port_info.owner == owner) + .map(|(port, _)| port) + } fn spec_var_for(&self, port: PortId) -> SpecVar { let info = self.port_info.get(&port).unwrap(); SpecVar(match info.polarity {