Skip to content

[io] Compress buffers larger than 16 MiB in blocks of equal size (rev 2) - #23855

Merged
dpiparo merged 3 commits into
root-project:masterfrom
jblomer:io-fix-compression-large-blocks
Oct 27, 2026
Merged

dpiparo merged 3 commits into
root-project:masterfrom
jblomer:io-fix-compression-large-blocks

Conversation

@jblomer

@jblomer jblomer commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Replaces #23707

This PR fixes #23706

rshrj and others added 3 commits October 14, 2026 01:00
Buffers larger than kMAXZIPBUF are compressed in several blocks. So far all
blocks but the last were kMAXZIPBUF bytes long. For a buffer just above a
multiple of kMAXZIPBUF, the last block is only a few bytes, which cannot be
compressed, and the whole buffer was then stored uncompressed: RNTuple pages
of 2^24 bytes (and every full page with a 32 MiB page size limit), TTree
baskets, TKey objects and TMessages of that size.

Cut the buffer into the same number of blocks, all of the same size instead
(ROOT::Internal::GetZipBlockSize). Readers take each block's size from its
header, so the format and the reading code are unchanged.

Fixes root-project#23706
Replace GetZipBlockSize by GetZipBlocks, which returns the number of
blocks and their size (RZipBlocks), so the five writers no longer
compute the count themselves and both values cannot disagree.

GetZipBlocks asserts a positive size. RNTupleCompressor::Zip and
TBasket::WriteBuffer now handle empty buffers before calling it; the
result for them is unchanged.
@github-actions

Copy link
Copy Markdown

Test Results

    24 files      24 suites   4d 1h 11m 21s ⏱️
 3 899 tests  3 899 ✅ 0 💤 0 ❌
83 483 runs  83 483 ✅ 0 💤 0 ❌

Results for commit 255fe03.

@jblomer
jblomer requested review from enirolf and hahnjo October 27, 2026 13:50

@pcanal pcanal left a comment

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.

LGTM. Thanks.

@dpiparo
dpiparo merged commit b02afff into root-project:master Oct 27, 2026
38 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Buffers of 2^24 bytes or slightly more are written uncompressed (RNTuple pages and TTree baskets)

4 participants