refactor: remove random subchunk ordering#4011
Merged
Merged
Conversation
* feat: subchunk write order * chore: export `SubchunkWriteOrder` * chore: docs * chore: relnote * rename * refactor: no enums * Update docs/user-guide/performance.md Co-authored-by: Davis Bennett <davis.v.bennett@gmail.com> * feat: deterministic but random order * fix: make vectorized fetching less reliant on matching order * chore: add hypothesis * refactor: dead code * refactor: more cleanup * don't shard unless there is something to shard * fix: dont mix chunk grid and sharding --------- Co-authored-by: Davis Bennett <davis.v.bennett@gmail.com> (cherry picked from commit 093a153)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…hrough pickle Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…_write_order The hypothesis arrays() strategy passed both shards= and a ShardingCodec serializer, which nested the codecs and left subchunk_write_order governing only a 1-element inner grid. Drive sharding through the serializer alone. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…sted Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… FIXME Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ering Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Resolves conflicts in the sharding codec, strategy, tests, docs, and changelog by keeping this branch's rng-free implementation (unordered = no-promise) over the incoming original feature commit (093a153), which reintroduced the rng. Non-sharding incoming changes (string dtype pruning, metadata fixes) merged cleanly and are kept.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4011 +/- ##
==========================================
- Coverage 93.55% 93.53% -0.02%
==========================================
Files 88 88
Lines 11896 11894 -2
==========================================
- Hits 11129 11125 -4
- Misses 767 769 +2
🚀 New features to boost your workflow:
|
6 tasks
ilan-gold
approved these changes
Jun 3, 2026
These changes were patching a latent bug in `arrays()` where ShardingCodec-as-serializer was being double-stacked with `shards=...`, producing nested sharding. Splitting to a follow-up PR so this one stays focused on removing the `rng`/random-subchunk-order surface. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d-v-b
added a commit
to d-v-b/zarr-python
that referenced
this pull request
Jun 5, 2026
After merging zarr-developers#4011 (which made 'unordered' deterministic and warns callers not to rely on its layout), drop the two places my earlier fixes special-cased it by name: - Byte-range write fast path: remove the 'subchunk_write_order != unordered' gate. The rank map is derived from _subchunk_order_iter(self.subchunk_write_ order), which is the single source of truth for physical layout — correct for every order without a name check. _subchunk_order_iter is the only place that knows a given order's layout. - Parity test: assert byte-equality across pipelines for ALL orders, not just 'deterministic' ones. The check verifies the two pipelines AGREE (they share _subchunk_order_iter), which holds whatever an order resolves to; it makes no assumption about what 'unordered' means. 540 parity+sharding and 862 codec/indexing tests pass under both pipelines; mypy clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
This PR reverts the addition of random subchunk ordering in the sharding codec which was introduced in #3826. After this PR, choosing "unordered" will write chunks lexicographically but only as an implementation detail.