Skip to content

Epic: Numeric Encoding Improvements #11890

Backlog
4 of 9 issues completed
Backlog

Description

@lwwmanning

Close most of the size gap between BtrBlocksCompressor and VortexCompact (Pco) on integer, timestamp, and float columns while keeping fast scans, random access, predicate pushdown, and GPU decode.

Results, dropped candidates, and open questions

We evaluated the full encoding portfolio across 45 datasets (13.32 GB raw, 451 leaf columns = 23 existing benchmark datasets + 22 out-of-sample spiraldb/raincloud tables) and 1M-row microbenchmarks. Full measurements are in the comments below.

Encoding tier (45 datasets, 13.32 GB raw) E2E Size (Ratio / vs core) Write (MB/s / 1T) Scan (E2E / Leaf GB/s) Random access (RA-1K / take 1% / scalar_at GM) GPU (CUDA)
core (develop baseline) 3,817.9 MB (3.49×) 3,449 / 761 30.0 / 18.2 GB/s 5.21 µs/row / 130.8 ms / 181 ns Native
+ FoR.v2 + FloatWiden (#11906, #11901) 3,344.5 MB (3.98×, -12.4%) 3,082 / 667 27.9 / 17.5 GB/s 5.40 µs/row / 125.8 ms / 193 ns Native (FoR.v2 & float Widen CUDA kernels pending)
+ Delta + PIVCO-PH (raw bitmaps) 3,051.9 MB* (4.36×, -20.1%) 2,862 / 600 19.7 / 7.61 GB/s 5.96 µs/row / 471.3 ms / 241 ns Parallel BlockScan + popc
+ Delta + PIVCO-PHA (#11892) 2,940.3 MB (4.53×, -23.0%) 2,783 / 566 18.0 / 7.00 GB/s 6.89 µs/row / 532.5 ms / 335 ns Parallel + 32-lane warp rANS
+ Delta + vortex.rans (dropped, #11978) 3,068.5 MB (4.34×, -19.6%) 2,767 / 575 12.8 / 4.76 GB/s 7.24 µs/row / 888.2 ms / 403 ns 1 warp / block, LUT contention
VortexCompact (Pco + Zstd) 2,593.0 MB (5.14×, -32.1%) 1,351 / 283 10.6 / 3.70 GB/s 24.62 µs/row / 1,229.1 ms / 5,654 ns None

*base_pivco_ph shown without Delta; with Delta, FoR.v2 + FloatWiden + Delta + PIVCO-PHA captures 71.7% of Compact (Pco + Zstd) total savings (-877.6 MB of -1,225.0 MB) while writing 2.06× faster, scanning 1.70× faster, serving 1K random access 3.57× faster, and executing scalar_at 16.9× faster (335 ns vs 5,654 ns).

Key findings

Earlier prototypes: #9544, #10127, #10159, #10167, #10733, #11489, and #11978.

Open questions:

Sub-issues

Sub-issues

4 of 9 Issues completed
Loading 9 sub-issues

Activity

  1. added
    epic
    on Nov 23, 2026
  2. lwwmanning commented on Nov 24, 2026

    @lwwmanning
    ContributorAuthor

    Posted by Claude Opus 5.5 on Will's behalf.

    These are the ablation measurements that were in the bodies of this epic and its sub-issues before the bodies were shortened. The runs covered all 110 integer and temporal columns in compress-bench and 37 float columns from compress-bench and vector-search (OpenaiSmall50k, GloveSmall100k). Each forced encoding was measured apart from the sample-based selector, for compressed bytes, encode and decode time, scalar_at, filter and take at 1%, 10%, and 50%, and compare.

    Corpus totals

    Corpus Default Best new pipeline Savings VortexCompact (Pco)
    110 integer and temporal columns, Delta off 863.71 MB 674.04 MB (FoR.v2 + Affine) −21.96% (−189.7 MB) 487.13 MB (−43.60%, 13–20 µs scalar_at)
    110 integer and temporal columns, Delta on 796.08 MB (v1+Delta) 654.83 MB (FoR.v2 + Affine + Delta) −17.74% vs v1+D, −24.18% vs v1 487.13 MB
    37 float columns 1,412.55 MB 1,132.26 MB (float Widen) −19.84% (−280.3 MB) 924.85 MB (−34.53%)
    OpenaiSmall50k (f64 embeddings) 548.57 MB, 34.2 ms decode 270.17 MB, 28.2 ms decode −50.75% (−278.4 MB) 255.44 MB, 113.7 ms decode

    Integers (#11884, #11885)

    • AffineScheme alone: 863.7 → 676.8 MB (−21.64%, −186.9 MB) with Delta off, and 796.1 → 656.0 MB (−17.59%, −140.1 MB) over v1 + Delta with Delta on.
    • Taxi datetime columns with Affine: −50.5% (−137 MB). Full decode of taxi.pickup_datetime takes 3.42 ms, and 24.66 ms with Dict. A 1% filter takes 3.75 ms, and 0.65 ms with Dict.
    • Single-tier Affine (without the options != FOR guard): +63.4 MB net, with bimbo.Producto_ID +36.5%, bimbo.Cliente_ID +52.7%, and bimbo.Dev_uni_proxima +70.7%. Encoding is 2–5× slower.
    • choose_mode runs 4 candidate modes × 16 sampled chunks. Encoding is 2–5× slower on bimbo.Venta_uni_hoy and euro2016.tweeted_at.
    • Stock FoRScheme::v2(): 0.00% on the 97 native integer columns, and −1.03% overall.
    • With the 8×1,024 sampler and the patch-density penalty: −5.89% (−32.0 MB) on native integers with Delta off. euro2016.id −19.0%, airquality.pm_10 −28.4%, bimbo.Dev_uni_proxima −33.4%. The penalty caused no regression on any of the 110 columns, and it prevented size regressions on hashtags.
    • Unguarded FoR.v2 on tpch_lineitem.l_shipdate: 2.26× slower decode for +5 KB. Wrapping RunEnd.ends makes scalar_at 10× slower on bimbo.Cliente_ID.
    • FoR.v2 with 64-bit residuals on taxi.trip_time, where the residuals fit in u16: 2.3× slower decode than Affine[FOR].

    Blocked BitPacked (#11886)

    • Over FoR.v2 with Delta off: 828.3 → 822.4 MB (−0.70%, −5.83 MB). Gross wins of 17.16 MB, offset by 11.91 MB of selector regressions, mostly taxi.on_scene_datetime (+11.58 MB).
    • With Delta on: 796.7 → 795.3 MB (−0.18%, −1.41 MB).
    • scalar_at: 1.2–4.6× slower with plain block_offsets, and 15–35× slower (4.5–8.8 µs per probe) when Delta encodes them. bimbo.Venta_uni_hoy goes from 248 ns to 8,742 ns per probe, and euro2016.id from 29 ns to 6,946 ns.
    • Encoding: 1.6–3.3× slower than BitPacked.v1.

    Floats (#11883, #11887)

    • Float Widen across the 37 columns: 1,412.5 → 1,132.3 MB (−19.84%, −280.3 MB), which is 57.5% of the gap to Pco.
    • OpenaiSmall50k (76.8M values, 614.4 MB raw): f64 ALPRD 548.57 MB, 34.20 ms decode. Widen 270.17 MB (−50.7%), 28.23 ms decode. Pco 255.44 MB, 113.74 ms decode. FloatQuant 326.40 MB. Widen captures 95.0% of the Pco gap, beats FloatQuant by 56.23 MB (17.2%), and decodes 1.21× faster than ALPRD and 4.03× faster than Pco (M4 Max).
    • FloatQuant also decodes 1.30× slower than Widen. On tabular floats with trailing mantissa zeros, ALP and Dict beat it by 15%–600%. Its second secondary child saved 0.01% (91.8 KB of 4.22 GB) and broke compare pushdown. The suite has no bf16-in-f32 chunks.
    • OrderedFloat (with FoR.v2 or Delta) helps only two small 4 MB HashTags columns: −0.05% (−638 KB) across 1.41 GB, with 6 selector regressions. With Delta, it wins 0 of 37 columns.
    • Taxi.congestion_surcharge dictionary: 4.79 MB as f64 with 2-bit codes, 2.94 MB (−38.6%) as f32 with 1-bit codes.

    The remaining gap to Pco (#11892)

    • Of the 37 float columns with a gap above 10%, 1 is exact f32-in-f64 and 2 are local-drift floats (HashTags). The other 34 owe the gap to entropy coding, mostly integer Pco on ALP residuals and Dict codes.
    • Pco is 35% to 44% smaller on those columns. Full decode takes 113.7 ms on OpenaiSmall50k and 45.1 ms on GloveSmall100k (0.3–0.6 GB/s), and a random scalar_at takes 13–20 µs.

    BitPacked take (#11889)

    • cmsprovider.BENE_DAY_SRVC_CNT (bw=10, 147,510 patches): 10% take 4.67 ms, full decode 1.76 ms, 50% take 3.11 ms.
    • food.subscribers (bw=6, 168,246 patches): 10% take 3.43 ms, full decode 0.29 ms, 50% take 1.08 ms.
  3. lwwmanning commented on Nov 25, 2026

    @lwwmanning
    ContributorAuthor

    Posted with AI assistance on Will's behalf.

    Phase 2 head-to-head measurements comparing Pow2-Bin + PIVCO (vortex.pivco in PH, PHA, and OP-PHA modes, #11892) against vortex.rans (with adaptive block_shift 1,024 / 2,048 / 4,096, #11978), NoRegrets (FoR.v2 #11906 + FloatDict #11900 + BitPacked take #11898), and VortexCompact (Pco + Zstd). All runs executed sequentially in release mode on an Apple M4 Max (MiMalloc) with bit-exact round-trip verification across all 24 datasets and 182 leaf columns.

    24-dataset end-to-end VortexFile totals (11,001.5 MB raw)

    Arm Total size (MB) vs NoRegrets vs vortex.rans Ratio Write (s) Geomean scan (GB/s) Scan wall (s) RA-1K (ms) Sel 1% (ms) Pred < med (ms) Leaf cols won
    no_regrets 3,440.01 — +207.92 MB 3.20× 2.99 19.55 0.400 210.5 193.5 207.5 0 / 182
    rans (+ Delta + rANS) 3,232.09 −207.92 MB (−6.04%) — 3.40× 3.28 14.83 0.836 261.9 296.0 486.2 67 / 182
    pivco_ph (+ Delta + PH) 3,149.75 −290.26 MB (−8.44%) −82.34 MB (−2.55%) 3.49× 3.25 15.31 0.571 234.2 245.0 335.8 83 / 182
    pivco_pha (+ Delta + PHA) 3,121.96 −318.05 MB (−9.25%) −110.13 MB (−3.41%) 3.52× 3.28 15.50 0.604 252.7 265.4 338.8 87 / 182
    pivco_op_pha (+ Delta + OP-PHA) 3,132.21 −307.80 MB (−8.95%) −99.88 MB (−3.09%) 3.51× 3.32 15.18 0.638 258.5 274.1 360.1 82 / 182
    compact_pco 2,303.95 −1,136.06 MB (−33.02%) −928.14 MB (−28.72%) 4.78× 5.99 8.96 1.048 889.9 880.0 631.9 —

    Largest dataset differences (PIVCO-PHA vs vortex.rans)

    • StatPopGen (1,697.4 MB raw, 10,000 variants): 223.69 MB (NoRegrets, 6.4 GB/s) → 171.51 MB (rANS, 2.9 GB/s) → 157.83 MB (PIVCO-PH, 4.5 GB/s) → 144.93 MB (PIVCO-PHA, 4.2 GB/s, −26.58 MB vs rANS). Pco: 113.73 MB (2.4 GB/s, 608.6 ms RA-1K vs 193.9 ms PIVCO-PHA).
    • Bimbo (3,115.6 MB raw): 422.62 MB → 364.68 MB (rANS, 31.8 GB/s) → 338.54 MB (PIVCO-PHA, 43.1 GB/s, −26.14 MB vs rANS).
    • Taxi (2,299.8 MB raw): 408.84 MB → 381.28 MB (rANS, 54.3 GB/s) → 356.81 MB (PIVCO-PHA, 65.0 GB/s, −24.47 MB vs rANS).
    • CMSprovider (687.5 MB raw): 335.77 MB → 290.82 MB (rANS, 17.1 GB/s) → 267.26 MB (PIVCO-PHA, 22.5 GB/s, −23.56 MB vs rANS).
    • Arade (435.1 MB raw): 131.64 MB → 131.46 MB (rANS) → 127.00 MB (PIVCO-PHA, −4.46 MB).
    • GloveSmall100k (81.6 MB raw): 65.56 MB → 65.56 MB (rANS) → 62.00 MB (PIVCO-PHA, −3.56 MB).
    • Food (83.5 MB raw): 34.73 MB → 25.85 MB (rANS, 17.7 GB/s) → 24.64 MB (PIVCO-PHA, 30.5 GB/s, −1.21 MB).

    1M-row single-core microbenchmarks (PIVCO vs vortex.rans vs Pco)

    Distribution Codec bpv Enc (MB/s) Dec (MB/s) scalar_at (ns) filter 1% (ms) take 1% (ms) cmp == 0 (GB/s) cmp < K (GB/s)
    GT_u64 ({0,1,2}) rANS(b12=4K) 1.07 2,622 7,114 2,263 1.04 1.21 7.1 7.0
    GT_u64 PIVCO-PH(b12=4K) 1.25 3,650 51,850 1,185 0.18 0.16 941.2 950.6
    GT_u64 PIVCO-PHA(b12=4K) 0.99 2,758 21,970 1,787 0.40 0.37 39.1 41.4
    Skew95_u32 (95% 0) rANS(b12=4K) 0.49 1,456 4,858 1,812 0.78 0.80 4.5 4.8
    Skew95_u32 PIVCO-PHA(b12=4K) 0.39 1,521 17,088 1,626 0.23 0.21 37.2 37.9
    Zipf64_u32 (K=8) rANS(b12=4K) 2.87 903 1,588 5,527 2.52 2.52 1.6 1.6
    Zipf64_u32 PIVCO-PHA(b12=4K) 2.74 1,726 4,666 1,932 0.73 0.86 405.1 5.1
    Zipf64_u32 PIVCO-OP-PHA(b12=4K) 2.84 1,584 3,899 2,298 0.86 0.94 484.8 29.5
    PL_i32 (K=64) rANS(b10=1K) 7.48 1,062 1,699 1,352 2.36 2.23 1.6 1.7
    PL_i32 rANS(b12=4K) 6.83 1,030 1,568 5,186 2.52 2.59 1.6 1.6
    PL_i32 PIVCO-PH(b11=2K) 6.78 1,791 4,553 1,108 0.75 0.74 35.2 4.5
    PL_i32 PIVCO-PHA(b12=4K) 6.72 1,713 5,611 1,912 0.84 0.75 45.4 5.0
    PL_i32 PIVCO-OP-PHA(b12=4K) 6.95 1,974 5,039 1,855 0.68 0.77 31.0 393.5
    Geom_u32 (K=8) rANS(b12=4K) 3.48 1,153 1,483 6,090 2.83 2.89 1.4 1.5
    Geom_u32 PIVCO-PHA(b12=4K) 3.39 2,791 4,497 2,214 0.72 0.86 42.6 5.0
    Geom_u32 PIVCO-OP-PHA(b12=4K) 3.40 2,595 4,811 2,380 0.94 0.76 39.0 30.5
    Laplacian_zz_i32 rANS(b12=4K) 3.48 905 1,454 5,817 2.78 2.69 1.4 1.4
    Laplacian_zz_i32 PIVCO-PHA(b12=4K) 3.37 1,567 4,024 2,202 0.84 0.84 4.0 3.9
  4. lwwmanning commented on Nov 26, 2026

    @lwwmanning
    ContributorAuthor

    Posted with AI assistance on Will's behalf.

    Phase 3 portfolio and ablation measurements across 45 unique datasets (13,318.3 MB raw, 451 numeric/temporal/decimal leaf columns) = 23 existing benchmark datasets (10,388.3 MB raw, 182 leaf columns) + 22 out-of-sample spiraldb/raincloud datasets (2,930.0 MB raw, 269 leaf columns). All arms ran sequentially in --release (MiMalloc, Apple M4 Max) with bit-exact round-trip verification (10,898+ checks, 0 failures).

    1. 45-Dataset Compression Ladder (13,318.3 MB raw Part A, 451 leaf columns Part B)

    Arm Total Size (MB) Δ vs core Ratio Write (MB/s) 1T Enc (MB/s) Full Scan (GB/s) Leaf Dec (GB/s) RA-1K (µs/row) Flt 1% (ms) Take 1% (ms) scalar_at Med / GM (ns)
    core (develop) 3,817.94 — 3.49× 3,449 761.1 30.03 18.24 5.21 102.6 130.8 206 / 181
    core_for_v2 (+ FoR.v2) 3,776.65 −41.29 (−1.08%) 3.53× 3,038 698.6 28.25 18.35 5.74 102.6 126.6 226 / 195
    base (+ FoR.v2 + FloatWiden) 3,344.49 −473.46 (−12.40%) 3.98× 3,082 667.3 27.87 17.48 5.40 103.4 125.8 226 / 193
    base_delta (+ Delta) 3,266.09 −551.85 (−14.45%) 4.08× 3,334 678.7 29.20 17.26 5.65 113.3 136.4 249 / 232
    base_rans (+ vortex.rans) 3,148.71 −669.23 (−17.53%) 4.23× 2,762 589.7 13.20 4.97 6.82 767.8 849.1 354 / 299
    base_pivco (+ vortex.pivco) 3,018.55 −799.39 (−20.94%) 4.41× 2,840 581.1 18.95 7.20 6.05 499.5 507.1 357 / 259
    base_delta_rans 3,068.47 −749.47 (−19.63%) 4.34× 2,767 575.1 12.75 4.76 7.24 813.2 888.2 473 / 403
    base_delta_pivco (FoR.v2+Widen+Delta+Pivco) 2,940.30 −877.64 (−22.99%) 4.53× 2,783 565.6 18.01 7.00 6.89 520.1 532.5 445 / 335
    base_all_pivco (+ Affine) 2,921.08 −896.86 (−23.49%) 4.56× 2,572 478.2 17.76 7.04 7.09 522.0 537.0 434 / 334
    compact_pco (Pco + Zstd) 2,592.96 −1,224.98 (−32.08%) 5.14× 1,351 283.4 10.60 3.70 24.62 1,263.9 1,229.1 12,677 / 5,654

    2. Corpus Split: Existing-23 (10.39 GB) vs Out-of-Sample Raincloud-22 (2.93 GB)

    Arm Existing-23 Size (MB) Existing-23 Scan / Dec (GB/s) Raincloud-22 Size (MB) Raincloud-22 Δ vs core Raincloud-22 Scan / Dec (GB/s)
    core 2,920.39 26.30 / 19.50 897.55 — 60.44 / 17.00
    core_for_v2 2,893.69 24.68 / 19.60 882.96 −14.59 (−1.63%) 57.91 / 17.12
    base (+ FloatWiden) 2,612.99 24.16 / 18.95 731.50 −166.05 (−18.50%) 61.01 / 16.06
    base_rans 2,451.61 11.16 / 4.28 697.10 −200.45 (−22.33%) 37.70 / 6.07
    base_pivco 2,338.20 16.22 / 6.24 680.35 −217.20 (−24.20%) 47.00 / 8.72
    base_delta_pivco 2,290.85 15.51 / 6.21 649.45 −248.10 (−27.64%) 41.91 / 8.20
    base_all_pivco (+ Affine) 2,281.56 15.23 / 6.19 639.51 −258.04 (−28.75%) 43.24 / 8.33
    compact_pco 2,045.13 9.32 / 3.68 547.83 −349.72 (−38.96%) 20.66 / 3.71

    3. BitPacked.v2 (#11886) Marginal & Oracle Ceiling Ablation (451 Leaf Columns, v1 Active Alongside v2)

    Pair (without → with + bp.v2) 45-DS E2E Δ 451-Col Part B Δ Part B Oracle Ceiling Σ min(w/o, w/) Write Δ Full Scan Δ (Raincloud / PublicBI) scalar_at GM (Adopted)
    core → core_bp_v2 −103.15 MB (−2.70%) −60.43 MB (−1.63%) −60.65 MB (−1.63%) −16.2% −13.2% (−18.4% / −43.4%) 325 → 392 ns
    base → base_bp_v2 −118.79 MB (−3.55%) −71.63 MB (−2.20%) −71.92 MB (−2.21%) −12.3% −4.6% (−16.9% / −33.6%) 356 → 417 ns
    base_delta → base_bp_v2_delta −117.16 MB (−3.59%) −63.48 MB (−1.99%) −63.82 MB (−2.00%) −18.2% −10.0% (−13.6% / −34.0%) 431 → 540 ns
    base_pivco → base_bp_v2_pivco −23.48 MB (−0.78%) −19.80 MB (−0.66%) −20.19 MB (−0.68%) −5.4% +0.3% (−13.1% / −7.1%) 521 → 577 ns
    base_all_pivco → base_all_pivco_bp_v2 −28.15 MB (−0.96%) −8.20 MB (−0.28%) −9.04 MB (−0.31%) −4.6% +1.6% (−10.8% / −3.1%) 758 → 859 ns
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

    epic

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions