[ABA-14] test(vortex-fastlanes): repro for ZeroBytes scheme reporting nbytes()==0#13
Open
abnobdoss wants to merge 1 commit into
Open
[ABA-14] test(vortex-fastlanes): repro for ZeroBytes scheme reporting nbytes()==0#13abnobdoss wants to merge 1 commit into
abnobdoss wants to merge 1 commit into
Conversation
…bytes()==0 Add an ignored regression test that reproduces the bug described in ABA-14: a BitPackedArray produced from an all-zero input selects bit_width=0 (cheapest for all-zero data), which causes `bitpack_primitive` to short-circuit to `Buffer::<T>::empty()`. The VTable exposes that buffer as the sole physical buffer, so `Array::nbytes()` reports 0 for an array of 1024 logical elements. Downstream: `vortex-compressor/src/estimate.rs` maps `after_nbytes==0` from sample compression to `EstimateScore::ZeroBytes`, which `EstimateScore::is_valid` treats as ineligible for scheme selection — the scheme that achieves perfect compression of all-zero data is silently excluded from the compressor's selection. No fix is included pending a semantics decision: should `nbytes()` for a zero-bit-width scheme report virtual uncompressed size or actual byte size? See https://linear.app/abanoubdoss/issue/ABA-14 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Abanoub Doss <abanoub.doss@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#[ignore]-d regression test reproducing the ABA-14 bug:BitPackedArraybuilt from all-zero input reportsnbytes() == 0issue_aba14_bitpack_zerobytes_reports_nonzero_nbytesinencodings/fastlanes/src/bitpacking/array/bitpack_compress.rsLinear
https://linear.app/abanoubdoss/issue/ABA-14
Root cause (confirmed on develop)
When
bitpack_to_best_bit_widthprocesses an all-zero array it selectsbit_width=0(zero packed bits is cheapest).bitpack_primitiveshort-circuits at line 147–149 withBuffer::<T>::empty(). The VTable exposes that buffer as the sole physical buffer, soArray::nbytes()(which sums buffer lengths) returns0for an array that logically holds 1024 elements.Downstream consequence
vortex-compressor/src/estimate.rsmapsafter_nbytes == 0from sample compression toEstimateScore::ZeroBytes.EstimateScore::is_valid(line 142–149) returnsfalseforZeroBytes, so the scheme that achieves perfect compression of all-zero data is silently excluded from the compressor's selection.Open question
Should
nbytes()for a perfectly-compressible scheme like ZeroBytes (bit_width==0) report:len * ptype.byte_width()) — preserves comparability with uncompressed arrays in the estimator, but misrepresents actual storageCurrently
0causesvortex-compressor/src/estimate.rs:122–149to classify the result asZeroBytesand exclude it from selection. The TODO comment at line 113–116 inestimate.rsalready acknowledges this ambiguity.Validation
cargo test -p vortex-fastlanes -- issue_aba14(with#[ignore]removed) panics withnbytes=0 with bit_width=0#[ignore]restored🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com