Commit Graph

1 Commits

Author SHA1 Message Date
Alex Payne
0c0c5223c9 Tests #54: Add unit tests for PolarQuant encode/decode
All checks were successful
Smoke Test / smoke (pull_request) Successful in 8s
- New tests/test_polar_quant.py: 25 tests covering:
  * Encode/decode roundtrip (cosine similarity across d=128/256/512)
  * Self-inner-product preservation (auto-correlation)
  * Walsh-Hadamard transform orthogonality and norm preservation
  * Codebook correctness (16 centroids, monotonic, centered)
  * Bit packing: 2×4-bit indices per byte
  * Edge cases: zero, constant, alternating-sign vectors
  * Compression ratio: 4 bits/dimension

Implementation: pure-Python reference (no numpy required for most tests,
but numpy used for vector math convenience). All thresholds calibrated
against C++ llama-turbo.cpp baseline (roundtrip_test.cpp).

Closes #54
2026-04-26 06:45:00 -04:00