Skip to content

Handle array evolution in compressor schemes with replacement semantics - #9919

Closed
mhk197 wants to merge 1 commit into
developfrom
mk/scheme-replaces
Closed

mhk197 wants to merge 1 commit into
developfrom
mk/scheme-replaces

Conversation

@mhk197

@mhk197 mhk197 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Summary

An encoding with two wire formats needs two compression behaviors.

For example, we should be able to compress wide decimals into lower parts only when the writer may emit vortex.decimal_byte_parts.v2. Otherwise we must keep producing single-part arrays under vortex.decimal_byte_parts. These will become two separate schemes: the original DecimalScheme and new WideDecimalScheme (name tbd). Notably, the latter will still be able to produce vortex.decimal_parts for narrow decimals.

However, this means that if the edition with vortex.decimal_byte_parts.v2 is enabled, both decimal schemes will be enabled (since editions are additive, vortex.decimal_byte_parts is also enabled). They should be mutually exclusive (otherwise they compete), and there should be some way to express that a scheme supersedes another.

This PR adds that relation. A scheme declares which schemes it replaces. When both are given to the compressor, the replaced one is dropped. When the newer one is not permitted by the writer's editions, it never reaches the compressor and the older one compresses as before.

Design

  • Scheme::replaces returns the scheme IDs this scheme supersedes. It defaults to empty.
  • CascadingCompressor::new drops every given scheme that another given scheme replaces. Replacement lists of dropped schemes still apply, so versions chain transitively. Registration order is preserved.
  • BtrBlocksCompressorBuilder::retain_allowed_encodings is unchanged. It drops schemes whose produced IDs are not all permitted, before construction, so a newer version the writer may not emit never reaches new and the version it replaces stays.

API Changes

New: Scheme::replaces and CascadingCompressor::schemes.

@codspeed

codspeed Bot commented Sep 16, 2026

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 3 improved benchmarks
❌ 1 regressed benchmark
✅ 2201 untouched benchmarks
⏩ 218 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime words_gather_scalar_avx2[65536] 8.2 µs 9.4 µs -12.05%
Simulation allocate_drop_vortex_minimal_alignment[0] 1,077.2 ns 968.9 ns +11.18%
Simulation allocate_drop_vortex[0] 1.1 µs 1 µs +10.57%
Simulation allocate_drop_bytes[0] 581.3 ns 527.2 ns +10.27%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing mk/scheme-replaces (460e49c) with develop (022c604)

Open in CodSpeed

Footnotes

  1. 218 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.

@mhk197 mhk197 changed the title Let a compression scheme replace the versions it supersedes Replacement for Compressor Schemes Sep 16, 2026
Signed-off-by: Matt Katz <mhkatz97@gmail.com>
@mhk197
mhk197 changed the base branch from mk/dbp-v2-feature to develop September 16, 2026 21:03
@mhk197 mhk197 changed the title Replacement for Compressor Schemes Handle array evolution in compressor schemes with replacement semantics Sep 16, 2026
@mhk197 mhk197 added the changelog/chore A trivial change label Sep 16, 2026
@mhk197
mhk197 marked this pull request as ready for review September 16, 2026 21:17
@mhk197
mhk197 requested review from joseph-isaacs and robert3005 and removed request for robert3005 September 16, 2026 21:17
Comment on lines +152 to +154
fn replaces(&self) -> Vec<SchemeId> {
vec![]
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

talking about this offline, but I feel that this needs to exist only on the default compressor vortex-btrblocks, rather than down here

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

Labels

changelog/chore A trivial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants