Elamur GroupantsāŒ•
☰

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

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

componentlabelwhere
approximantpartialapproximant
astpartial../syntax.json
costsymbolic source derivedinvariant
descriptantpresentdescriptant
invariantpartialinvariant
testspartial bounded parent evidencetests

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.

idtypelabelwhere
behavior_complementbehavior_complementpartial source derived modelbehavior_complement
reverse_reconstructionreverse_reconstructionpartial source derived modelreverse_reconstruction
aggregation_unitsaggregation_unitspartial source derived modelaggregation_units
pivot_transportpivot_transportpartial source derived modelpivot_transport
branch_relationbranch_relationpartial source derived modelbranch_relation
resource_costresource_costpartial source derived modelresource_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.

This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/mlab/src/builtins/table.rs.groupant/grouping.groupant/