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

# mlab-table-keys

The groupant beside mlab/src/table.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:** [`mlab/src/table.rs`](https://github.com/ElamurAI/mova-free/blob/main/mlab/src/table.rs)
- **source SHA-256:** `7af3a65aabe33226…`
- **covers:** Ascending cmp orders NaN/None last and equal to themselves. Stable sorted_rows preserves tie indices; groups sorts by keys and restores appearance within each group. row_key returns None for any missing and canonicalizes signed zero. (bytes 11897–15045)
- **part of:** [mlab-table](https://md.groupants.elamur.ai/free/en/mova/mlab/src/table.rs.groupant/)
- **repository folder:** [`mlab/src/table.rs.groupant/keys.groupant`](https://github.com/ElamurAI/mova-free/tree/main/mlab/src/table.rs.groupant/keys.groupant)
- **repository commit:** `855da7bd4a7b`

> **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](#invariant) |
| **descriptant** | present | [descriptant](#descriptant) |
| **invariant** | partial | [invariant](#invariant) |
| **tests** | partial bounded parent 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.

| 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) |
| `missing_relation` | missing_relation | partial source derived model | [missing_relation](#missing-relation) |
| `stable_ties` | stable_ties | partial source derived model | [stable_ties](#stable-ties) |
| `branch_relation` | branch_relation | partial source derived model | [branch_relation](#branch-relation) |
| `resource_cost` | resource_cost | partial source derived model | [resource_cost](#resource-cost) |

## Model text


### descriptant

#### mlab-table-keys

Ascending cmp orders NaN/None last and equal to themselves. Stable sorted_rows preserves tie indices; groups sorts by keys and restores appearance within each group. row_key returns None for any missing and canonicalizes signed zero.

Epoch 2026-10-31: isolated source-bound fragment over bytes [11897,15045); includes no claim beyond this relation. Source hash 7af3a65aabe33226d39f741909fd08d74c3b3e43390417c64e617a10704ac26b.

### approximant

#### keys: forward relation

Ascending cmp orders NaN/None last and equal to themselves. Stable sorted_rows preserves tie indices; groups sorts by keys and restores appearance within each group. row_key returns None for any missing and canonicalizes signed zero.

Domain: Well-shaped public Table/Mat/StrArr, in-range zero-based internal indices, bounded i64 civil arithmetic. Malformed direct structs may panic.

Executable surrogate gap: no measured cheaper implementation with a useful scoped metric is supplied. Categorical/error/effect relations are exact obligations, not percent losses. Future numeric caps only1/2/5/10%.

### invariant

#### keys: invariant and cost

NaNs group together but produce no hash key; +0 and -0 share numeric key0.

One-key numeric fast path adds original index as tie breaker; multi-key stable sort relies on sort stability.

Scope-specific cost: Sorting O(n log n * key-comparison cost); grouping stores O(n) indices; row_key O(k + copied text bytes).

### models

### behavior_complement

Missing grouping does not imply missing join equality; join keys exclude missing. Numeric/text keys remain distinct tagged atoms.

### reverse_reconstruction

Sorted output admits any permutation of unequal-key source rows with corresponding index mapping; groups discard original inter-group order but retain member indices.

### missing_relation

NaNs group together but produce no hash key; +0 and -0 share numeric key0.

### stable_ties

One-key numeric fast path adds original index as tie breaker; multi-key stable sort relies on sort stability.

### branch_relation

Ascending cmp orders NaN/None last and equal to themselves. Stable sorted_rows preserves tie indices; groups sorts by keys and restores appearance within each group. row_key returns None for any missing and canonicalizes signed zero.

### resource_cost

Sorting O(n log n * key-comparison cost); grouping stores O(n) indices; row_key O(k + copied text bytes).

### tests

#### Evidence boundary

See ../tests.md for the actual selected source test and mutant. These tests sample the file, not every fragment branch. Missing grouping does not imply missing join equality; join keys exclude missing. Numeric/text keys remain distinct tagged atoms. Other branches here are source-derived and unexecuted unless the parent test explicitly calls them.
