Skip to main content

MEP 9. Fixture Catalogue

FieldValue
MEP9
TitleFixture Catalogue
AuthorMochi core
StatusInformational
TypeInformational
Created2026-05-08

Abstract

This MEP is the live inventory of parser and type fixtures, plus a coverage matrix that maps each soundness property in MEP 7 to the fixtures that exercise it. New fixtures are added to the inventory in the same commit that introduces the file.

Motivation

Without an index, the same property is often covered three times under three different names while another property goes uncovered. The matrix makes the gaps visible.

Specification

Inventory at v0.10.82

Source counts taken at the snapshot date. Numbers are pairs of .mochi plus matching golden or err.

DirectoryPairs
tests/parser/valid62
tests/parser/errors28
tests/types/valid72
tests/types/errors90
tests/types/soundness15
tests/queryplansmall
tests/interpretermany
tests/vmmany
tests/compiler/{rb,dart,ts}37+
tests/mochi_in_mochi/parsersmall

tests/types/soundness/ pins MEP-4/5 problem fixtures (p06_*, p08_*, p09_*, ..., p19_*, mep5_p01_*, mep5_p05_*, mep5_p13_*). Each pairs a .mochi source with either a .expect (current behaviour) or a .error (rejection text) sibling.

The VM and interpreter directories are end-to-end suites and are not the focus of this initiative. The parser and type fixtures are.

Existing parser/valid fixtures

Sorted by name:

agent_call, agent_decl, agent_full, agent_on_event, assign_stmt,
bench_block, call_expr, cast_expr, collection_literals, cross_join,
cross_join_triple, dataset, dataset_sort_take_limit, emit_stmt,
expect_stmt, extern_decl, fetch_stmt, for_loop, fun_def, fun_expr,
fun_expr_type_params, fun_type_params, generate_expr, generic_type,
group_by, group_expr, if_expr_then_else, if_expr_then_else_nested,
if_stmt, import_stmt, in_operator, index_expr, index_len_minus_one,
join, left_join, let_stmt, list_assign, load_expr, load_save_stdinout,
load_with_expr, logic, map_assign, match_expr, model_decl, negative,
nested_type_decl, on_stmt, outer_join, package_export, right_join,
save_expr, stream_decl, test_block, type_alias, type_struct_equals,
type_union_decl, unary_expr, unicode_identifier, update_stmt,
user_type_literal, var_stmt, while_loop

Existing types/valid fixtures

break_continue, cast_expr, closure, doom_move, fetch_extra_options,
fetch_options, fun_return_type, generate_options, generate_struct,
join_basic, join_multi, left_join, let_basic, list_assign,
list_concat, load_with, map_assign, map_hint_literal, match_expr,
model_decl, nested_type_decl, outer_join, shadow_scope,
stream_on_emit, string_in_operator, string_index, union_alias,
update_stmt, user_type_selector, user_types_basic, var_mutable

Added in v0.11.0:

aggregate_count_list, aggregate_min_max_int, aggregate_sum_int_list,
canonical_bool_only, canonical_int_arithmetic, canonical_string_concat,
cast_string_as_bool, closure_inferred_return, divide_by_zero_literal,
for_in_list, for_in_range, if_while_checked, inversion_if_expr,
match_literal_pattern, match_union_variant, modulo_by_zero_literal,
now_returns_int64, numeric_float_plus_int, numeric_int_plus_float,
preservation_let_chain, pure_in_where_ok, query_basic_select,
query_sort_take, struct_field_access

Added in v0.12.0 (MEP-10, MEP-11, MEP-12):

compare_empty_list, concat_generic, generic_builtins,
generic_freshness_per_call, int_div_truncates,
match_union_exhaustive_wildcard, option_type_syntax,
recursive_linked_list, reduce_generic, reverse_result_shape,
unit_return, user_generic_id

Existing types/errors fixtures

arg_type_mismatch, assign_to_let, assign_type_mismatch,
assign_undeclared_var, avg_non_numeric, binary_operator_type_error,
cannot_iterate, comparison_type_error, count_invalid_type,
emit_field_type, emit_unknown_stream, expect_non_boolean,
fetch_option_type, fetch_opts_map, fetch_url_type, fun_return_mismatch,
fun_wrong_return, generate_type_mismatch, index_not_int,
invalid_len_operand, invalid_range_bounds, join_on_not_bool,
join_source_not_list, json_missing_arg, len_missing_arg,
let_missing_type_or_value, map_assign_immutable, map_key_type_mismatch,
map_slice, match_pattern_mismatch, match_result_mismatch, missing_index,
not_callable, not_indexable, not_struct_selector, now_too_many_args,
on_unknown_stream, query_source_not_list, too_many_args,
undeclared_var, undefined_function, unknown_generate_type,
user_type_field_mismatch, user_unknown_field, wrong_type_assign

Added in v0.11.0:

break_outside_loop, cast_int_as_string, cast_string_as_int,
continue_outside_loop, if_cond_not_bool, impure_in_where_rejected,
list_concat_type_mismatch, match_variant_arity, missing_map_key,
missing_map_key_cast, multiple_top_level_errors, mutate_through_let_field,
mutate_through_let_index, range_bound_float, struct_unknown_field_access,
while_cond_not_bool

Added in v0.12.0 (MEP-10, MEP-11, MEP-12):

any_top_silent_widen, compare_int_string, compare_struct_int,
generic_escaping_variable, generic_param_conflict,
list_alias_call_arg, list_alias_index, list_alias_var_invariant,
match_arm_after_wildcard, match_missing_variant,
match_redundant_literal, match_redundant_variant,
mutate_through_let_alias, null_widening_int, null_widening_list,
null_widening_struct, query_group_having_bool_required,
query_skip_int_required, query_take_int_required,
query_where_bool_required, struct_literal_missing_field,
struct_literal_missing_fields_two, struct_literal_unknown_field,
unit_assign_value, unknown_type_name, unknown_type_param

Coverage matrix

The matrix is a property-to-fixture mapping. A cell value of existing means at least one fixture in the corresponding directory exercises the property. missing means we need to author one.

Property (from MEP 7)ValidError
Progress, primitivesexistingexisting
Progress, list and mapexistingexisting
Progress, function callexistingexisting
Preservation under let bindingexistingmissing
Canonical forms, boolexistingexisting
Canonical forms, int and int64existingexisting
Canonical forms, floatpartialpartial
Canonical forms, bigint, bigratmissingmissing
Canonical forms, stringexistingexisting
Canonical forms, unitexistingmissing
Canonical forms, structexistingexisting
Canonical forms, union variantexistingexisting
Inversion, every Primary shapepartialpartial
Substitution, let bindingsexistingmissing
Variance, function arg and resultexistingexisting
Variance, list element readmissingmissing
Variance, list element writen/aexisting
Variance, map keymissingmissing
Variance, map valuemissingmissing
Parametricity, lenexistingmissing
Parametricity, firstexistingmissing
Parametricity, push, append, concatexistingmissing
Parametricity, rangemissingmissing
Exhaustiveness, unionmissingmissing
Irredundancy, unionmissingmissing
Alpha equivalence (property)missingn/a
Numeric tower, int + float orderexistingn/a
Numeric tower, bigint + bigratmissingn/a
Numeric tower, int / intmissingn/a
Mutability, let immutableexistingexisting
Mutability, var mutableexistingn/a
Mutability, let xs[i] = ...missingexisting
Mutability, let s.f = ...missingexisting
Subtyping, record widthmissingmissing
Subtyping, AnyType silently acceptsexistingn/a
Cast, int as stringn/aexisting
Cast, union as variantmissingmissing
Null assignable as anymissingn/a
Closures captureexistingmissing
Recursive typesmissingmissing
Generic function declaredexistingexisting
Generic function instantiationexistingexisting
Query result typeexistingpartial
Query aggregate typesexistingpartial
Multiple top level errors accumulatedn/aexisting
Pure flag enforcement in where/havingexistingexisting

partial means at least one fixture exists but the property is not fully covered.

New fixtures to author for v0.11.0

Grouped by MEP.

From MEP 4 (type system):

  • type_void_not_assignable (error, T009 family).
  • type_struct_nominal_inequality (error, two anon structs).
  • type_bigint_string (valid).
  • type_bigrat_string (valid).

From MEP 5 (inference):

  • numeric_int_div_int (valid, asserts int / int : int).
  • numeric_bigint_minus_float (valid).
  • numeric_float_minus_bigint (valid, mirror).
  • numeric_bigrat_dominates (valid).
  • for_in_int_count (valid, range form).
  • for_in_map_keys (valid).
  • aggregate_avg_int_list (valid).
  • aggregate_min_string_list (valid).
  • aggregate_sum_bigint_list (valid).

From MEP 7 (soundness):

  • preservation_let_substitution (valid, sequence).
  • inversion_every_primary (valid, large composite).

From MEP 11 (subtyping):

  • record_width_subtype (valid, when implemented).
  • any_top_silent_widen (valid, snapshots current behaviour).
  • any_to_int_unchecked (valid, snapshots current behaviour).

From MEP 12 (polymorphism):

  • generic_id_int_string (valid).
  • generic_id_per_call_freshness (valid).
  • generic_pair_swap (valid, when implemented).
  • generic_unification_conflict (error, when implemented).

From MEP 13 (ADT):

  • adt_struct_field_mismatch (error).
  • adt_union_constructor_arity (error).
  • adt_match_exhaustive (valid, when implemented).
  • adt_match_missing_variant (error, when implemented).
  • adt_match_redundant_variant (error, when implemented).
  • adt_match_wildcard_after (valid).

From MEP 14 (queries):

  • query_select_arbitrary_expr (valid).
  • query_join_cardinality (valid).
  • query_group_having_bool (error, T042).
  • query_distinct_unique_int (valid).
  • query_skip_take_int (valid).

From MEP 15 (effects):

  • pure_call_in_pure_context (future, no fixture yet).

How to map a fixture to a MEP

Every fixture committed under tests/types/ should be referenced in the MEP that owns the property. The MEP's "Open Questions" or "Specification" section carries a checklist that lists fixtures by name. When a fixture is added, the checklist gets a checkmark.

When this catalogue is updated, the matrix above must reflect reality. Stale matrix rows are a tech debt indicator.

Rationale

The catalogue is the single source of truth for fixture coverage. Without it, missing coverage hides behind passing tests. The matrix is uncomfortable to read on purpose: every missing cell is a debt we owe the language.

Backwards Compatibility

Informational. No backward compatibility implications.

Reference Implementation

  • tests/parser/valid/, tests/parser/errors/, parser fixtures.
  • tests/types/valid/, tests/types/errors/, type fixtures.
  • golden/golden.go, harness used by both directories.

Open Questions

  • Inventory regeneration. A small Go program that walks the tree and produces this Markdown would keep the inventory honest.
  • Property test fixtures. Once layer 5 is wired in, this catalogue gains a third column.

References

  • See MEP 7 for the property list.
  • See MEP 8 for the test layer that owns each fixture.

This document is placed in the public domain.