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

# translation-flow-measure-order

The groupant beside tools/translate/src/measure.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_fragment
- **status:** partial source bound model
- **source:** [`tools/translate/src/measure.rs`](https://github.com/ElamurAI/mova-free/blob/main/tools/translate/src/measure.rs)
- **source SHA-256:** `c34da721e6921c20…`
- **covers:** base_order sorts Take source positions and Insert offsets after last Take, then returns one-based target positions. moved selects a strict LIS using lower-bound tails and backpointers, returns sorted values off path. order_ok checks kept strict increase and total cardinality. (bytes 2622–4600)
- **part of:** [translation-flow-measure](https://md.groupants.elamur.ai/free/en/mova/tools/translate/src/measure.rs.groupant/)
- **repository folder:** [`tools/translate/src/measure.rs.groupant/order.groupant`](https://github.com/ElamurAI/mova-free/tree/main/tools/translate/src/measure.rs.groupant/order.groupant)
- **repository commit:** `48f2e6f74146`

> **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` |
| **cost** | symbolic source derived | [invariant-and-cost](#invariant-and-cost) |
| **descriptant** | present | [descriptant](#descriptant) |
| **invariant** | partial | [invariant-and-cost](#invariant-and-cost) |
| **tests** | bounded helpers only | [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.

| id | 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) |
| `insert_origin` | insert_origin | partial source derived model | [insert_origin](#insert-origin) |
| `strict_lis` | strict_lis | partial source derived model | [strict_lis](#strict-lis) |
| `cardinality` | cardinality | partial source derived model | [cardinality](#cardinality) |
| `sorted_membership` | sorted_membership | partial source derived model | [sorted_membership](#sorted-membership) |

## Model text


### descriptant

#### translation-flow-measure-order

base_order sorts Take source positions and Insert offsets after last Take, then returns one-based target positions. moved selects a strict LIS using lower-bound tails and backpointers, returns sorted values off path. order_ok checks kept strict increase and total cardinality.

##### Epoch 2026-10-31

Prospective predictions saved before edits in the external wave32 tr_flow receipts. Original production bytes preserved; only appended synthetic test modules added. Selected actual helpers exercised; five compiled behavior controls rejected with exact byte restoration and positive reruns. Source syntax projection is partial, not expanded semantic Rust. Diagnostic reconstruction with residual is not semantic understanding or persistent learning.

Admitted base is permutation1..n; mv sorted distinct subset. Take index fits i64; offsets and positions fit usize.

### approximant

#### Forward relation

base_order sorts Take source positions and Insert offsets after last Take, then returns one-based target positions. moved selects a strict LIS using lower-bound tails and backpointers, returns sorted values off path. order_ok checks kept strict increase and total cardinality.

Scope: source-derived conditional transition model at the manifest SHA. Admitted base is permutation1..n; mv sorted distinct subset. Take index fits i64; offsets and positions fit usize.

### composition

#### Composition

Scoped children are projections of this file, not independent executables. Main population filtering feeds aggregation; order/text helpers feed measure's exact decoder; many's agreement and storage read the same MTok with intentionally different punctuation treatment, streaming accounting consumes reader costs, clustering consumes normalized PairM. Uncovered branches remain source-derived; finite helper checks do not establish orchestration wiring.

### catalog

## Typed models

All entries bind the source SHA and optional byte range in manifest.json. Observation is one admitted helper call or the explicitly described orchestration trace. Relations are partial source-derived models, not universal proofs. Finite test names and unexecuted effects are in tests.md.

### behavior_complement

Admitted order_ok cannot accept unremoved inversion; moved(identity) empty. Arbitrary duplicated ids outside domain may fool cardinality check.

Domain and held-fixed assumptions: the invariant/forward documents for this exact scope. Status: partial source-derived relation; complement is a conditional inner exclusion, reverse retains ambiguity, other types specify the named projection/intervention. Oracle: relevant named synthetic tests when listed; otherwise source inspection only.

### reverse_reconstruction

Given base and implementation deterministic moved fixed. Given moved alone many base permutations compatible; optimal LIS not uniquely identified mathematically, implementation's tail replacement breaks ties.

Domain and held-fixed assumptions: the invariant/forward documents for this exact scope. Status: partial source-derived relation; complement is a conditional inner exclusion, reverse retains ambiguity, other types specify the named projection/intervention. Oracle: relevant named synthetic tests when listed; otherwise source inspection only.

### insert_origin

Initial Insert uses last=-1, placing before source-taken positions; inserts after same source use increasing sub counters.

Domain and held-fixed assumptions: the invariant/forward documents for this exact scope. Status: partial source-derived relation; complement is a conditional inner exclusion, reverse retains ambiguity, other types specify the named projection/intervention. Oracle: relevant named synthetic tests when listed; otherwise source inspection only.

### strict_lis

partition_point(t<x) replaces equal tail rather than extending; relevant outside permutation domain for duplicates.

Domain and held-fixed assumptions: the invariant/forward documents for this exact scope. Status: partial source-derived relation; complement is a conditional inner exclusion, reverse retains ambiguity, other types specify the named projection/intervention. Oracle: relevant named synthetic tests when listed; otherwise source inspection only.

### cardinality

Moved count=n-LIS length for admitted permutation, not an edit distance over arbitrary words.

Domain and held-fixed assumptions: the invariant/forward documents for this exact scope. Status: partial source-derived relation; complement is a conditional inner exclusion, reverse retains ambiguity, other types specify the named projection/intervention. Oracle: relevant named synthetic tests when listed; otherwise source inspection only.

### sorted_membership

order_ok binary_search requires sorted mv; caller moved provides it, arbitrary callers do not receive validation.

Domain and held-fixed assumptions: the invariant/forward documents for this exact scope. Status: partial source-derived relation; complement is a conditional inner exclusion, reverse retains ambiguity, other types specify the named projection/intervention. Oracle: relevant named synthetic tests when listed; otherwise source inspection only.


### tests

#### Evidence and gaps

##### Native checks

- `measure::tests::order_residual`
- `measure::tests::a_block_reads_as_one`
- `measure::tests::text_layer_back`

These selected names ran twice debug and twice release with exact filtering and one test thread; raw logs and numeric status files are in the external octopus-wave32-tr_flow-2026-10-31 receipt directory. All test bodies inspected before selection. Inline cases use only synthetic in-memory records; the existing blocks filesystem test was not selected. Tests listed at file level do not execute every function or this entire scoped fragment.

##### Controls

Five compiled source-behavior mutants: main gate counter suppressed; many strict chapter comparison relaxed; measure noncanonical-gap recording disabled; pages Meta filter reversed; blocks literal-change predicate reversed. All failed the corresponding assertion and passed after original bytes/hash restoration. Zero assertion-only mutants; zero surviving exploratory mutants.

##### Limitations

CLI argument/effect paths, live corpus/model/annotation/training, full Run::verse, page filesystem and reports remain source-derived only. Source syntax projections generated twice and byte-compared. No corpus-quality, persistent-learning, throughput or universal semantic coverage claim.

### invariant-and-cost

#### Domain, invariant and cost

##### Invariant

Admitted base is permutation1..n; mv sorted distinct subset. Take index fits i64; offsets and positions fit usize.

##### Cost

O(nlog n) time/O(n) memory for ordering and LIS; order_ok O(nlog moved).

Integer additions/casts require representability; finite floating inputs where comparisons are modeled. These symbolic costs are not measurements of corpus throughput. No useful cheaper executable percentage surrogate established; future supported caps only 1/2/5/10%.
