SpectraREML is a reusable batch AI-REML engine for many continuous traits that share one genomic relationship matrix (GRM).
For each task, it fits
\[
y = X\beta + Zu + e, \qquad
u \sim N(0,\sigma_g^2G), \qquad
e \sim N(0,\sigma_e^2I).
\]
The engine diagonalizes the GRM once, rotates the common design and every unique task-specific covariate once, rotates phenotypes in blocks, and fits independent REML tasks in parallel.
## Features
- C++17 numerical core using oneMKL or OpenBLAS/LAPACKE.
- GRM eigendecomposition once per task set.
- AI-REML with a strong-Wolfe line search; no EM updates.
`results.tsv.gz` retains the complete per-task summary and stores the fixed-effect vector and row-wise packed lower covariance as JSON arrays.
## Recovery and provenance
Each block is written as four files, with `.complete` renamed last. The Python layer adds `run.signature.json`, which binds the canonical manifest, engine SHA-256, numerical options, thread settings, and block size.
-`--resume` reuses complete blocks only when the signature matches exactly.
-`--force` invalidates the old signature before deleting old blocks and starting a new generation.
-`finalize` refuses blocks that are not bound to the current manifest.
-`--dry-run` does not mutate output state.
## Threading
Use one BLAS thread with multiple outer task threads unless benchmarking shows otherwise:
```bash
export MKL_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
export OMP_DYNAMIC=FALSE
```
Then set `--threads` to the physical cores allocated to the process.
See [docs/FORMAT.md](docs/FORMAT.md) for the exact file contract.