Skip to content

asdf: implement Blosc2 compression - #219

Merged
lgarrison merged 1 commit into
aurorafrom
aurora-blosc2-compress
Aug 7, 2026
Merged

asdf: implement Blosc2 compression#219
lgarrison merged 1 commit into
aurorafrom
aurora-blosc2-compress

Conversation

@lgarrison

Copy link
Copy Markdown
Member

Complementing the existing decompression.

The payload is a single cframe, matching what the Abacus C++ writer emits, and the codec defaults follow it too: zstd, clevel 1, shuffle, and blocks of a multiple of typesize near 1 MiB, which compresses better than the blosc2 default at the cost of some performance. Remaining kwargs go straight to blosc2.CParams.

Note that ASDF hands compressors a flat uint8 buffer, so typesize defaults to 1 and shuffle does nothing unless the caller passes the record size via AsdfFile.set_array_compression().

Chunks and blocks are kept to a whole number of records: blosc has had a number of bugs around indivisible chunks.

Most of our AbacusAurora data products are going to get compressed through our C++ writer. But some post-processing might use this, and we would like all our data products to be on Blosc2.

Complementing the existing decompression.

The payload is a single cframe, matching what the Abacus
C++ writer emits, and the codec defaults follow it too: zstd, clevel 1,
shuffle, and blocks of a multiple of typesize near 1 MiB, which compresses
better than the blosc2 default at the cost of some performance.  Remaining
kwargs go straight to blosc2.CParams.

Note that ASDF hands compressors a flat uint8 buffer, so typesize defaults
to 1 and shuffle does nothing unless the caller passes the record size via
AsdfFile.set_array_compression().

Chunks and blocks are kept to a whole number of records: blosc has had a
number of bugs around indivisible chunks.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@lgarrison
lgarrison merged commit 11810a3 into aurora Aug 7, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant