# Canonical packed payload v0.1

A vector consists of D/24 blocks, D divisible by 96. Each block stores 1, 2 or 3 canonical shell IDs in stage order. All IDs lie in [0,196559]. Concatenate the block/stage IDs in row-major order. Four IDs `i0,i1,i2,i3` form the 72-bit unsigned integer `i0 | (i1<<18) | (i2<<36) | (i3<<54)`, written as 9 little-endian bytes. Rows are independent. Reserved ID values 196560–262143 are invalid.

Canonical order: Type 4 (two nonzero ±4 coordinates, lexicographic coordinate pairs then signs -4,+4) IDs 0–1103; Type 2 (Golay octads in generator-word order, eight even-parity signs in lexicographic order) IDs 1104–98255; Type 3 (Golay words in generator order and marked position 0–23) IDs 98256–196559. Divide integer vectors by sqrt(32). Golay words use the binary generator 0xAE3, ascending 12-bit message, and an even-parity extension at coordinate 23. The decoder uses the same canonical order as the archived notebooks.

Reconstruction: sum the unit codewords with the shared FP32 gain for each stage. `PackedVectors` stores the byte payload, gains, one FP32 inverse reconstructed-vector norm per row (for cosine scoring), dimension and stage count. For 768D, row payloads are 72/144/216 bytes, plus 4 bytes per row for inverse norm. Shared gains take 4/8/12 bytes total per index. A container file format with version/magic, dimensions, explicit byte order for gains/norms, checksums and metadata is not yet defined; the current API stores tensors.
