Register global J2K and HTJ2K codec ids#777
Conversation
FrancescAlted
left a comment
There was a problem hiding this comment.
I have just single comment.
| BLOSC2_GLOBAL_REGISTERED_CODECS_STOP = 159, | ||
| //!< Blosc-registered codecs must be between 31 - 159. | ||
| BLOSC2_GLOBAL_REGISTERED_CODECS = 5, | ||
| BLOSC2_GLOBAL_REGISTERED_CODECS = 9, |
There was a problem hiding this comment.
This does not need to be updated. It is just for documenting how many regular codecs are registered. Plugins are not part in this count.
FrancescAlted
left a comment
There was a problem hiding this comment.
I think I'll go ahead merging this now, and will restore the BLOSC2_GLOBAL_REGISTERED_CODECS = 5 original value.
|
Restored original |
|
Thanks @alemirone ! |
|
BTW, C-Blosc2 3.1.0 is out now. It comes with the new global IDs for J2K and HTJ2K. Plus, it comes with new |
|
Hi Francesc, Thank you for merging the PR! I have adapted the installation procedure in the README and the tests in both blosc2_htj2k and blosc2_j2k so that they now rely on upstream c-blosc2. Everything is working now. By the way, for some reason unknown to me, a GitHub automated process has suspended my account. If needed, I can create the next MR from alemirone2 instead of alemirone. Let me know what the next step should be. |
|
Great news. That means that you are using new After you fix the remaining details, the best is that you transfer your repos under the GitHub Blosc umbrella. |
|
Hi Francesc, I have updated both blosc2_j2k and blosc2_htj2k The plugins now use the header-only The registry-aware tests are now running successfully, including compression/decompression roundtrip checks. I also enabled them on Linux, macOS and Windows. For Windows, the workflow uses I have kept the HDF5-specific checks out of the registry workflow for now, because the currently available hdf5plugin wheel does not yet expose the updated c-blosc2 registry. The plugin-level roundtrip tests are passing. Everything is working now in the tests. Best, |
|
That's great! I think @t20100 will be happy to hear about this. Now, we can start moving your projects to the Blosc/ umbrella if you want. If so, tell me your desired username in github and I'll add it as a member of the Blosc organization and will grant you with at least the "Create repositories" permission. Then you can go to your repos → Settings → Danger Zone → Transfer ownership, selects Blosc as the target, and confirm. Thank you for your contribution! |
|
Hi Francesc, Great, thank you! Please add my GitHub account Best, |
|
Hi Francesc, Thank you for adding me to the Blosc organization. It seems I still do not have sufficient permissions to transfer the repositories into the Blosc organization. Either option is fine for me, whichever you prefer:
Then I can push the current code there and update the remotes locally. Thanks, |
|
Good idea. So I went ahead and created |
|
Hi Francesc, Thank you again for creating the repositories under the Blosc organization and for giving me admin access. I have pushed both projects there: I also did some cleanup work on the README demo quickstarts so that they now clone the plugin repositories from the Blosc organization. These are just the copy-paste demo instructions in the README. The temporary python-blosc2 branch is still referenced there only because the python-blosc2 update exposing the new codec IDs is not merged yet. For On my side, the local checks are OK: CMake build, wheel build/install, pytest with the registry checks enabled, the Python README quickstart variants, and the C++ HDF5 quickstart all pass. The only remaining consolidation point seems to be the small python-blosc2 update exposing the official codec IDs:
Once that is in place, I think we should be able to simplify the demo quickstarts and CI workflows further, depending on how you prefer to proceed. Thanks, |
|
Cool! I exposed the new global IDs in commit 5a442377. There I assumed that you are going to distribute wheels in PyPI, so this is why I am mentioning Good job! |
|
Hi Francesc, Thank you! Yes, I can go ahead with the preparation of the wheels as soon as possible. The Python enum entries are already available in python-blosc2 main: blosc2.Codec.J2K = 39 The remaining point is that the python-blosc2 wheels on PyPI should also bundle I checked the current PyPI wheel, blosc2 4.4.2, and it still seems to bundle an Once a new python-blosc2 release including the updated c-blosc2 is available on The package names you added in the comments are exactly the intended ones. |
|
Python-Blosc2 4.4.3, with the new IDs in, has been released. |
|
Hi Francesc, The two packages, blosc2-j2k and blosc2-htj2k, are now available on PyPI. The remaining polishing step is the release of a new hdf5plugin wheel by @t20100, linked against a recent c-blosc2 version that includes the new J2K/HTJ2K codec IDs. Once that is available, the HDF5 quickstart can use the standard hdf5plugin wheel directly, without the current source-build workaround. |
|
I'll prepare a release of hdf5plugin with updated c-blosc2 embedded library. |
|
Hi Thomas, I checked the current hdf5plugin wheel from PyPI, and it still seems to embed an older c-blosc2 runtime: hdf5plugin 6.0.0 So the HDF5 Blosc2 filter cannot yet resolve the new official codec IDs: j2k -> 39 Is there anything preventing a rebuild/release of hdf5plugin wheels against a recent c-blosc2 version containing these registry entries? For now, blosc2-j2k and blosc2-htj2k are both available on PyPI and work for direct Blosc2/Python usage with python-blosc2 >= 4.4.3. The remaining missing piece for transparent HDF5 usage is a rebuilt hdf5plugin wheel. Thanks! Alessandro |
|
Hi, I just merged silx-kit/hdf5plugin#387 to update I've unpinned |
|
Hi Thomas, I checked the published wheel too. The problem was on our side, in the OpenHTJ2K wrapper inside blosc2_htj2k: the decoder wrapper was preallocating component buffers before calling I fixed it, added a regression test for chunked multi-frame stacks, and released I also verified the published PyPI wheel in a fresh environment. With Thanks again for catching it. |
Summary
This PR registers two new global codec ids in the
c-blosc2codec registry:BLOSC_CODEC_J2K = 39BLOSC_CODEC_HTJ2K = 40and associates them with the codec names:
"j2k""htj2k"Motivation
The main goal is to support a new family of external multi-backend JPEG 2000 plugins for Blosc2.
These plugins are designed so that the same logical codec id can be used with different runtime backends, including both:
This gives an important interoperability advantage:
In other words, the registry-level codec id identifies the compressed format family, while backend selection remains a runtime choice.
Where the new plugins live
This registry change is meant to support external plugin repositories that are already well advanced:
blosc2_j2kblosc2_htj2kThese plugins implement runtime backend selection for JPEG 2000 / HTJ2K codec paths and already support multiple backends.
This PR is therefore the registry-side step needed to make their codec ids official and stable.
What this PR changes
BLOSC_CODEC_J2K = 39BLOSC_CODEC_HTJ2K = 40"j2k""htj2k"Why this matters at the registry level
The plugin-side code needs stable global ids so that:
blosc2_compname_to_compcode("j2k") == 39blosc2_compname_to_compcode("htj2k") == 40and so that the same ids are consistently visible across:
Validation status
The plugin side is already in a fairly advanced state.
There are now:
for both:
blosc2_j2kblosc2_htj2kCurrent transition status
The only remaining transitional detail is that these plugin tests currently install a slightly modified:
c-blosc2python-blosc2runtime in order to expose the new official ids during CI and validation.
That is exactly why this PR exists: to upstream the registry part and remove the need for that special setup over time.
Temporary compatibility workarounds
During this transition, a few temporary workarounds were introduced in the plugin repositories to keep standard builds and CI working before the new ids are fully available everywhere.
Examples include:
BLOSC_CODEC_J2K/BLOSC_CODEC_HTJ2Kwhen building against older headerspython-blosc2blosc2_htj2kThese are transitional measures only.
Once the registry ids are upstream in
c-blosc2and propagated normally throughpython-blosc2, these workarounds can be simplified or removed.Context
This PR is the upstream registry step requested while reviewing the plugin work around:
Blosc/blosc2_grok#21Once this registry discussion is settled, the plugin-side workarounds can be progressively reduced.
Related plugin work
This registry change is meant to support the following external multi-backend plugin work:
blosc2_j2kblosc2_htj2k