Skip to content

fix(encoding): skip full-width block bitpacking - #9598

Merged
wjones127 merged 1 commit into
mainfrom
gatekeeper/fix-9597-1
Sep 29, 2026
Merged

wjones127 merged 1 commit into
mainfrom
gatekeeper/fix-9597-1

Conversation

@lance-gatefixer

Copy link
Copy Markdown
Contributor

Cause

try_bitpack_for_block selected out-of-line bitpacking even when the measured width equaled the value width. Negative Int64 dictionary values produce a 64-bit width, so a runt dictionary tail hit the nonzero-savings assertion in debug builds.

Fix

Skip block bitpacking at full width and allow the existing general or raw compression fallback. This changes codec selection without changing the file format.

Validation

  • Reproduced the v2.2 and v2.3 writer panic before the fix; the same round-trip cases pass after it, with v2.1 as a control.
  • The selector regression covers both a 1600-value runt tail and 2048 complete values.
  • cargo test -p lance-encoding --lib test_block_skips_full_width_bitpacking
  • cargo test -p lance-file --lib test_negative_dictionary_values_with_runt_tail
  • cargo fmt --all
  • cargo clippy --all --tests --benches -- -D warnings

Fixes #9597

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@github-actions github-actions Bot added A-encoding Encoding, IO, file reader/writer bug Something isn't working labels Sep 29, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Gate recommendation: approve.

The full-width guard closes the codec-selection path behind the reported v2.2/v2.3 writer panic. Those values now use the existing raw or general compression fallback, preserving the file encoding contract. The focused selector cases and v2.1–v2.3 writer round-trips pass.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-encoding Encoding, IO, file reader/writer bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: v2.2+ writer panics with "tail_bit_savings must be non-zero" when dictionary values of an int column contain negatives

1 participant