 
|
c3aad548ff
|
test: achieve 100% code coverage across all modules
Added tests for:
- codebook.py: extreme narrow finite interval fallback, both-infinite pragma
- turboquant.py: compressed_size_bits method
- utils.py: pack_indices invalid bit_width ValueError
133 tests, 100% coverage (330 statements, 0 missed).
Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
2026-03-24 21:18:46 -05:00 |
|
 
|
fe7c5f9ad2
|
feat: codebook construction for PolarQuant (codebook.py) #3
Implements optimal scalar quantization codebooks:
- Closed-form centroids for 1-bit (±√(2/πd)) and 2-bit ({±0.453, ±1.51}/√d)
- Lloyd-Max algorithm for 3+ bit codebooks on Gaussian approximation
- Vectorized nearest centroid lookup via searchsorted
22 tests, 93% coverage.
Reviews:
- Codex: fixed extreme tail CDF cancellation (use sf() for upper tail),
added asymptotic fallback for extreme intervals, removed unused vars
- Roast: running in background (will address in follow-up if needed)
- Added brute-force correctness test for nearest_centroid_indices
Co-Authored-By: tturney@psyguard.ai
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
2026-03-24 21:00:07 -05:00 |
|