# Contributor scripts

Run from the repository root. See [Contributing](../../CONTRIBUTING.md) for setup
and [testing](testing.md) for requirements. Paths below are relative to `scripts/`.

| Path | Purpose |
| --- | --- |
| `quality-matrix` | Supported-runtime checks, then latest-runtime performance |
| `test-quality-matrix` | Orchestration tests using simulated containers and Mix commands |
| `check-performance` | Benchmarks with CI's VM settings |
| `performance-regression.exs` | Guarded workloads and fixed-baseline comparisons |
| `benchmarks/` | Focused rendering/image benchmarks |
| `fixtures/` | Browser sheets and PNG/PDF cases |
| `data/` | HTML entities, quotation data and licenses |
| `examples/` | Documented HTML/PDF examples |

## Common commands

| Task | Command |
| --- | --- |
| Full matrix, two concurrent lanes | `./scripts/quality-matrix` |
| Serial matrix for smaller hosts | `QUALITY_MATRIX_JOBS=1 ./scripts/quality-matrix` |
| Validate/print runtime config without Docker | `./scripts/quality-matrix --matrix-json` |
| Performance | `mise exec -- ./scripts/check-performance` |
| Browser sheets | `MIX_ENV=test mise exec -- mix run scripts/fixtures/build-browser-sheets.exs` |
| HTML/PDF examples | `mise exec -- mix run scripts/examples/generate-html-to-pdf.exs` |

Raise `QUALITY_MATRIX_JOBS` for additional runtimes only when resources allow.

## Regeneration rules

| Concern | Rule |
| --- | --- |
| Prerequisites | Read the generator header for required inputs and tools |
| Reference inputs | Review regenerated bytes and retain provenance |
| Performance identity | Keep workload IDs, logical input keys, hashes and guard membership; `input_sources` records current paths |
| Moved inputs | Moving a file never resets reduction, timing or size baselines |
| Temporary work | Experiments in `tmp/`; validation evidence in `.quality/` |
| Script names | Use the operation and feature |
