# Benchmarks

The benchmark suite is a deterministic numerical regression suite. It measures profile error against the built-in reference profile, mass conservation, mean speed, and a stability flag. It is not a claim about hardware-independent wall-clock performance.

## Command

```bash
moon run cmd/main
```

## Measured numerical results

The following output was captured locally on 2026-08-24 with MoonBit `0.1.20260807` and the repository at package version `0.2.1`:

| case | cells | steps | L2 error | Linf error | mass drift | mean speed | stable |
|---|---:|---:|---:|---:|---:|---:|:---:|
| poiseuille | 240 | 30 | 0.00009308978201884709 | 0.0001332887815304832 | 1.1368683772161603e-13 | 0.00003845777284486775 | true |
| lid-driven-cavity | 400 | 20 | 0.0012438467125859226 | 0.002187145750030638 | 5.684341886080802e-14 | 0.0011953339998071561 | true |
| cylinder-wake | 512 | 20 | 0.002470507622236201 | 0.006583720742330434 | 1.1368683772161603e-13 | 0.001209115610889198 | true |

All three cases were stable in that run (`stable_cases=3/3`). The measured mass drift is at floating-point round-off scale for these short regression cases.

## CLI smoke timing

As a separate local smoke measurement, three warm-build PowerShell samples for `moon run cmd/main` took **200.8437 ms**, **186.4999 ms**, and **205.2664 ms** wall time on the development machine. This includes Moon's command/process overhead and is provided only as a reproducible local reference, not as a portable performance claim.

## Extending the suite

Use `run_resolution_study` for multiple grid sizes, `BenchmarkGate` for explicit numerical thresholds, and `benchmark_suite_csv` for machine-readable output. Keep reference data and thresholds close to the case definition so changes to collision, boundary, or streaming code produce an observable diff.
