|
| 1 | +# Quantization and Arithmetic Hardening |
| 2 | + |
| 3 | +Roadmap linkage: |
| 4 | +- `t81-roadmap#2` |
| 5 | +- `t81-roadmap/PHASE1_STABILIZATION_MATRIX.md` (`P1-S2`) |
| 6 | + |
| 7 | +This document is the Phase 1 hardening checklist for `t81lib`. |
| 8 | + |
| 9 | +## Hardening Checklist |
| 10 | + |
| 11 | +- [x] Define a reproducible core arithmetic validation lane (C++ build + unit tests). |
| 12 | +- [x] Define a reproducible quantization validation lane (Python tests with explicit deps). |
| 13 | +- [x] Add one command entry point that runs both lanes in a consistent order. |
| 14 | +- [x] Require changed quantization claims to include benchmark artifact references. |
| 15 | +- [x] Route contract-impacting changes back to roadmap tracking. |
| 16 | + |
| 17 | +## Reproducible Validation Paths |
| 18 | + |
| 19 | +### Lane A: Core arithmetic (required) |
| 20 | + |
| 21 | +Runs deterministic C++ checks through CMake/CTest: |
| 22 | + |
| 23 | +```bash |
| 24 | +scripts/validate_quantization_hardening.sh |
| 25 | +``` |
| 26 | + |
| 27 | +### Lane B: Python quantization surface (optional but required for Python/API changes) |
| 28 | + |
| 29 | +```bash |
| 30 | +python3 -m venv .venv |
| 31 | +source .venv/bin/activate |
| 32 | +pip install ".[torch]" |
| 33 | +scripts/validate_quantization_hardening.sh --with-python |
| 34 | +``` |
| 35 | + |
| 36 | +## Benchmark Artifact Rule |
| 37 | + |
| 38 | +If a change alters quantization behavior or performance claims, include: |
| 39 | + |
| 40 | +1. Command used (for example `scripts/ternary_quantization_benchmark.py` args). |
| 41 | +2. Output artifact path (`benchmarks/*.csv` or `benchmarks/*.json`). |
| 42 | +3. Before/after summary in PR or issue notes. |
| 43 | + |
| 44 | +## Contract/Governance Rule |
| 45 | + |
| 46 | +When quantization behavior changes impact cross-repo assumptions, open or update linked tracking in: |
| 47 | + |
| 48 | +1. `t81-roadmap` (Phase 1 tracker), |
| 49 | +2. downstream contract consumers as needed (`t81-python`, `t81-lang`). |
0 commit comments