Latest Results
refactor(sharding): store chunks_per_shard explicitly in _ShardIndex (#3975)
* refactor(sharding): store chunks_per_shard explicitly in _ShardIndex
_ShardIndex previously inferred the chunk grid shape from
offsets_and_lengths.shape[:-1]. For 0-D arrays this collapses the array
to rank-1, breaking methods that assume rank >= 2 and forcing a numpy
compat cast workaround.
Store chunks_per_shard as an explicit NamedTuple field instead. This
removes the chunks_per_shard property and its cast, and lets several
call sites use the field directly instead of reverse-engineering it.
Also fix a latent 0-D bug in is_dense, which iterated offsets_and_lengths
assuming rank-2.
Closes #3974
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* test: parametrize over dimensionalities
* refactor(sharding): store chunks_per_shard explicitly in _ShardIndex
_ShardIndex previously inferred the chunk grid shape from
offsets_and_lengths.shape[:-1]. For 0-D arrays this collapses the array
to rank-1, breaking methods that assume rank >= 2 and forcing a numpy
compat cast workaround.
Store chunks_per_shard as an explicit NamedTuple field instead. This
removes the chunks_per_shard property and its cast, and lets several
call sites use the field directly instead of reverse-engineering it.
Also fix a latent 0-D bug in is_dense, which iterated offsets_and_lengths
assuming rank-2.
Tests for get_chunk_slices_vectorized, _ShardReader.__iter__, and
is_dense are parametrized over chunk grid ranks (0-D, 1-D, 2-D) so 0-D
is exercised as a normal case rather than a special branch.
Closes #3974
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* remove is_dense
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Latest Branches
+40%
d-v-b:perf-sharding-coord-cache +8%
+9%
aldenks:coalesce-shard-reads © 2026 CodSpeed Technology