Skip to content

Versioning ​

Layout version ​

  • Bytes 0..4 of the superblock must be ASCII TETR
  • Bytes 4..8 are layout_version (u32 LE)
  • Only 1 is defined today

The optional layout_version field in JSON/TOML query documents mirrors this value (QueryDocument).

Index version ​

The chunk index header carries index_version (u32 LE at offset 4 within the index region). Must be 1.

The optional THST footer ends with history_version (u32 LE):

ValueMeaning
1History / metadata (and optional metadata_ref) only
2May carry embedded ZONE/INDEX spills + refs — Embedded indexes

layout_version stays 1. Readers that only implement version 1 refuse version 2.

Compatibility policy ​

Change typeApproach
New wire dtype tagsExtend v1 if readers can ignore unknown tags
Boolean as separate wire typeReserved for layout v2
Breaking layout changesBump layout_version; v1 readers reject unknown versions
Embedded ZONE/INDEXhistory_version = 2; not a layout_version bump
Package sidecars (ZONE.json, INDEX.json)Beside packed.tet; unknown manifest keys ignored; not a layout bump
Query wire (filter, group_by, window, …)Versioned with the crate minor; SPEC / conformance milestone — not layout_version

The normative contract (layout, writer protocol, query wire, C ABI) and the CI conformance pack live in the crate: SPEC/ · conformance/. Current published line: 0.8.3.

Pre-1.0

Tetration is still in development. Layout v1 and query JSON/TOML may change before 1.0. Pin crate and CLI versions in production workflows.

Concurrency model ​

A sealed layout-v1 .tet has no on-disk locking or live-append protocol:

PatternSupported?
Sealed file, many readersYes — mmap read-only after commit / tet convert / pack
One writer, then readersYes
Parallel writers on one fileNo (undefined behavior)
Read while another process writesNo (undefined behavior)
Multi-writer via packageYes — shards → publish → new sealed generation

Scale for a sealed file comes from immutable bytes + mmap (or range-read) readers.

Multi-writer: concurrent ingest uses immutable shards → single publish → sealed generation, then readers pin that generation (local .tet.d or store; optionally tet pack to a standalone .tet). See CLI packages and writer protocol v2.

Verification ​

tet verify checks that all version fields match expected values and that structural invariants hold. Use --deep to decode every chunk payload on large files (default quick scan: first 128 chunks).