---
title: "mova-elephant-part — Mova code model"
description: "Mova code model of tools/elephant/src/part.rs: components with their labels, obernants and the model text."
url: "https://groupants.elamur.ai/free/en/mova/tools/elephant/src/part.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/elephant/src/part.rs.groupant/>

# mova-elephant-part

The groupant beside tools/elephant/src/part.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/elephant/src/part.rs`](https://github.com/ElamurAI/mova-free/blob/main/tools/elephant/src/part.rs)
- **repository folder:** [`tools/elephant/src/part.rs.groupant`](https://github.com/ElamurAI/mova-free/tree/main/tools/elephant/src/part.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 | [Forward approximant](#forward-approximant) |
| **Ast** | partial | `syntax.json` |
| **Composition** | partial | [Composition](#composition) |
| **Cost** | partial | [Cost](#cost) |
| **Descriptant** | present | [Descriptant](#descriptant) |
| **Invariant** | partial | [Invariant](#invariant) |
| **Tests** | finite evidence | [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

Reader and writer of word-graph parts and runs in both formats (WGPART01 without OOV frequencies, WGPART02 with them), independent of the wordgraph version's own reader. Source: `tools/elephant/src/part.rs`.

### Forward approximant

open: magic -> format; next_oov: entries strictly sorted (checked), frequency u32::MAX in format 1; next_rec: strictly increasing keys (checked), the OOV table skipped if unread. Writer::start(format, n_oov, n) -> push_oov (strictly sorted) -> push(key, count>0, strictly increasing) -> finish: both counts met, fsync, rename from .tmp.

### Invariant

A written run is sorted, unique, with positive counts and exactly the announced number of records; a reader never sees a half-written run (temporary file and rename); read_all(write(x)) = x.

### Cost

Streaming: O(bytes) time, O(OOV table) memory.

### Composition

Parent: elephant. Used by merge (runs), key (scans for list changes) and store (format and hashes).

### Behavior complement

Never interprets a key beyond its packing; never writes in place. Evidence status: source-derived model with finite checks, not a proof.

### Reverse reconstruction

A run decodes to its records exactly (round-trip test); the parts a run was merged from are not recoverable from it (the store's manifest keeps them).

### Tests

#### Checks

part::tests: both formats round-trip; unsorted records, a short run and a zero count refused.
These are finite fixtures and measurements; not a proof.

## History


#### 2026-11-06 · document

##### Epoch 2026-11-06

First model, written with the source (the Elephant made incremental and an animal on Mova).

## Provenance

- **source SHA-256:** `42708c5ec76dff55…`
- **repository commit:** `f55191f0d47f`
