Skip to content

Point to zfp-java for the zfp codec - #89

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

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

Conversation

@konstibob

@konstibob konstibob commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Following the review, the zfp codec no longer lives in zarr-java, so zarr-java doesn't depend on the native zfp library. The codec moved to zfp-java (scalableminds/zfp-java#2), which registers it through CodecRegistry.addType:

ZfpCodec.register();
// ...
.withCodecs(new ZfpCodec(ZfpCodec.Configuration.reversible()))

What's left here is a short section in the user guide pointing to zfp-java.

🤖 Generated with Claude Code

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.

konstibob and others added 2 commits October 28, 2026 13:22
zfp needs a native library, which zarr-java should not force on all its
users. The codec now lives in scalableminds/zfp-java and registers itself
through CodecRegistry; the user guide points there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@konstibob konstibob changed the title implemented zfp codec Point to zfp-java for the zfp codec Oct 28, 2026
@konstibob

Copy link
Copy Markdown
Contributor Author

@konstibob
konstibob requested a review from normanrz October 28, 2026 12:50
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