Generate regular GRIB coordinates lazily - #1608
Open
michaeldiener wants to merge 2 commits into
Open
michaeldiener wants to merge 2 commits into
michaeldiener wants to merge 2 commits into
Conversation
michaeldiener
force-pushed
the
codex/grib-lazy-coordinates
branch
from
September 24, 2026 08:22
a92eb5b to
0f77900
Compare
michaeldiener
marked this pull request as ready for review
September 24, 2026 08:42
lesserwhirls
approved these changes
Sep 24, 2026
lesserwhirls
left a comment
Member
There was a problem hiding this comment.
Thank you for this contribution! The trade-off between memory usage and CPU cycles seems well worth it.
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.
Opening a GRIB file currently materializes its regular horizontal coordinate arrays, even when the caller only reads the weather field.
Generate these coordinates through a
ProxyReaderwhen requested, using normal variable caching behavior.This applies to regular projected, latitude/longitude and rotated latitude/longitude axes; Gaussian latitude arrays stay on their existing path.
Section reads generate the requested indexes using the original
start + index * incrementexpression.This preserves the full-array values and rounding, including strided sections, without constructing the whole coordinate first for an uncached axis.
In a 349-field ICON workload that does not read these coordinates, this avoids 3.83 GiB of temporary array allocation.
Validation:
spotlessCheckpasses.Those HTTP 301/400 failures also reproduce using unchanged upstream classes while opening the remote test objects.