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

# mlab-vm-compiler

The groupant beside mlab/src/vm.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/vm.rs`](https://github.com/ElamurAI/mova-free/blob/main/mlab/src/vm.rs)
- **source SHA-256:** `04ee871c37021946…`
- **covers:** AST classification, register assignment, bytecode emission and jump patching. (bytes 10660–45698)
- **part of:** [mlab-vm](https://md.groupants.elamur.ai/free/en/mova/mlab/src/vm.rs.groupant/)
- **repository folder:** [`mlab/src/vm.rs.groupant/compiler.groupant`](https://github.com/ElamurAI/mova-free/tree/main/mlab/src/vm.rs.groupant/compiler.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) |
| `fallback_selection` | fallback_selection | partial source derived model | [fallback_selection](#fallback-selection) |
| `order_guard` | order_guard | partial source derived model | [order_guard](#order-guard) |
| `range_compilation` | range_compilation | partial source derived model | [range_compilation](#range-compilation) |
| `register_budget` | register_budget | partial source derived model | [register_budget](#register-budget) |

## Model text


### descriptant

#### mlab-vm-compiler

AST classification, register assignment, bytecode emission and jump patching.

##### Epoch 2026-10-31

Half-open source bytes [10660,45698); bound by parent source hash and scoped byte hash. Model covers only this fragment; parent composition explains joins.

### approximant

#### Scoped forward relation

Collect assigned variables/params/outputs, classify statements, emit native ops or Fb; loops patch exits/continues; sorted functions determine call indices.

##### Domain and gap

Source-generated states within resource limits. Categorical relation has no executable percent surrogate.

### invariant

#### Scoped invariant

Try/switch/commands and frame-sensitive expressions become Fallback.

##### Cost

AST visits and emitted code/tables plus linear string dedup and sorted function names. Nested temporary register demand bounded only by assertion; usize-to-u16/u32/u8 casts need admitted bounds.

### models

## Scoped typed relations

### behavior_complement

Try/switch/commands exclude native statement compilation. Right operands with possible effects exclude direct reuse of left variable registers; unsupported expressions remain tree fallback.

### reverse_reconstruction

Bytecode admits multiple ASTs: parenthesization and equivalent constant forms may be lost; fallback retains original Stmt and its sync list.

### fallback_selection

Try/switch/commands and frame-sensitive expressions become Fallback.

### order_guard

left operand direct register reuse is allowed only if right expression is simple.

### range_compilation

For range emits ForRange/ForNext, other iterables ForGen; empty handling is runtime.

### register_budget

tmp asserts top<NO; fixed vars and u8 index casts lack a full overflow guarantee.


### tests

#### Evidence scope

Parent selected tests: wave30_bounded_state_and_fallback, wave30_parse_runtime_and_output_state, wave30_synthetic_gate_fail_fast, vm_workspace_is_visible_after_run. This fragment shares parent syntax and finite checks; no separate test count or complete fragment coverage claim. Assertion-control association and unexecuted paths are in parent tests.md and source-test-map.json.
