fix[next]: canonical order for gather output dims#2627
Open
havogt wants to merge 1 commit into
Open
Conversation
`return_type_field` (frontend) and `_gather_output_domain` (embedded) built the gather output in insertion order. When a connectivity introduces a dim of a different kind than the codomain it replaced (e.g. a vertical iteration axis while a local dim survives), insertion order is non-canonical: the result is rejected by `check_dims` / mismatches the out field, and runtime and frontend can disagree. Return both outputs via `order_dimensions` so they agree on a canonical, valid field domain. The frontend deduces the dims as the set `(field.dims - source) | target`; the source dim survives iff it reappears in the target. Tests: vertical-axis canonicalization regressions (frontend + embedded), update the raw-premap tests to expect canonical order, and a guard that same-dim connectivities (V2V) keep the source dim.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
return_type_field(frontend type deduction) and_gather_output_domain(embedded runtime) built the gather output domain in insertion order. When a
connectivity introduces a dimension of a different kind than the codomain it
replaced (e.g. a vertical iteration axis while a local dimension survives),
insertion order is non-canonical: the result is rejected by
check_dims/mismatches the out field, and the runtime- and frontend-deduced dimensions can
disagree.
Both now order their dimensions through
common.order_dimensions, so runtimeand frontend agree on a canonical, valid field domain.
Tests: vertical-axis canonicalization regressions (frontend + embedded), the
raw-premap tests updated to expect canonical order, and a guard that same-dim
connectivities (V2V) keep the source dimension.
Requirements