Repository navigation
Revert "Revert "Revert "Add SZ3 compression codec""" - #84358
Merged
Merged
Conversation
This reverts commit 29032ae.
Contributor
|
Workflow [PR], commit [03eba5f] Summary: ❌
|
scanhex12
approved these changes
Jul 24, 2025
Member
Author
|
Algunenano
enabled auto-merge
July 24, 2025 16:33
robot-clickhouse
added a commit
that referenced
this pull request
Jul 24, 2025
Algunenano
added a commit
that referenced
this pull request
Jul 24, 2025
Backport #84358 to 25.7: Revert "Revert "Revert "Add SZ3 compression codec"""
1 task done
pull Bot
pushed a commit
to AKJUS/ClickHouse
that referenced
this pull request
Jul 14, 2026
This reverts the removal of the SZ3 lossy floating-point compression codec done in ClickHouse#84358 (itself a revert of ClickHouse#83088), and adapts it to the current `master`, finishing the work that the fuzzer crashes (ClickHouse#84345) had left unfinished. `SZ3` is an experimental, error-bounded lossy codec for `Float32`, `Float64`, `Array(Float32)` and `Array(Float64)` columns. It requires `SET allow_experimental_codecs = 1`. Changes needed to revive it on top of `master`: - Method byte: the original `SZ3` used `0x9c`, but that byte is now taken by the `ALP` codec, so `SZ3` is assigned the next free byte `0x9d`. The `SZ3` was never part of a stable release, so no persisted data depends on the old byte. - `doDecompressData` now returns `UInt32` (the base class signature changed) and the codec registration was moved to the shared `registerCompressionCodecs.h`. - Re-integrated the vector-dimension and lossy-offset handling into the refactored `MergeTreeDataPartWriterCompact`/`Wide`/`OnDisk`. - `flake.nix` and the `aspell` dictionary entries are not restored, because both were removed from `master` in the meantime. - `SZ3` is intentionally not re-added to the BuzzHouse codec fuzzer: its codec generator is now type-aware and only emits lossless codecs, and `SZ3` is lossy, which would produce false oracle mismatches. Hardening of `doDecompressData` against corrupted input (the reason for the original revert): - The trusted `uncompressed_size` is now enforced. The previous code ignored it and let SZ3 write `config.num` (taken from the untrusted compressed data) elements into `dest`, which is only `uncompressed_size` bytes long - a heap buffer overflow. The decompressed element count is now validated against `uncompressed_size` before decompression. - The float width is validated and `uncompressed_size` must be a multiple of it. - The serialized `SZ3::Config` is parsed from a zero-padded copy of the data, after validating the dimension count and bit width, to avoid out-of-bounds reads, and `config.size_est()` is checked against the compressed size to prevent the payload-size underflow inside `SZ_decompress`. Closes: ClickHouse#84345 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
This reverts the removal of the SZ3 lossy floating-point compression codec done in ClickHouse#84358 (itself a revert of ClickHouse#83088), and adapts it to the current `master`, finishing the work that the fuzzer crashes (ClickHouse#84345) had left unfinished. `SZ3` is an experimental, error-bounded lossy codec for `Float32`, `Float64`, `Array(Float32)` and `Array(Float64)` columns. It requires `SET allow_experimental_codecs = 1`. Changes needed to revive it on top of `master`: - Method byte: the original `SZ3` used `0x9c`, but that byte is now taken by the `ALP` codec, so `SZ3` is assigned the next free byte `0x9d`. The `SZ3` was never part of a stable release, so no persisted data depends on the old byte. - `doDecompressData` now returns `UInt32` (the base class signature changed) and the codec registration was moved to the shared `registerCompressionCodecs.h`. - Re-integrated the vector-dimension and lossy-offset handling into the refactored `MergeTreeDataPartWriterCompact`/`Wide`/`OnDisk`. - `flake.nix` and the `aspell` dictionary entries are not restored, because both were removed from `master` in the meantime. - `SZ3` is intentionally not re-added to the BuzzHouse codec fuzzer: its codec generator is now type-aware and only emits lossless codecs, and `SZ3` is lossy, which would produce false oracle mismatches. Hardening of `doDecompressData` against corrupted input (the reason for the original revert): - The trusted `uncompressed_size` is now enforced. The previous code ignored it and let SZ3 write `config.num` (taken from the untrusted compressed data) elements into `dest`, which is only `uncompressed_size` bytes long - a heap buffer overflow. The decompressed element count is now validated against `uncompressed_size` before decompression. - The float width is validated and `uncompressed_size` must be a multiple of it. - The serialized `SZ3::Config` is parsed from a zero-padded copy of the data, after validating the dimension count and bit width, to avoid out-of-bounds reads, and `config.size_est()` is checked against the compressed size to prevent the payload-size underflow inside `SZ_decompress`. Closes: ClickHouse#84345 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.
Changelog category (leave one):
This reverts commit 29032ae / Adds SZ3 compression codec
Closes #84345