Skip to content

Adopt zarr-python #4028 primitives: read_regions transport + shard-index occupancy fallback #18

Description

@espg

🤖 from Claude

Context

zarr-developers/zarr-python#4028 (in review) adds shards_initialized,
initialized_regions, initialized_chunk_regions, and read_regions. moczarr's
discovery is arithmetic (coverage MOCs, no listings), so these don't replace the MOC
path — they slot in underneath and beside it. Filed now so the flip-list is on record;
blocked on the first zarr-python release carrying #4028.

Integration points

  1. read_regions as the within-leaf transport. moczarr computes populated regions
    from coverage metadata with zero store round-trips; read_regions takes
    caller-supplied regions by design and does the concurrent fetch/decode. For sharded
    leaves (the zagg#233 default), feeding MOC-derived regions to read_regions replaces
    per-leaf assembly plumbing with upstream-maintained concurrency, and the sharding
    codec's partial decode already skips empty inner chunks. (Follow-on to the open_hive: shared store handle — O(leaves) store opens must collapse before thousand-leaf stores #5
    store-handle consolidation: same goal, one more layer collapsed.)
  2. Degraded-path occupancy from shard indexes — posture decision. Today a corrupt
    coverage-bitmap sidecar raises (the D9 family: degrade, never wrong answers — but
    for sidecars we currently have nothing to degrade to). initialized_chunk_regions
    recovers true inner-chunk occupancy from the shard indexes themselves (one small
    range-read per populated shard, no chunk data). Options:
    • keep raising (sidecar corruption stays loud), or
    • degrade to shard-index introspection with a warning — slower but correct, matching
      the "unusable root MOC → walk" posture.
      This is a semantics choice for @espg; the primitive makes the second option cheap to
      implement either way.
  3. Sidecar cross-validation. The bitmap sidecar and the shard index declare the same
    occupancy from different sources (metadata vs. bytes). A test-suite / tools/ check
    that they agree on the fixture store (and optionally an opt-in runtime verify flag)
    turns #4028 into a correctness cross-check on the whole write path, not just a read
    optimization.

Out of scope

  • The hive-tree discovery walk (leaf group discovery) — that's store-level listing of
    the digit tree, not array-level occupancy; #4028 doesn't apply.
  • prototype for negative caching in StoreCache zarr-developers/zarr-python#4042 (CacheStore negative caching) — no moczarr code
    change; at most a docs mention, since the MOC path never issues the empty reads that
    negative caching remembers.

Gating / acceptance

  • zarr-python floor bump to the release carrying #4028 (extra or core dep as
    appropriate).
  • Acceptance: sharded-leaf reads route through read_regions; the sidecar/shard-index
    agreement check runs in CI against the fixture store; posture decision from (2)
    recorded here and implemented or explicitly declined.

Cross-refs: #1 (plan: layers), #5 (store-handle consolidation), englacial/zagg#233,
zarr-developers/zarr-python#4028 / #3929 / #4042.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions