10. Linking Across Chunks and Levels

10.1 Problem Statement

Many objects span several chunks — a skeleton through six chunks, a streamline across several seams, a mesh with faces straddling one. Vertex indices are chunk-local, so connectivity across chunks needs its own structure. Two cases share one array family, links/<delta>/<offsets>/:

  • Cross-chunk links at one level (delta = 0): endpoints in different chunks of the same level.

  • Cross-level links (delta ≠ 0): endpoints at the source level paired with endpoints at source + delta.

An intra-chunk link is a link whose offsets are all zero (§10.6). Because the endpoint relationship is in the path, every link array is an ordinary chunk-grid array that shards, enumerates and validates like vertices, and no record names a chunk.

10.2 Strategy 1: Boundary Deduplication

With cross_chunk_strategy = "boundary_deduplication", vertices on a seam are duplicated into both chunks and connectivity is recovered by coordinate matching. It is the simplest read path but costs one extra vertex (and fragment entry) per shared point, needs exact coordinate agreement (float round-trips can break it), and cannot express cross-level links.

10.4 Strategy Selection

cross_chunk_strategy is a root key; "both" writes both representations, for readers that may not support explicit links.

Use case

Strategy

Skeleton with integer voxel-coordinate vertices

either; deduplication is simplest

Streamline or polyline with float vertices

explicit_links

Mesh with faces across seams

explicit_links (link_width = 3)

Pyramid with cross-level links

explicit_links (required)

10.5 Object Index for Cross-Chunk Objects

An object spanning chunks has one manifest entry per fragment it uses, in any chunk (§7.6). To reconstruct it, a reader reads its manifest, decodes each named chunk’s vertex_fragments cell to find the object’s rows, and, if it needs the edges between chunks, reads the non-intra arrays under links/0/ at those chunks. Manifests reference vertex fragments only, never edges.

10.7 Consistency Guarantees

  • Chunk-local indices. No record stores a global vertex id; each vi_k is local to chunk src + o_k.

  • Attribute parity. link_attributes/<name>/<delta>/<offsets> mirrors links/<delta>/<offsets>: same segments, cells and row order.

  • Uniform family policy. link_width, sid_ndim, directed and store belong to the whole <delta> family; two link widths at one level need two deltas.

  • Referential integrity. A record naming chunk src + o_k requires that chunk to exist with at least vi_k + 1 vertices at the endpoint’s level; deleting a chunk without the records that reach into it leaves the store invalid.

  • Finalize before sharding. num_links and num_physical_records must be written before the store is sharded, since they can no longer be recovered by listing cell files.