Repository navigation
Layer definitions with paths instead of names #1081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
090e5c0
83e128b
4d46e6c
8c4d802
0a8bb2c
34a340c
9b62cf6
b22f973
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,8 +77,8 @@ namespace phlex::detail { | |
| fold_join_node(tbb::flow::graph& g, | ||
| phlex::experimental::algorithm_name const& node_name, | ||
| phlex::experimental::identifier const& stage, | ||
| phlex::experimental::identifier const& partition_layer_name, | ||
| std::vector<phlex::experimental::identifier> layer_names, | ||
| phlex::experimental::layer_path const& partition_layer_name, | ||
| std::vector<phlex::experimental::layer_path> layer_names, | ||
| phlex::experimental::product_specifications output, | ||
| result_initializer_t result_initializer) : | ||
| base_t{g}, | ||
|
|
@@ -132,27 +132,22 @@ namespace phlex::detail { | |
| // | ||
| // The first entry is the *partition slot* — it routes the partition index to the | ||
| // accumulator's index_port and delivers the partition-level flush token to the | ||
| // accumulator's flush_port. Its routing layer is the partition layer (e.g. "job"), | ||
| // but its counting layer is currently the first input data layer. | ||
| // accumulator's flush_port. Its routing layer is the partition layer (e.g. "job"). | ||
| // | ||
| // The remaining entries are the data-input slots, one per repeater. For these the | ||
| // routing layer and counting layer are the same: the repeater both routes and counts | ||
| // at its own input layer. | ||
| // The remaining entries are the data-input slots, one per repeater. | ||
| // | ||
| // TODO: For multi-input folds, the counting layer must be the deepest input layer | ||
| // in the data hierarchy. Until the router exposes a depth comparison, we pick | ||
| // layers_[0]; this is only correct when the first input is at the deepest layer. | ||
| // No slot sets a counting layer, so the router counts at the node's deepest input layer. | ||
| std::vector<named_index_port> index_ports() | ||
| { | ||
| std::vector<named_index_port> result; | ||
| result.reserve(1 + repeaters_.size()); // +1 for the result repeater | ||
| result.emplace_back(partition_layer_, | ||
| layers_[0], | ||
| std::nullopt, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| &result_repeater_.flush_port(), | ||
| &result_repeater_.index_port()); | ||
| for (std::size_t i = 0; i != repeaters_.size(); ++i) { | ||
| result.emplace_back( | ||
| layers_[i], layers_[i], &repeaters_[i]->flush_port(), &repeaters_[i]->index_port()); | ||
| layers_[i], std::nullopt, &repeaters_[i]->flush_port(), &repeaters_[i]->index_port()); | ||
| } | ||
| return result; | ||
| } | ||
|
|
@@ -164,8 +159,8 @@ namespace phlex::detail { | |
| // Immutable after construction; tbb::flow::join_node is already non-movable. | ||
| // NOLINTBEGIN(cppcoreguidelines-avoid-const-or-ref-data-members) | ||
| phlex::experimental::algorithm_name const name_; | ||
| phlex::experimental::identifier const partition_layer_; | ||
| std::vector<phlex::experimental::identifier> const layers_; | ||
| phlex::experimental::layer_path const partition_layer_; | ||
| std::vector<phlex::experimental::layer_path> const layers_; | ||
| // NOLINTEND(cppcoreguidelines-avoid-const-or-ref-data-members) | ||
| }; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not infer an input product's path from another input's selector.
Consider product A at
/job/run/eventand product B at/job/run/event/event. Select A with/job/run/eventand B withevent, using distinct creators.This assignment changes B's selector to
/job/run/event. Provider matching then rejects B, so the ancestor/descendant algorithm loses a required input. This also makes leaf selection depend on unrelated input declarations.Resolve each product's eligible paths before normalization. Preserve the descendant match while keeping compatible same-layer selectors supported.