-
Notifications
You must be signed in to change notification settings - Fork 257
compiler: Fix issue #2235 #2996
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -411,6 +411,38 @@ def dspace(self): | |
| # Dimension-centric view of the data space | ||
| intervals = IntervalGroup.generate('union', *parts.values()) | ||
|
|
||
| # A SubIterator such as a ModuloDimension has offsets that are only | ||
| # meaningful relative to its own bounded, circular iteration (e.g., | ||
| # `t -> t+1` always safely wraps around a 2-slot buffer). `promote` | ||
| # (below) reinterprets such offsets, unchanged, against the parent | ||
| # Dimension (e.g. `t -> time`) so that e.g. halo/OOB computations | ||
| # elsewhere still see a `time`-keyed Interval. But when some *other* | ||
| # Function is natively -- and exactly -- defined over that same | ||
| # parent Dimension (e.g., a `save`-mode TimeFunction, whose data | ||
| # space along `time` is precisely its own declared shape), unioning | ||
| # in a merely-promoted upper offset incorrectly inflates the | ||
| # native Function's bound, which then propagates into e.g. the | ||
| # default `time_M` (too small by the promoted offset -- issue | ||
| # #2235). The upper bound is therefore restricted to only the | ||
| # natively-defined contributions whenever there is at least one. | ||
| # The lower bound doesn't need the same treatment: `_arg_values` | ||
| # only ever tightens it for a genuinely negative offset | ||
| # (`min(interval.lower, 0)`), which a promoted SubIterator | ||
| # contributes correctly regardless of the promotion | ||
| natives = {f: IntervalGroup([i for i in v if i.dim in f.dimensions], | ||
| relations=v.relations, mode=v.mode) | ||
| for f, v in parts.items()} | ||
| natives = {f: v for f, v in natives.items() if v} | ||
|
Comment on lines
+432
to
+435
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. likely just |
||
| if natives: | ||
| native_intervals = IntervalGroup.generate('union', *natives.values()) | ||
| rebuilt = [ | ||
| Interval(i.dim, i.lower, native_intervals[i.dim].upper, i.stamp) | ||
| if i.dim in native_intervals else i | ||
| for i in intervals | ||
| ] | ||
| intervals = IntervalGroup(rebuilt, relations=intervals.relations, | ||
| mode=intervals.mode) | ||
|
|
||
|
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. OK so I got to this point and I have a very simple question; if there are both nonsaved- and saved-TimeFunction, instead of this pretty complicated logic, why don't you simply filter the nonsaved TimeFunctions off |
||
| # E.g., `db0 -> time`, but `xi NOT-> x` | ||
| intervals = intervals.promote(lambda d: not d.is_Sub) | ||
| intervals = intervals.zero(set(intervals.dimensions) - oobs) | ||
|
|
||
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.
This line is where this comment starts becoming hard to understand
IMO, this whole comment could be replaced by a strightforward example, such as
should be a 3~4 lines long comment with an example to stand the change of getting understood. Otherwise, a simple :