# Validation and reproducibility

This document records reproducible commands for checking the project locally.
Observed numbers are machine- and toolchain-dependent measurements.

## Toolchain

The current local toolchain reports Moonc `v0.10.9+6e6c44045` and Moon
`0.1.20260819`. CI installs the current stable toolchain from the official
installer on every run.

## Quality gates

```text
moon fmt --check
moon check --deny-warn
moon info
moon build --target native
moon test --deny-warn
moon test --target native --deny-warn
```

The test suite covers FASTQ parsing, quality and base statistics, filtering and
trimming, adapter and duplicate analysis, paired-end consistency, report
rendering, gzip input, and CLI option validation.

## CLI example

```text
moon run --target native cmd/fastq_qc -- fixtures/basic.fastq \
  --phred-offset 33 --adapter-file fixtures/adapters.txt \
  --json _build/ci/report.json --html _build/ci/report.html
```

The command creates a machine-readable JSON report and a standalone HTML
report. The same command accepts `fixtures/basic.fastq.gz`; the plain and gzip
fixtures contain equivalent data and produce equal read/base totals.

## Source accounting

```powershell
powershell -ExecutionPolicy Bypass -File scripts/source_scale.ps1
```

The script reports production MoonBit, test MoonBit, project-owned Native
code, and bundled third-party zlib separately. Build output and generated
interfaces are excluded. The current measurement is 2,495 production MoonBit
lines, 1,520 test MoonBit lines, 78 project-owned Native lines, and 21,288
third-party zlib lines.

## Benchmark

```powershell
powershell -ExecutionPolicy Bypass -File scripts/benchmark.ps1 -Runs 3
```

The deterministic 10,000-read benchmark and its local observations are recorded
in [benchmarks/2026-08-22-local.md](benchmarks/2026-08-22-local.md). Results
include input size, target, elapsed time, and throughput; they are not treated
as cross-machine performance guarantees.

## CI

`.github/workflows/ci.yml` runs on Ubuntu, macOS, and Windows. It installs the
stable MoonBit toolchain, checks formatting and generated interfaces, runs
default and Native tests, and runs the Native CLI smoke test on Linux. The
workflow uses the bundled gzip implementation and does not require private
data or external services.
