feat(fastlanes): put per-chunk bit widths behind a preview edition - #9754
feat(fastlanes): put per-chunk bit widths behind a preview edition#9754mhk197 wants to merge 2 commits into
Conversation
5239669 to
f3fd087
Compare
Merging this PR will regress 2 benchmarks
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | random_i8[0.8] |
69.4 µs | 98.7 µs | -29.72% |
| ❌ | WallTime | arrow_checked_add_u32_avx512[16384] |
17.6 µs | 21.2 µs | -17% |
| ⚡ | WallTime | arrow_checked_add_u32_neon[16384] |
20.3 µs | 12.8 µs | +58.2% |
| ⚡ | Simulation | random_i8[0.5] |
90.8 µs | 66.9 µs | +35.68% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing mk/bitpacked-v2-editions (01b289f) with mk/bitpacked-v2 (b5b9d6d)2
Footnotes
-
206 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
mk/bitpacked-v2(013afc1) during the generation of this report, so 2cf069e was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
b978a04 to
9d950f7
Compare
9d950f7 to
01b289f
Compare
…ut needs Scheme::produced_serialized_ids defaults to the produced encodings, and the file writer now retains BtrBlocks schemes by the serialized IDs permitted by the enabled editions instead of their in-memory encodings. Nothing changes for encodings with a single wire format; an encoding with several formats can now have a scheme gated per format. Signed-off-by: Matt Katz <mhkatz97@gmail.com>
Declare preview2026.09.0 with fastlanes.bitpacked_v2 and make it the default preview edition. Add BitPackingV2Scheme: it produces BitPacked arrays with a width per chunk and declares that its output needs the v2 format, so a writer whose editions do not permit v2 drops it and falls back to BitPackingScheme. While it is present BitPackingScheme defers to it, so FoR residuals and sampled estimates use per-chunk widths too. The scheme re-encodes the width table child through the cascade. The CUDA-compatible preset excludes it. The scheme returns the original array when half or more of the values would be patches. A few wide values otherwise pack at width 0 with nearly every value patched, which beats raw storage by a couple of buffer bytes and loses them back in footer metadata. Signed-off-by: Matt Katz <mhkatz97@gmail.com>
01b289f to
6258f9d
Compare
|
|
||
| #### `preview2026.09.0` | ||
|
|
||
| - `array`: `fastlanes.bitpacked_v2` |
There was a problem hiding this comment.
just a caution that preview means that we are 99% certain that this is the right serialisation format
Summary
Stacked on #9750. Lets the writer emit the
fastlanes.bitpacked_v2format, gated by editions.preview2026.09.0, a draftpreviewedition whose only member isfastlanes.bitpacked_v2, and makes it the facade'sDEFAULT_PREVIEW_EDITION.preview2026.08.0stays empty.Scheme::produced_serialized_ids(default: the produced encodings) and has the writer filter BtrBlocks schemes against the enabled editions' serialized IDs rather than in-memory encodings. Every existing scheme is unaffected, since its encodings have one format each; the new hook is what lets one in-memory encoding with two formats be gated per format.BitPackingV2Scheme. It produces ordinaryBitPackedarrays with per-chunk widths and declares that its output needsfastlanes.bitpacked_v2, so a writer whose editions do not permit that format drops the scheme and falls back toBitPackingScheme. No cargo feature gates it: in-memory compression uses per-chunk widths everywhere, and only the wire format is edition-gated. While it is present,BitPackingSchemedefers to it, so FoR residuals and sampled estimates get per-chunk widths too and the two schemes never compete. The width table child is re-encoded through the cascade'scompress_child, like the children of the decimal and temporal schemes. The CUDA-compatible preset excludes it, since there is no per-chunk CUDA kernel yet. The scheme returns the original array when half or more of the values would be patches: a few wide values otherwise pack at width 0 with nearly everything patched, which beats raw storage by a couple of buffer bytes and loses them back in footer metadata.Tests
preview_2026_09_adds_bitpacked_v2: the edition is a draft and adds exactly that format ID.core_writer_never_emits_bitpacked_v2: a session with the default encodings and only the core edition enabled writes a column whose chunks need 1 to 22 bits, and every array it produces reads back asfastlanes.bitpacked.preview_writer_emits_bitpacked_v2(unstable_encodings, since only then does the facade enable the preview edition): the default session writes the same column asfastlanes.bitpacked_v2and it reads back equal.test_mostly_patched_stays_primitive: six i64 values, five of them wide, stay primitive instead of becoming width 0 with five patches.cuda_compatible_excludes_per_chunk_bitpacking: the CUDA preset keepsBitPackingSchemeand drops the per-chunk scheme.vortex-btrblocksgolden snapshots now show per-chunk widths and awidth_tablechild for bit-packed columns in both the default andunstableconfigurations; the four default goldens that change all shrink. The tables in the goldens stay primitive, since nothing beats raw storage for 2 to 17 bytes.Validation
cargo nextest run -p vortex-compressor -p vortex-file -p vortex-edition -p vortex-btrblocks -p vortex editions, with and without--features unstable_encodingscargo clippy --all-targets --all-featureson vortex-compressor, vortex-file, vortex-edition, vortex-btrblocks, andvortexwithunstable_encodings;cargo +nightly fmt --all