L3: Consistency validation¶
Terms¶
- Consistency check
A check that reads array data and verifies that one array agrees with another. L3 reads every chunk of every level.
- Directory-name invariant
A property L3 checks by parsing an
<offsets>array name instead of reading records (see Links).
Introduction¶
L3 reads every chunk and checks that the arrays agree with one another. It catches writer bugs, rechunking errors and hand edits. Its cost grows with the store.
Technical reference¶
L3 is validate_consistency in zarr_vectors/validate/consistency.py.
Each check adds a message to the ValidationResult (see
Validation overview). Malformed
fragment-index blobs show up as decode errors. Messages start with
resolution_N:, left out below.
Levels and chunks¶
Check |
Severity |
Message |
When it fires |
|---|---|---|---|
The level opens |
error |
|
|
The level has chunks; otherwise the level is skipped |
warning |
|
|
The chunk’s vertices decode |
error |
|
|
The fragments tile the vertex buffer |
error |
|
level has |
Intra-chunk links are filed by vertex fragment |
error |
|
level has |
Each fragment is 2-D with |
error |
|
|
No fragment has NaN or Inf |
warning |
|
|
|
error |
|
level has |
|
warning |
|
level has |
A chunk has no more fragments than bins |
error |
|
point cloud only (below) |
Each fragment’s points lie in its bin (tolerance |
warning |
|
point cloud only (below); first three chunks of each level |
The two bin checks run only when geometry_types has point_cloud and
no line, polyline, streamline, graph, skeleton or mesh, the
level has no object_index/, and some axis has more than one bin per
chunk. Bins per chunk come from the level’s chunk shape and a bin shape:
at level 0 the root base_bin_shape; at a coarser level its own
bin_shape. A coarse level that records no bin_shape skips both
checks, as do bins that do not tile the chunk.
Object index¶
Check |
Severity |
Message |
|---|---|---|
A dense index ( |
error |
one per problem, such as |
Every manifest entry names a chunk present at the level |
error |
|
Every manifest entry’s fragment index is below the chunk’s fragment count |
error |
|
A level whose manifests cannot be read gets no message.
Links¶
Each links/<delta>/ family is checked with the link_width,
sid_ndim, directed and store of its group. A family whose metadata
cannot be read, or whose sid_ndim is 0, is skipped. All findings
are errors; messages start with links[delta=<d>].
Check |
Message |
When it fires |
|---|---|---|
The |
|
|
No offset is lexicographically negative |
|
undirected, |
The offsets in a name are non-decreasing |
|
undirected, |
|
|
the family records it |
Each record’s source chunk (endpoint 0) is present |
|
|
Every other endpoint’s chunk is present |
|
|
Octree levels¶
A level with octree chunks replaces all the checks above with these. All are errors unless marked.
The level is not part way through a conversion.
The leaf and cell tables read. Every leaf, and nothing else, has a vertex chunk at its anchor, with the vertex and fragment counts both tables give. The cell table names only existing leaves.
vertex_countmatches the leaves.Manifests name a leaf’s anchor and a fragment it holds.
There is no cross-level link family. Each link joins stored leaves at rows they hold;
num_physical_recordsmatches.vertices/carries the octree marker codec (warning).No leaf is wider than
max_leaf_cells. On a sharded level each leaf lies inside one shard (warning when nomax_leaf_cellsis set; not checked for a level converted withfit_shards=False).
Example¶
A line store with one vertex chunk deleted and a wrong
num_physical_records:
Level 3 validation: FAIL
23 passed, 0 warnings, 2 errors
ERROR: resolution_0: fragments_tile is set but chunk (-1, -1, 2) does not tile its buffer
ERROR: resolution_0: links[delta=0] num_physical_records=400 != 388 rows on disk