Elamur Groupants⌕
☰

mlab-table

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

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
astpartialsyntax.json
compositionpartialcomposition
costsymbolic source derivedinvariant
descriptantpresentdescriptant
invariantpartialinvariant
testsbounded selected teststests

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
representation_transportrepresentation_transportpartial source derived modelrepresentation_transport
failure_precedencefailure_precedencepartial source derived modelfailure_precedence
resource_costresource_costpartial source derived modelresource_cost
composition_relationcomposition_relationpartial source derived modelcomposition_relation

Parts

Model text

descriptant

mlab-table

Column-oriented Table names, Value columns and ColKind annotations, row indices and civil-day coordinates.

dates: Civil-day conversion maps Unix day0 to719529. datenum_ymd carries month and adds day offset; parse_iso validates calendar roundtrip but accepts unbounded parsed clock values. datestr rounds fractional day to seconds and carries midnight; nonfinite emits NaT.

columns: to_column rejects complex before char-row conversion or vector-shape check. make zips names/values, then name validity, duplicate, conversion, equal height. set_var broadcasts singleton to height and retains Date kind on numeric replacement.

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.

display: cells_of formats by kind; format_body selects all rows <=30, otherwise head10 tail5, widths count Unicode chars and header. Text left aligns, others right; format_str_arr traverses column-major data into row text.

Epoch 2026-10-31

Previously uncovered legacy source modeled using source-scoped children. Synthetic tests added without changing production behavior. Assertions measure selected branches, not universal correctness or distribution calibration.

approximant

Forward approximant

dates: Civil-day conversion maps Unix day0 to719529. datenum_ymd carries month and adds day offset; parse_iso validates calendar roundtrip but accepts unbounded parsed clock values. datestr rounds fractional day to seconds and carries midnight; nonfinite emits NaT.

columns: to_column rejects complex before char-row conversion or vector-shape check. make zips names/values, then name validity, duplicate, conversion, equal height. set_var broadcasts singleton to height and retains Date kind on numeric replacement.

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.

display: cells_of formats by kind; format_body selects all rows <=30, otherwise head10 tail5, widths count Unicode chars and header. Text left aligns, others right; format_str_arr traverses column-major data into row text.

Domain

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

Executable gap

No cheaper Rust surrogate has been measured for this source. Exact categorical/effect behavior is not a percentage metric; numerical surrogates need a separately specified domain, zero policy and supported1/2/5/10% cap. No speed or error-bound claim.

invariant

Invariants and cost

dates: Invalid February30 excludes Some date; hour24 is not excluded. Formatting is second-resolution and cannot preserve arbitrary fractional day bits.

columns: Failed set_var conversion/height excludes mutation; make does not enforce equal names/values lengths beyond zip. Logical var_list does not bounds-check true positions.

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

display: Elided output excludes reconstruction of hidden rows; nonfinite Date displays NaT and string None displays <missing>. No ANSI width guarantee.

Column copies O(nw); stable key sort O(kn log n), groups plus per-group index sort; hashing keys O(k) plus text clone length. Display materializes all cells even though >30 rows shows15. Name validation in make costs O(w²) comparisons; dedupe suffix collisions can cost O(w³) string comparisons plus text work.

Allocations can fail; public malformed shapes and extreme integer arithmetic are outside the bounded checked domain. Floating calculations retain their source-specific NaN and tie policies; no invented global finite guarantee.

composition

Scoped composition

dates: Civil-day conversion maps Unix day0 to719529. datenum_ymd carries month and adds day offset; parse_iso validates calendar roundtrip but accepts unbounded parsed clock values. datestr rounds fractional day to seconds and carries midnight; nonfinite emits NaT.

columns: to_column rejects complex before char-row conversion or vector-shape check. make zips names/values, then name validity, duplicate, conversion, equal height. set_var broadcasts singleton to height and retains Date kind on numeric replacement.

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.

display: cells_of formats by kind; format_body selects all rows <=30, otherwise head10 tail5, widths count Unicode chars and header. Text left aligns, others right; format_str_arr traverses column-major data into row text.

Children bind disjoint operation spans in the original source and share one syntax projection. Registration/reporting/glue between named spans remains represented by the parent projection.

dates: For datestr with a time-bearing pattern, an output admits datenum inputs rounding to the shown second, including midnight carry. iso_date first tests exact integrality: date-only output admits integral inputs only; nonintegral inputs may round to midnight but retain the datetime pattern. Valid civil roundtrip is unique only within the nonoverflow calendar domain.

columns: Table columns admit row/column vector antecedents normalized to column shape; char rows and strings can agree. Scalar broadcast erases original orientation.

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

display: Display string admits many matrices differing beyond precision, elided middle rows or real literal <missing> text.

The mathematical combiner keeps source equations, branch exclusions, compatible antecedents and bounded tests distinct. Passing children does not prove caller preconditions; dimension, missingness and effect adapters must preserve their own contracts.

models

behavior_complement

dates: Invalid February30 excludes Some date; hour24 is not excluded. Formatting is second-resolution and cannot preserve arbitrary fractional day bits.

columns: Failed set_var conversion/height excludes mutation; make does not enforce equal names/values lengths beyond zip. Logical var_list does not bounds-check true positions.

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

display: Elided output excludes reconstruction of hidden rows; nonfinite Date displays NaT and string None displays <missing>. No ANSI width guarantee.

reverse_reconstruction

dates: For datestr with a time-bearing pattern, an output admits datenum inputs rounding to the shown second, including midnight carry. iso_date first tests exact integrality: date-only output admits integral inputs only; nonintegral inputs may round to midnight but retain the datetime pattern. Valid civil roundtrip is unique only within the nonoverflow calendar domain.

columns: Table columns admit row/column vector antecedents normalized to column shape; char rows and strings can agree. Scalar broadcast erases original orientation.

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

display: Display string admits many matrices differing beyond precision, elided middle rows or real literal <missing> text.

representation_transport

calendar_transport: days_from_civil/civil_from_days form inverse on valid supported calendar dates; ISO parser additionally requires4-digit year layout. clock_boundary: Time values are floating parsed, not range checked; timezone suffix unsupported; date range checked before calendar roundtrip.

column_transport: make has no scalar broadcast; set_var does. zero columns means height0. Direct take_rows/select_vars require valid indices. name_precedence: Unicode alphabetic/underscore name starts accepted; make_valid_name prefixes x for leading underscore unlike valid_name.

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.

display_cost: All cells generated before selection, so elision reduces output not source-format work. layout_transport: Names and shown widths determine pad; trailing spaces stripped, four-space indent and three-space separators.

failure_precedence

dates: Invalid February30 excludes Some date; hour24 is not excluded. Formatting is second-resolution and cannot preserve arbitrary fractional day bits.

columns: Failed set_var conversion/height excludes mutation; make does not enforce equal names/values lengths beyond zip. Logical var_list does not bounds-check true positions.

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

display: Elided output excludes reconstruction of hidden rows; nonfinite Date displays NaT and string None displays <missing>. No ANSI width guarantee.

resource_cost

Column copies O(nw); stable key sort O(kn log n), groups plus per-group index sort; hashing keys O(k) plus text clone length. Display materializes all cells even though >30 rows shows15. Name validation in make costs O(w²) comparisons; dedupe suffix collisions can cost O(w³) string comparisons plus text work.

composition_relation

dates: Civil-day conversion maps Unix day0 to719529. datenum_ymd carries month and adds day offset; parse_iso validates calendar roundtrip but accepts unbounded parsed clock values. datestr rounds fractional day to seconds and carries midnight; nonfinite emits NaT.

columns: to_column rejects complex before char-row conversion or vector-shape check. make zips names/values, then name validity, duplicate, conversion, equal height. set_var broadcasts singleton to height and retains Date kind on numeric replacement.

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.

display: cells_of formats by kind; format_body selects all rows <=30, otherwise head10 tail5, widths count Unicode chars and header. Text left aligns, others right; format_str_arr traverses column-major data into row text.

tests

Bounded evidence

Selected actual-source test: table::wave30::dates_keys_and_columns. It uses only synthetic values. Retained native-commands.json specifies exact cargo selection; source-test-map.json maps logs, profiles and controls externally. Paired debug/release observations and compiled mutant status are recorded in receipt.json only after execution.

No Boost/NIST data suite, default Monte Carlo calibration, filesystem dataset loading, GPU or benchmark was run. The test samples a subset of source branches; fragment prose remains source-derived for all uncalled APIs. No Clippy cleanliness claim: broad dependency lints outside owned sources not addressed.

prospective

Prospective statistics epoch — 2026-10-31

Read all seven sources before editing. CPU synthetic checks only; no external Boost/NIST data, default Monte Carlo, GPU, live files, teachers or corpus. No speed claim or production algorithm change planned.

Planned controls mutate independent assertions/contracts in each source, compile successfully, observe selected failure, restore exact source bytes and rerun. Paired debug/release test names and statuses must match. Models remain partial and unsupported executable-surrogate gaps explicit.

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