Skip to content
This repository was archived by the owner on Aug 7, 2026. It is now read-only.

Latest commit

 

History

History

fixtures

README.md

numcodecs interop fixtures

Compressed buffers produced by Python numcodecs, used by ../interop.test.ts to prove that rumcodecs decodes what the reference implementation writes. The round-trip suites cannot show this: they would keep passing if the encoder and decoder drifted off the numcodecs format together.

  • source.u2.bin — the uncompressed input every fixture decodes back to: numpy.arange(256, dtype="<u2").tobytes().
  • <name>.bin — that input encoded by the codec described under <name> in fixtures.json.
  • fixtures.json — the exact get_config() for each codec, plus the numcodecs version that wrote them. The test builds each codec from this config, the way a Zarr reader builds one from stored chunk metadata.

Only the decode direction is pinned here. Encoded output is not compared byte for byte, because a compressor is free to emit different bytes across versions while staying readable — what has to hold is that both sides read each other.

Regenerating

Requires no local install; uv fetches numcodecs on demand, pinned to the version that wrote the checked-in buffers:

cd test/fixtures
uv run --with numcodecs==0.16.5 python generate.py

Regenerate only to add a codec or a new option combination. Refreshing the existing files against a newer numcodecs weakens the test — it would hide a format break by replacing the fixture that should have caught it. That is why the version is pinned rather than resolved: unpinned, adding a single fixture rewrites all of them against whatever release happens to be current. The generator checks the pin and refuses to run under a different version, so bumping it takes editing EXPECTED_NUMCODECS in generate.py and this line together.

Under that pin the output is byte-for-byte reproducible, so re-running the generator on an unchanged tree leaves git status clean and any diff is a real one. The single exception is handled in normalize(): a gzip member stores the current time in its header, which otherwise made gzip.bin differ on every run regardless of whether anything meaningful had changed. That field is advisory and decoders ignore it, so it is zeroed the way gzip -n does; the compressed payload is untouched Python output.