Skip to content

Evidence methods guide

Zarr Chunk and Fill Metadata Review: Keep Shape, Fill, and Storage Aligned

Review Zarr array metadata, shape, data type, chunk grid, chunk keys, fill values, codecs, and storage paths before reading chunks.

A Zarr array is described by metadata that connects shape, data type, chunk grid, chunk key encoding, fill value, codecs, and store paths. A missing or mismatched field can make an array look readable while changing the meaning of an uninitialized region or the location of a chunk. Start with the version and node type, then check shape to grid rank, fill value to data type, key construction, and codec order. This guide is a metadata worksheet, not an array reader, performance benchmark, scientific interpretation, privacy decision, or permission claim.

Updated

On this page

Confirm the node and metadata version

Record a neutral store ID, root path, metadata file path, digest, Zarr format, node type, and metadata reader version. The Zarr Specification, (opens in a new tab) specification names zarr.json as the array metadata document in v3 and defines mandatory fields. Do not infer v3 from a directory name or accept a v2 field set as if it were v3 without recording the version boundary.

The source dates in this guide use 22 October 2026 as retrieval evidence for documentation without a verified publication date. They are not publication claims. Where a verified publication date is available, it is recorded in the source ledger.

Confirm the node and metadata version (table)
Metadata fieldRecordStop if
zarr_formatDeclared integer and readerVersion is inferred from a library default
node_typeArray, group, or unknownGroup metadata is parsed as an array
shapeOrdered dimension lengthsRank cannot be determined
data_typeDeclared core or extension typeExtension definition is unavailable
chunk_gridGrid name and configurationGrid rank differs from shape
metadata pathResolved path and digestA stale cache replaces the source

Keep v2 and v3 reports separate. Names such as dtype, chunks, or compressor can be useful observations of another version, but translating them to v3 fields is a transformation that needs its own record.

Match shape, chunk grid, and chunk keys

The Zarr Specification, (opens in a new tab) specification defines a logical regular grid and the key encoding that maps grid coordinates to store keys. Compare array rank to chunk-shape rank, verify each logical chunk extent, and derive the expected coordinate-to-key mapping. Then compare that logical expectation with physically stored keys: a present key must resolve to the intended cell, while an absent key may be represented by fill_value and is not automatically a grid gap.

Match shape, chunk grid, and chunk keys (table)
ComparisonSafe observationOpen question
Shape and rankDimension tuple and rankDoes a scalar or empty dimension have special handling?
Chunk shapeLength per array dimensionAre zero-length dimensions handled by the grid?
Logical gridExpected cells and chunk extents from metadataDoes a dimension or chunk shape leave the logical grid undefined?
Stored keysObserved physical keys and resolved coordinatesIs a present key ambiguous, extra, or mapped to the wrong cell?
Absent chunkMissing key plus declared fill behaviorIs absence treated as a gap without checking fill_value?
Chunk keyEncoded coordinate and resolved pathDid a separator or prefix change?
Store pathRelative key under declared rootCould path traversal escape the store?
Dimension namesDeclared names or absentAre names preserved across conversion?

Synthetic v3 metadata

Match shape, chunk grid, and chunk keys code example, JSON
{"zarr_format":3,"node_type":"array","shape":["fixture_rows","fixture_columns"],"data_type":"fixture-float32","chunk_grid":{"name":"regular","configuration":{"chunk_shape":["fixture_row_chunk","fixture_column_chunk"]}},"chunk_key_encoding":{"name":"default","configuration":{}},"state":"metadata-only"}

Keep fill value and codec order together

The Zarr Specification, (opens in a new tab) specification makes fill_value mandatory and says the permitted values depend on the data type. It also defines codecs as bidirectional transforms whose representations change across the pipeline. Record the declared fill value, data type, codec names and configuration in order, and the reader’s decoded representation. Do not replace an absent chunk with a numeric zero unless the metadata says that zero is the fill value for that type.

Keep fill value and codec order together (table)
Storage evidenceRecordStop if
Fill valueExact JSON value and data typeA reader default is not recorded
Codec listOrder, name, and configurationAn extension codec is unknown
Decoded shapeShape and type after each boundaryPipeline output is assumed
Chunk bytesKey, digest, and byte lengthBytes are read without codec context
Missing chunkAbsent, empty, or unreadableMissing is turned into zero without policy
AttributesNames and bounded redacted summariesPrivate text is copied into the packet

A fill value describes uninitialized portions of an array. It does not describe a producer’s missing-data policy, a quality score, or a physical zero. Keep fill behavior, actual stored chunks, and semantic missingness in different columns.

Compare metadata to a bounded read and round trip

Use a synthetic array to exercise metadata validation, key resolution, decode, and re-encode. Capture the source metadata digest, expected chunk coordinates, observed keys, decoded shape and type, and any transformed metadata. A successful read of one chunk does not prove that every expected key exists or that a missing chunk has the intended fill semantics.

Compare metadata to a bounded read and round trip (table)
CheckObserved resultQuestion to resolve
Expected key setDerived keys for the declared gridAre all cells represented?
Existing key setKeys found under the store rootAre extra keys stale or extension data?
Decoded chunkShape, type, and codec resultDid the reader coerce values?
Missing cellMissing key and fill behaviorIs missing equivalent to uninitialized?
Re-encoded metadataChanged fields and digestDid a library normalize the contract?
ExtensionName, definition, and scopeCan another reader reproduce it?

Stop on metadata mismatch

Stop conditions

  • Stop if the Zarr version, node type, metadata path, or extension definition is unknown.
  • Stop if shape, chunk grid rank, chunk shape, or key encoding cannot be reconciled.
  • Stop if a fill value is missing, has the wrong type, or is supplied only by a reader default.
  • Stop if a codec is unavailable, reordered, or applied to bytes with an unknown representation.
  • Stop if a present key maps ambiguously, or if missing, extra, or stale physical keys are treated as logical coverage without recording fill behavior.
  • Stop before reading real chunks when attributes or keys expose private paths or identifiers.

Pair this worksheet with the data provenance log for store and transformation history and the data card template for collection context. Metadata alignment does not prove array completeness, scientific meaning, privacy clearance, or permission.

For a supported non-health collection, after the owner has authority to describe the scope and a controlled metadata packet, the qualified appraisal request path may be a preparation step. It does not read Zarr chunks, benchmark storage, assess scientific meaning, create a quote, match a buyer, or grant a license.

Sources

  1. Zarr Specification: Zarr Version 3 Core Specification (opens in a new tab)
  2. Zarr Specification: Zarr Version 3 Regular Chunk Grid (opens in a new tab)

Use the appraisal path after the Zarr metadata packet is organized.

It does not read Zarr chunks, benchmark storage, assess scientific meaning, create a quote, match a buyer, or grant a license.