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

# mlab-index-assignment

The groupant beside mlab/src/index.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/index.rs`](https://github.com/ElamurAI/mova-free/blob/main/mlab/src/index.rs)
- **source SHA-256:** `dccd47c7d5a96caa…`
- **covers:** Deletion routes first. Nondelete one-index assignment checks RHS scalar or matching count before vector-only growth; two-index assignment converts row/col selections, verifies RHS rectangle/vector compatibility, computes merged class before resize, resizes, installs class and writes the j-major index list. Duplicate writes overwrite in order. (bytes 6010–10117)
- **part of:** [mlab-index](https://md.groupants.elamur.ai/free/en/mova/mlab/src/index.rs.groupant/)
- **repository folder:** [`mlab/src/index.rs.groupant/assignment.groupant`](https://github.com/ElamurAI/mova-free/tree/main/mlab/src/index.rs.groupant/assignment.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** | executed bounded checks | [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) |
| `representation_transport` | representation_transport | partial source derived model | [representation_transport](#representation-transport) |
| `failure_precedence` | failure_precedence | partial source derived model | [failure_precedence](#failure-precedence) |
| `resource_domain` | resource_domain | partial source derived model | [resource_domain](#resource-domain) |
| `interaction_relation` | interaction_relation | partial source derived model | [interaction_relation](#interaction-relation) |

## Model text


### descriptant

#### Indexed assignment validation and growth

Deletion routes first. Nondelete one-index assignment checks RHS scalar or matching count before vector-only growth; two-index assignment converts row/col selections, verifies RHS rectangle/vector compatibility, computes merged class before resize, resizes, installs class and writes the j-major index list. Duplicate writes overwrite in order.

##### Modeling epoch 2026-10-31

Prospective source reading precedes test additions. Retained observations: Uses to_indices and Mat::narrow. Interp decides defined flag and resolves End before call; absent variable differs from existing nonempty target class.

This is partial source-derived modeling, not proof, full semantic coverage, or a performance result. Public malformed representations, unbounded allocations and exhaustive numerical edge cases remain outside the checked fixtures.

### approximant

#### Indexed assignment validation and growth forward relation

Deletion routes first. Nondelete one-index assignment checks RHS scalar or matching count before vector-only growth; two-index assignment converts row/col selections, verifies RHS rectangle/vector compatibility, computes merged class before resize, resizes, installs class and writes the j-major index list. Duplicate writes overwrite in order.

Domain: Valid bounded matrices, supported args and representable indices; allocation failure/panic not covered by ordinary Result rollback.

No executable Rust surrogate is supplied: categorical decisions require exact observations; numerical kernels have no measured approximation metric here. Future supported caps are 1%, 2%, 5%, 10% only.

### invariant

#### Invariant and cost

Resize copies old overlap using old/new leading row dimensions. class computed before 2D resize; scalar broadcast uses RHS index zero. write clears prior imaginary cells when RHS real.

Cost: O(indices+grown area+old overlap); memory O(grown area+indices).

Failure ordering: Extra dimension rejection before 2D conversion; count/shape before growth; writes after successful resize. Empty target colon dimensions inferred from RHS.

### models

### behavior_complement

Bounded validation Err excludes target mutation; general matrix linear out-of-range cannot grow. Nonempty logical target with nonlogical RHS cannot remain logical; defined nonempty char target retains Char; empty or undefined target adopts the RHS class.

### reverse_reconstruction

Final target constrains untouched retained cells; overwritten old values are arbitrary. Repeated indices only constrain final RHS occurrence, earlier values lost. Growth zero-filled holes cannot identify whether original target already held zeros.

### representation_transport

Resize copies old overlap using old/new leading row dimensions. class computed before 2D resize; scalar broadcast uses RHS index zero. write clears prior imaginary cells when RHS real.

### failure_precedence

Extra dimension rejection before 2D conversion; count/shape before growth; writes after successful resize. Empty target colon dimensions inferred from RHS.

### resource_domain

Valid bounded matrices, supported args and representable indices; allocation failure/panic not covered by ordinary Result rollback.

### interaction_relation

Uses to_indices and Mat::narrow. Interp decides defined flag and resolves End before call; absent variable differs from existing nonempty target class.


### tests

#### Bounded evidence

Selected actual-code Rust test: `index::wave30::gather_update` with `cargo test --offline --locked -p mlab --lib`. CPU synthetic fixtures only. Two debug and two release runs, sorted named outcomes, numeric statuses, compiled assertion controls and exact source restoration are retained externally under the wave30 expressions receipt directory. The source-to-test map distinguishes runtime semantics from AST representation checks. This fragment shares the parent test: only the exercised branches are observed; its whole prose is not runtime coverage. No corpus, GPU, live filesystem inspection, callbacks, RNG shuffle or wall-clock execution.

Syntax is generated twice from exact source and compared. Lexical projection has no expansion/type/name resolution. No strict Clippy claim; existing dependency/style findings are not re-run merely for repetition.
