feat: write inlined ChunkManifest entries to icechunk as native chunks#981
Merged
TomNicholas merged 3 commits intozarr-developers:mainfrom Apr 25, 2026
Merged
Conversation
The icechunk writer currently sends the INLINED_CHUNK_PATH sentinel
('__inlined__') straight into icechunk's set_virtual_refs_arr, which
rejects it as a malformed virtual URL. The new test writes a manifest
containing one inlined chunk plus one virtual chunk, commits, then
re-opens via xarray and asserts the values match end-to-end.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #981 +/- ##
==========================================
+ Coverage 89.94% 89.97% +0.02%
==========================================
Files 33 33
Lines 2058 2064 +6
==========================================
+ Hits 1851 1857 +6
Misses 207 207
🚀 New features to boost your workflow:
|
3707363 to
5ffd01f
Compare
Icechunk's set_virtual_refs_arr rejects the INLINED_CHUNK_PATH sentinel
('__inlined__') as a malformed URL. write_manifest_to_icechunk now writes
inlined chunks first as native chunks via store.set, then rewrites those
positions to empty strings in the paths array before calling
set_virtual_refs_arr with the cleaned view. A cheap numpy-level check
skips the virtual-refs call entirely for all-inlined or all-missing
manifests.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5ffd01f to
ab8c067
Compare
Broadcasting inlined chunks not only prepends singleton dims to their keys, but also replicates the bytes (by reference) across every position of an expanded axis, per the fix in zarr-developers#938. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Teaches the icechunk writer to handle
ChunkManifestentries containing inlined chunk data. Without this,write_manifest_to_icechunksends the"__inlined__"sentinel straight into icechunk'sset_virtual_refs_arr, which rejects it with `error parsing virtual ref URL: "inlined"`.New control flow (single bulk
set_virtual_refs_arrcall; fast path unchanged):store.set(chunk_key, buffer)per entry, all dispatched in parallel under a singlesync(asyncio.gather(...))bridge."__inlined__"to""so they're treated as skipped-by-Rust positions on the subsequent call.(virtual_paths != "").any()check — skip theset_virtual_refs_arrcall entirely for all-inlined or all-missing manifests (no.tolist()allocation, no Python→Rust round trip).Together with #979 and #980, this completes end-to-end round-tripping of inlined chunks through both kerchunk and icechunk.
Test plan
xr.open_zarr, and asserts the expected values on both positions.