()
| 309 | |
| 310 | #[test] |
| 311 | fn compression_ratio() { |
| 312 | let data = make_normalized_vectors(1000, 128); |
| 313 | let encoded = encode(&data, 128, 1000).unwrap(); |
| 314 | let raw_size = data.len() * 4; |
| 315 | let ratio = raw_size as f64 / encoded.len() as f64; |
| 316 | // Spherical transform regularizes data for better lz4 compression. |
| 317 | // Should not expand data significantly. |
| 318 | assert!(ratio > 0.9, "should not expand >10%, got {ratio:.2}x"); |
| 319 | } |
| 320 | |
| 321 | #[test] |
| 322 | fn normalization_check() { |
nothing calls this directly
no test coverage detected