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

# mlab-builtins-table-grouping

The groupant beside mlab/src/builtins/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/builtins/table.rs`](https://github.com/ElamurAI/mova-free/blob/main/mlab/src/builtins/table.rs)
- **source SHA-256:** `f1b0959092cfcdd3…`
- **covers:** agg filters NaNs, count counts original length, mode sorted runs strict greater chooses smallest tie. groupsummary appends GroupCount and method columns; grouptransform scatters group results into original rows. pivot groups row/column keys, count empty0, other empty NaN. (bytes 10371–18733)
- **part of:** [mlab-builtins-table](https://md.groupants.elamur.ai/free/en/mova/mlab/src/builtins/table.rs.groupant/)
- **repository folder:** [`mlab/src/builtins/table.rs.groupant/grouping.groupant`](https://github.com/ElamurAI/mova-free/tree/main/mlab/src/builtins/table.rs.groupant/grouping.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](#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) |
| `aggregation_units` | aggregation_units | partial source derived model | [aggregation_units](#aggregation-units) |
| `pivot_transport` | pivot_transport | partial source derived model | [pivot_transport](#pivot-transport) |
| `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-builtins-table-grouping

agg filters NaNs, count counts original length, mode sorted runs strict greater chooses smallest tie. groupsummary appends GroupCount and method columns; grouptransform scatters group results into original rows. pivot groups row/column keys, count empty0, other empty NaN.

Epoch 2026-10-31: isolated source-bound fragment over bytes [10371,18733); includes no claim beyond this relation. Source hash f1b0959092cfcdd3cbd171a48d252ce4c1e652b1e56ed030c160e7667d8cbb54.

### approximant

#### grouping: forward relation

agg filters NaNs, count counts original length, mode sorted runs strict greater chooses smallest tie. groupsummary appends GroupCount and method columns; grouptransform scatters group results into original rows. pivot groups row/column keys, count empty0, other empty NaN.

Domain: Well-shaped values and finite practical windows; effects delegated to it.fs. Physical filesystem not exercised.

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

#### grouping: invariant and cost

Sample variance denominator n-1 with singleton0; all-missing variance NaN; count includes missing.

Pivot names derive key text then normalize/dedupe, so column labels lose exact original identifiers.

Scope-specific cost: Group sort O(k*n log n); aggregate sorting methods O(g log g), linear methods O(g); callback cost unknown. Pivot allocates per-row-group cells and column values; deduping generated column names may add O(c³) string comparisons for c colliding names, plus generated/text bytes.

### models

### behavior_complement

Empty sum0 does not imply empty mean0 (NaN). grouptransform function result length mismatch excludes valid result; fixed zscore singleton divides by0.

### reverse_reconstruction

Aggregate values admit many groups including any insertion of NaNs except count/numel/nummissing; summaries do not reconstruct individual rows.

### aggregation_units

Sample variance denominator n-1 with singleton0; all-missing variance NaN; count includes missing.

### pivot_transport

Pivot names derive key text then normalize/dedupe, so column labels lose exact original identifiers.

### branch_relation

agg filters NaNs, count counts original length, mode sorted runs strict greater chooses smallest tie. groupsummary appends GroupCount and method columns; grouptransform scatters group results into original rows. pivot groups row/column keys, count empty0, other empty NaN.

### resource_cost

Group sort O(k*n log n); aggregate sorting methods O(g log g), linear methods O(g); callback cost unknown. Pivot allocates per-row-group cells and column values; deduping generated column names may add O(c³) string comparisons for c colliding names, plus generated/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. Empty sum0 does not imply empty mean0 (NaN). grouptransform function result length mismatch excludes valid result; fixed zscore singleton divides by0. Other branches here are source-derived and unexecuted unless the parent test explicitly calls them.
