# Benchmark protocol

The repository includes a reproducible benchmark executable at `cmd/bench`.
It intentionally prints checksums as well as the workload so a benchmark run
cannot silently skip the computation. Wall-clock timings should be collected
on the machine where the result is reported:

```text
moon run --target native cmd/bench
Measure-Command { moon run --target native cmd/bench }
```

The workload is a deterministic 200 x 12 numeric table with 20% missingness,
20 rounds per method, KNN `k=5`, and three deterministic chained-equation
iterations. The checksum and missing-cell count are correctness guards; wall
clock time is environment-dependent and should be recorded with the toolchain
version shown by `moon version --all`.
# MoonMissingness benchmark record

This benchmark is a deterministic native smoke workload for the August MoonBit
hackathon acceptance package. It is intentionally small enough for CI while
exercising diagnosis, KNN imputation, MICE-style iterative imputation, and
holdout evaluation.

## Workload

- synthetic dense source: `200 x 12`, seed `17`
- requested missing rate: `0.2`
- generated missing cells: `477` / `2400` (`0.19875` actual rate)
- unique missingness patterns: `24`
- repeated checksum rounds: `20`
- KNN neighbors: `5`
- MICE iterations: `3`, stochastic scale `0.0`
- holdout: deterministic 10% of observed cells, seed `17`

## Reproduction

```text
moon run --target native cmd/bench
```

Acceptance output captured on 2026-08-18 with Moon `0.1.20260807` and Moonc
`0.10.7`:

```text
actual_missing_cells=477
actual_missing_rate=0.19875
pattern_count=24
quality_score=0.80125
mean_impute_checksum=64851810.91227517
knn_impute_checksum=64779603.6
mice_impute_checksum=64893757.64677953
holdout_cells=1061
holdout_mae=Some(649.1812912346851)
holdout_rmse=Some(750.081167953114)
benchmark_complete=true
benchmark_reproducible=true
```

Three local wall-clock runs, including native compilation and execution, were
`1781.27 ms`, `1804.92 ms`, and `1546.07 ms`. These are reproducibility
reference points, not a cross-machine performance claim. CI runs the same
benchmark as a smoke check and does not enforce a machine-dependent time limit.

The holdout errors are measured against values that were observed before the
deterministic mask was applied. The MCAR/MAR outputs elsewhere in the project
are engineering screening heuristics; they are not presented as a replacement
for a formal statistical test.
