Skip to content

Fix empty Blosc buffer round-trips - #854

Draft
fallenmi wants to merge 1 commit into
zarr-developers:mainfrom
fallenmi:agent/fix-blosc-empty-roundtrip
Draft

Fix empty Blosc buffer round-trips#854
fallenmi wants to merge 1 commit into
zarr-developers:mainfrom
fallenmi:agent/fix-blosc-empty-roundtrip

Conversation

@fallenmi

Copy link
Copy Markdown

Fixes #831.

Summary

  • validate Blosc input before reading frame metadata
  • treat a validated zero-length frame as a successful decompression
  • require system Blosc 1.16.0+, where blosc_cbuffer_validate was introduced
  • add regression coverage and an unreleased fix note

The stricter validation also rejects truncated or size-mismatched buffers, including frames with undeclared trailing bytes.

Validation

  • focused Blosc regression/error tests: 15 passed, 1 expected skip
  • full local suite: 650 passed, 32 optional-dependency skips
  • adversarial empty/non-empty, buffer-type, compressor, shuffle, threading, and malformed-frame matrix: 6,193 checks, 0 errors
  • pre-commit run --all-files: passed
  • git diff --check: clean

Checklist

  • Unit tests and/or doctests in docstrings
  • Tests pass locally
  • No new or modified user-facing classes or functions
  • Changes documented in docs/release.md
  • Docs build locally
  • GitHub Actions CI passes
  • Test coverage to 100% (Codecov passes)

AI assistance

OpenAI Codex assisted with reproduction, implementation, test planning, validation, and independent review. The change is intentionally opened as a Draft; remote CI and final human review remain pending.

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.

Can't roundtrip compression/decompression with empty numpy array

1 participant