Repository navigation
feat[next]: open named slices, one const-list dimension and other preparations for dimension classes - #3087
Open
egparedes wants to merge 9 commits into
Open
feat[next]: open named slices, one const-list dimension and other preparations for dimension classes#3087egparedes wants to merge 9 commits into
egparedes wants to merge 9 commits into
Conversation
A named slice may omit a bound, e.g. `field[I(1):]` or `field[:I(3)]`: the open side selects up to the field's own bound, and so does every infinite side of a `NamedRange` or `Domain` used as an index. Closed bounds outside the field still raise `IndexOutOfBounds`. A named slice may now be combined with named indices and ranges in one index tuple, as `NamedRange` already could. A step other than 1 raises instead of being silently dropped, and so does a slice mixing a named bound with an integer bound.
`str(Infinity.POSITIVE)` is now `inf` (`-inf` for the negative member), so an infinite range prints as `(-inf:inf)` in domains and error messages. The repr is the expression evaluating to the member, `Infinity.POSITIVE`, and `UnitRange.__repr__` uses it, so `repr` of a range evaluates back to it.
The embedded iterator backend and the DaCe lowering each declared an equal `_CONST_DIM` for the lists `make_const_list` produces. Both now use `CONST_LIST_DIM`, declared next to `make_const_list` in `iterator/builtins.py`. Its value stays `_CONST_DIM`.
…ted IR An axis literal of a LOCAL dimension (e.g. from `broadcast(a, (Vertex, V2EDim))`) was printed without a kind suffix and parsed back as a symbol reference. It now prints with the suffix `ₗ`. The names in axis and offset literals were restricted to ASCII by the parser, while the printer emits any dimension or offset name. They now accept any Python identifier.
…nts to the bindings The translation records the offset-provider keys of the connectivity tables the SDFG takes as arguments in `SDFGCodeSpec.connectivity_keys`, and the bindings look the tables up by these keys instead of decoding them from the array names. A connectivity argument without a key raises, rather than leaving a stale table pointer on fast-call.
`LoopBlocking`, `MapIterationOrder` and `VerticalSplitMapRange` each turned a dimension option into its map variable with their own `isinstance` check; they now share `as_map_variable`. Like `MapIterationOrder`, `LoopBlocking` accepts a single dimension or map variable name instead of a sequence (a single name was iterated character by character).
`common.cartesian_shift(dim, offset)` returns the integral index offset and the codomain of a Cartesian (possibly half-integer) shift. The frontend type deduction and the lowering to GTIR use it instead of building a `CartesianConnectivity` only to read its fields, and `connectivity_for_cartesian_shift` delegates to it, so the staggering rule lives in one place.
…sides Also test `LoopBlocking` with a single name of more than one character.
egparedes
marked this pull request as ready for review
December 4, 2026 13:36
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
⚙️ Agent run details
|
This branch was successfully deployed
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.
Small, independent changes to
gt4py.nextthat the dimension-classes work (#2899) exposed. Each one stands on its own onmain:field[I(1):]andfield[:I(3)]select up to the field's own bound; before, a missing bound raised. Every infinite side of aNamedRangeorDomainused as an index is an open bound too (before, it raisedIndexOutOfBounds), and named slices can be combined with named indices and ranges in one index. A slice step other than 1 is now rejected instead of silently dropped, and mixing a named slice with relative indices raises.InfinityandUnitRangeprinting.str(Infinity.POSITIVE)isinf;reprof aUnitRangespells its infinite bounds.make_const_listiniterator/builtins.py, instead of two equal declarations initerator/embedded.pyand the DaCe lowering.SDFGCodeSpec.connectivity_keys) instead of decoding them from array names.as_map_variablehelper replaces three copies of the same conversion, andLoopBlockingaccepts a single dimension or map variable name, asMapIterationOrderdoes.cartesian_shift(dim, offset)gives the index offset and codomain of a Cartesian shift, so the frontend no longer builds aCartesianConnectivityonly to read them.🤖 Written by an agent on my behalf.