Skip to content

F32 two-decimal floats compress to 104% of raw (vortex-jni: 22%); F64 skips bitpacking under ALP #458

Description

@dfa1

Low-precision floats, such as probabilities rounded to two decimals, compress far worse with vortex-java than with vortex-jni on the same data. For F32 the output is larger than raw.

Data

These are the 1,124 probabilities in the cached jev-1.13.0 answers (jev4j src/test/resources/jev/*.json: yes/no scores, confidences, choice and score distributions).

  • Every value has two decimals in [0, 1]. Only 99 distinct values occur; 39% are 0.0 and 10% are 1.0.
  • Three values are float artifacts (0.5700000000000001, 0.9299999999999999).
  • Shannon entropy is about 4.4 bits/value.

Repro: draw 1M rows at random from those values (new Random(42)), as a single non-nullable column p, written in 65,536-row batches with WriteOptions.defaults() and with vortex-jni 0.86.1 (Arrow Float4/Float8).

Result (1M rows)

raw vortex-jni vortex-java
F64 8.0 MB 915 KB: vortex.alp → fastlanes.bitpacked (~7.3 bits/value) 1.0 MB: vortex.alp → vortex.primitive, no bitpacking (~8.1 bits/value)
F32 4.0 MB 881 KB: vortex.dict → fastlanes.bitpacked (~7.0 bits/value) 4.18 MB: vortex.alp with its i32 integers stored as plain vortex.primitive (~33 bits/value)

Expected

Pick encodings the way Rust does: replicate the vortex-jni choices by diffing the two encoding trees on the same input.

  • F32: ALP's encoded i32 child must cascade (narrowing/bitpacking) as the F64 path partly does, and vortex.dict should be a candidate where Rust's float dict scheme wins.
  • F64: the ALP integers should be bitpacked, as Rust does.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions