PairedVerifiedConstMap, a cache-friendlier layout for the verified map, and file formats shared with the Go and Python implementations.
This release is purely additive. Nothing was removed or renamed, and the CMAP0001 and VMAP0001 formats are byte-for-byte unchanged, so anything written by 0.2.0 still loads and anything this version writes still loads there. Minimum supported Rust is now 1.80 (for <[[u64; 2]]>::as_flattened).
PairedVerifiedConstMap
VerifiedConstMap keeps values and fingerprints in two arrays, so a lookup of a present key touches six cache lines. PairedVerifiedConstMap stores each value next to its fingerprint: three cache lines, and each 16-byte slot is loaded and XORed as one 128-bit vector on x86-64 (SSE2) and AArch64 (NEON).
let pm = PairedVerifiedConstMap::new(&keys, &values)?;
assert_eq!(pm.map("apple"), 100);
assert_eq!(pm.map("unknown"), NOT_FOUND);Same semantics, same ~18 bytes/key, same API (map, map_many, map_many_into, save_to_file, load_from_file); an existing map converts with vm.paired(). Random lookups over a million present keys run 21% faster than VerifiedConstMap::map on an Apple M4 Max and 9% on an Intel Xeon Gold 6548N; map_many 18% and 34% faster cold. Absent keys are slower, since the split layout stops after its half-size fingerprint array. The README has the numbers and the guidance.
Interoperability
The formats are shared with constmap v1.2.0 (Go) and fastconstmap 0.10 (C/Python): a map saved by any of the three loads in the other two, on a little-endian host. This crate and the Go package write byte-identical files; fastconstmap adds a key count in a header word the readers ignore, and writes its ConstMap as CMAP0003, which read_from now accepts. Files written by the other implementations live under tests/interop and are checked by the test suite.
Also
- CI on x64 and arm64.
read_fromnames a file handed to the wrong loader, and a legacy fastconstmap file whose key hash differs.