Skip to main content

Module patas

Module patas 

Source
Expand description

Patas float encoding (VLDB 2023).

Patas (“Exploiting Bitwise Structure for Lossless Floating-Point Compression”) is a byte-aligned XOR-based encoder. Like Gorilla and Chimp it XORs consecutive values, but instead of bit-packing the XOR residuals it stores them as whole bytes, yielding much faster decoding while matching or beating Gorilla compression ratios on most time-series workloads.

§Encoding format

[count: u32 LE][first_value: 8 bytes]
  for each subsequent value:
    [flag byte: trailing_zeros_bytes(high nibble) | significant_bytes(low nibble)]
    [significant_bytes: 0..=8 bytes]  (the non-zero core of the XOR)
  • trailing_zeros_bytes (0–7): number of trailing zero bytes in the XOR.
  • significant_bytes (0–8): number of bytes needed to represent the XOR after stripping trailing zero bytes. 0 means the values are identical.
  • Together these fully describe the XOR: the encoder writes only the significant_bytes middle portion; the decoder reconstructs the full 64-bit XOR by shifting and zero-filling.

§Advantages over Gorilla / Chimp

  • ~2× faster decode: byte-aligned loads avoid bit-manipulation.
  • Competitive compression: often within 5% of Chimp/Gorilla; wins on data with byte-aligned floating-point patterns (e.g. sensor data quantised to limited precision).
  • Simpler implementation: no bit writers, no leading-zero buckets, no ring buffers.

Structs§

PatasDecoder
Patas float decoder.
PatasEncoder
Patas float encoder (VLDB 2023).