Skip to content

implemented zfp codec - #89

Open
konstibob wants to merge 4 commits into
zarr-developers:mainfrom
konstibob:feat/zfp_codec
Open

implemented zfp codec#89
konstibob wants to merge 4 commits into
zarr-developers:mainfrom
konstibob:feat/zfp_codec

Conversation

@konstibob

@konstibob konstibob commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

added zfp codec which should work with seperatley configured zfp-java repository which for https://zfp.readthedocs.io

konstibob and others added 3 commits August 13, 2026 16:59
The promoted-buffer size was computed as
`(int) Zfp.countValues(zfpShape) * zfpType.getByteCount()`, so the
multiplication happened in int and silently wrapped for large chunks.
A 1024^3 int8 chunk wrapped to 0 and `promote` then threw
BufferOverflowException outside the try/catch; a 512x1024x1024 chunk
wrapped to Integer.MIN_VALUE and `allocate` threw IllegalArgumentException.

Compute the size as a long and reject oversized chunks with a
ZarrException before allocating.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@normanrz normanrz 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.

I think we should not include this in zarr-java directly. The reason is that this adds a heavy and potentially controversial dependency. However, we can put the codec implementation in the zfp-java repo. There we can also call CodecRegistry.addCodec so that it hooks itself into zarr-java.
We can add a link to the zfp-java repo here in the readme, though.

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.

2 participants