fix(fsst): adaptive i32→i64 codes_offsets promotion#7851
Draft
fix(fsst): adaptive i32→i64 codes_offsets promotion#7851
Conversation
Single-pass; common case keeps the compact i32 layout, pathological inputs transparently get i64. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: mprammer <martin@spiraldb.com>
Merging this PR will degrade performance by 24.95%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | take_map[(0.1, 0.5)] |
1,111.5 µs | 988.1 µs | +12.49% |
| ⚡ | Simulation | take_map[(0.1, 1.0)] |
1.8 ms | 1.6 ms | +11.89% |
| ❌ | Simulation | new_bp_prim_test_between[i32, 16384] |
94.9 µs | 110 µs | -13.73% |
| ❌ | Simulation | new_bp_prim_test_between[i32, 32768] |
141.2 µs | 170.8 µs | -17.31% |
| ❌ | Simulation | new_bp_prim_test_between[i64, 16384] |
115.5 µs | 145.4 µs | -20.61% |
| ❌ | Simulation | new_bp_prim_test_between[i64, 32768] |
178.3 µs | 237.6 µs | -24.95% |
| ❌ | Simulation | new_bp_prim_test_between[i16, 32768] |
120.6 µs | 135.1 µs | -10.71% |
| ❌ | Simulation | new_alp_prim_test_between[f64, 16384] |
127.3 µs | 149.8 µs | -15.04% |
Comparing mp/fsst-i32-overflow-adaptive (9e2bcdc) with develop (ff12040)
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.
Fixes #7833.
fsst_compress_iterpreviously hardcodedVarBinBuilder::<i32>for the FSST output and panicked once cumulative compressed bytes crossedi32::MAX. The companion change tovortex-array/src/arrays/varbin/compute/compare.rshandles the latent ArrowLargeBinary == Binarymismatch that becomes reachable once any FSST output uses i64 offsets.The codes-offsets buffer now starts as
i32and promotes toi64on the first append wheredata.len()crossesi32::MAX— one O(n) copy of existing offsets, sub-millisecond at any realistic n. Common case is identical to the original i32 path. Tests: a small-input round-trip asserts the i32 baseline; a CI-gated ~4.5 GiB test exercises the i64 path end-to-end.🤖 Generated with Claude Code