---
title: "treestore-cols — Mova code model"
description: "Mova code model of tools/treestore/src/cols.rs: components with their labels, obernants and the model text."
url: "https://groupants.elamur.ai/free/en/mova/tools/treestore/src/cols.rs.groupant/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Research](https://md.research.elamur.ai/free/en/) · **Groupants**

This page as HTML: <https://groupants.elamur.ai/free/en/mova/tools/treestore/src/cols.rs.groupant/>

# treestore-cols

The groupant beside tools/treestore/src/cols.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.

## Facts

- **kind:** groupant
- **status:** partial source bound model
- **source:** [`tools/treestore/src/cols.rs`](https://github.com/ElamurAI/mova-free/blob/main/tools/treestore/src/cols.rs)
- **repository folder:** [`tools/treestore/src/cols.rs.groupant`](https://github.com/ElamurAI/mova-free/tree/main/tools/treestore/src/cols.rs.groupant)

> **Implementation material.** A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.

## Components

| component | label | where |
|---|---|---|
| **Approximant** | partial | [Approximant](#approximant) |
| **Ast** | partial | `syntax.json` |
| **Composition** | partial | [Composition](#composition) |
| **Cost** | symbolic source derived | [Invariant](#invariant) |
| **Descriptant** | present | [Descriptant](#descriptant) |
| **Invariant** | partial | [Invariant](#invariant) |
| **Tests** | executed bounded checks | [Tests](#tests) |

## Obernants

The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.

| relation | type | label | where |
|---|---|---|---|
| Behavior complement | behavior complement | partial source derived model | [Behavior complement](#behavior-complement) |
| Reverse reconstruction | reverse reconstruction | partial source derived model | [Reverse reconstruction](#reverse-reconstruction) |

## Model text


### Descriptant

The column streams of one article (16 byte vectors in a fixed order) and their primitive codes: LEB128 varints,
zigzag signed numbers, length-prefixed literals and frozen value tables (id + 1, or 0 and a literal). Epoch
2026-11-06: first version; the stream order is part of the store format.

### Approximant

put(v) writes ⌈bits(v)/7⌉ bytes (1 for v < 128); get reads them back. zig(v) = 2v for v ≥ 0, −2v − 1 for v < 0.
sym(t, v) = put(t.id(v) + 1) when v ∈ t, else put(0) · lit(v). Table.from_counts keeps values with count ≥ min, by
descending count then bytes, at most max.

### Invariant

get ∘ put = id on u64; unzig ∘ zig = id on i64; Rd.sym ∘ Streams.sym = id for every string (table or literal).
Table ids are a bijection items ↔ 0..n−1. Cost: O(bytes) per value; table lookup O(log n) (BTreeMap).

### Composition

Every codec (codec.rs) writes through Streams and reads through Rd; the store concatenates per-article streams per
group (store.rs). Nothing here knows field semantics.

### Behavior complement

Does not compress, does not check that a stream was fully read (callers check `done`), does not accept non-canonical
varints as distinct values (they decode to the same number; `cm::symbols` rejects them by re-encoding).

### Reverse reconstruction

Injective on its domain: a byte stream produced by put/lit/sym has exactly one decoding given the same reading order
and tables; a truncated stream is an error, never a silent value.

### Tests

`cols::tests::varints_zigzag_tables`: extremes of u64/i64, table hit and escape, and the negative control that reading
past the end fails.

## Provenance

- **source SHA-256:** `cde1bd73c641a665…`
- **repository commit:** `f55191f0d47f`
