13. Conformance and Validation¶
13.1 Conformance Levels¶
A conforming writer produces stores that pass every rule in
§13.2. A conforming reader applies the
reader rules in §13.2 (version, kind, object-index layout,
capabilities) before it interprets any cell.
Validation runs at one of five cumulative levels: level N runs the
checks of levels 1 to N. The reference validator is
zarr_vectors.validate.validate(store, level=N).
Level |
Name |
Checks |
Reads |
|---|---|---|---|
1 |
Structural |
Store opens; root has a |
metadata |
2 |
Metadata |
Root and level field values: version, axes, |
metadata |
3 |
Consistency |
Cells decode; |
every cell |
4 |
Geometry conventions |
|
metadata |
5 |
Pyramid |
Levels numbered |
metadata |
The result lists passed checks, warnings and errors. A warning does not make a store non-conforming.
13.2 Validation Rules¶
Version (§8.12). zv_version
is on the root object. A 0.10.0 reader MUST refuse:
a 0.9.x or older store, recognisable by a root
zarr_vectorsobject with nokind. The refusal SHOULD name the in-place migration (Appendix J);a store whose
zv_versionhas a newer minor version than the reader’s (for example0.11.0);a root
zarr_vectorsobject whosekindis not"root".
Registration
(§8.9).
Every node that carries a zarr_vectors attribute
MUST list the Zarr Vectors convention in zarr_conventions: the full
entry on the root, at least {"uuid": "66268a61-7833-4995-bbcb-233bb417dae5"}
elsewhere. The root MUST also register the multiscales convention
(uuid d35379db-88df-4056-af3a-620245f8e347) and, when it has
proj:projjson, the proj convention (uuid
f17cb550-5864-4468-aeb7-f3180cfb622f). The multiscales block
lists exactly the level groups, with no transform
(§8.10); an ome node, if present,
follows §8.11.
kind. Every zarr_vectors object has a kind. A reader SHOULD
reject a node whose kind it does not recognise, and MUST NOT interpret
it as a known kind. The 0.10.0 values:
Node |
|
|---|---|
Store root |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The arrays inside object_index/ carry no zarr_vectors attribute;
their group describes them.
Object-index layout. object_index’s layout is
vlen_manifests_v1, vlen_manifests_v2 or dense_manifests_v1. A
reader MUST reject a store with any other value, or with none once the
index holds manifests, rather than read it on a best-effort basis:
guessing at an unknown layout yields plausible wrong answers instead of
an error.
Capabilities. An unknown format_capabilities token is a validator
finding, not grounds for a reader to fail; the reader treats the feature
as absent (Appendix H). A
reader SHOULD refuse a store whose required_capabilities lists a token
it does not support, and MUST NOT read an octree-chunked level unless it
supports octree_chunks.
Within each validation level, a representative sample of the checks:
Structural: every name under a
links/<delta>/orlink_attributes/<name>/<delta>/group parses as a valid offsets segment for the family’slink_widthandsid_ndim;chunk_grid_origin, where present, hassid_ndimentries; everynonempty_chunkskey has the array’s rank.Metadata:
zv_versionat least0.10.0; at least twospaceaxes with unique axis names;chunk_shape,boundsandbase_bin_shapehavesid_ndimentries, andchunk_shapeis an integer multiple ofbase_bin_shape;links_convention,object_index_convention,cross_chunk_strategy,cross_level_storage,manifest_layoutandmanifest_block_dtypeare in their enumerations;octree_shardingappears only withshard_shape.Consistency: every
vertex_fragmentscell decodes to aFragmentIndexwhose ranges land within the rows of theverticescell at the same coordinate; manifest blocks reference fragments that exist;nonempty_chunksagrees with the cells present. For every populated link cell: row width islink_width + (1 if has_perm else 0)and the byte length is an exact multiple of one row;has_permequals what the family policy implies (§10.6.5); everyvi_kis within the vertex count of chunksrc + o_k, and that chunk exists at the endpoint’s level. Only the all-zero offsets array atdelta = 0haslink_fragments, with a cell for every cell it populates. Eachlink_attributes/<name>/<delta>/<offsets>cell has as many rows as the matching link cell has records. A dense index hasmanifest_spans,manifest_blocksandobject_idsand nomanifests, and no span reaches pastmanifest_blocks.Conformance: geometry rules — e.g.
meshrequireslinks_convention == "explicit";streamlinerequiresimplicit_sequential.Multi-resolution: per-level
chunk_shape(if set) is a positive integer multiple of root; per-levelbin_shapedivides per-levelchunk_shape;preserves_object_idslevels carryinherited_num_objects.
13.3 Validation Tools¶
Convention JSON Schema: the Zarr Vectors convention publishes a JSON Schema (draft 2020-12) at
https://raw.githubusercontent.com/Andrew-Keenlyside/zarr-vectors/refs/tags/v0.1.0/schema.json, theschema_urlof the root’s registration. Validate eachzarr.jsonthat carries azarr_vectorsattribute against it, with any JSON Schema validator (the convention repository shipsnode validate.js schema.json <zarr.json>). The schema checks one node at a time —kind, required fields, types, enumerations and the registration — and is the normative definition of node metadata. Rules that span nodes (chunk grids, offsets lengths, themultiscaleslayout against the level groups,parent_levelchains) need the validator below.Reference validator:
zarr_vectors.validate.validate(store, level=N)returns aValidationResultwithpassed,warningsanderrorslists. It does not checkzarr_conventionsregistrations or themultiscalesblock; use the JSON Schema for those.LinkML schema: secondary. zarr-vectors-py keeps a LinkML model (
schema/zarr_vectors.linkml.yaml) of the same metadata; where it and the convention’sschema.jsondisagree,schema.jsonwins (Appendix A).
13.4 Compatibility¶
Format versions: 0.10.0 changes only where metadata lives; cell payloads are those of 0.9.4. A 0.9.x reader cannot read a 0.10.0 store, and a 0.10.0 reader refuses a 0.9.x store. A 0.9.x store migrates in place, rewriting only
zarr.jsonfiles, withzarr_vectors.building.migrate_metadata_0_10(path), which rewrites the root last so an interrupted run can be rerun (Appendix J).Zarr — only Zarr v3 is supported. Per-chunk arrays need the
bytesdata type andvlen-bytescodec extensions; arrays sharded withoctree_shardingneed that codec.Zarr conventions — tools that know the multiscales convention can list the levels; tools that know the proj convention can read the CRS.
OME-Zarr — the store is not an OME-Zarr image and has no NGFF
multiscalesblock, so NGFF image viewers do not open it. An OME collection can name it through its RFC 8omenode.TRX — when
sid_ndimcollapses to 1 and the store has a single spatial chunk, the layout aligns conceptually with TRX (positionsoffsets + per-vertex / per-streamline / per-group data); see §14.8. Converters live in
zarr-vectors-tools.