Skip to content

feat(data): asynchronous component reader API - #200

Merged
janickm merged 1 commit into
stack/zarr3/06-direct-readsfrom
stack/zarr3/07-async
Oct 23, 2026
Merged

janickm merged 1 commit into
stack/zarr3/06-direct-readsfrom
stack/zarr3/07-async

Conversation

@janickm

@janickm janickm commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Add asynchronous variants of all component reader methods reading array data (get_frame_data_async, get_frame_ray_bundle_data_async, get_frame_ray_bundle_return_data_async, get_generic_data_async, get_camera_mask_image_async, get_pc_*_async, labels get_data_async, ...), returning the same data as the synchronous methods, based on nodes.Array.read_async / read_bytes_async.

Awaiting multiple reads concurrently overlaps their I/O and decompression, without blocking the running event loop:

  • zarr-python 3: chunks of remote indexed tar archives (asynchronous fsspec filesystems, e.g. s3fs, gcsfs, http) are read via concurrent range requests on the event loop of their filesystem (IndexedTarArchive.read_async / is_remote). On event loops of applications, blocking work (local reads, decompression, zarr-python's codec pipeline) runs on worker threads, on the event loops of the calling threads it runs inline
  • zarr-python 2: reads run on worker threads

Metadata (attributes, names, timestamps) is held in memory and only provided synchronously.

@copy-pr-bot

copy-pr-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@janickm
janickm added this pull request to stack #201 October 14, 2026 07:28
@janickm

janickm commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 772164c

@janickm

janickm commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 4fc0ce3

@janickm
janickm force-pushed the stack/zarr3/07-async branch from 4fc0ce3 to 2da6f4c Compare October 14, 2026 10:02
@janickm

janickm commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 2da6f4c

@janickm
janickm force-pushed the stack/zarr3/07-async branch from 2da6f4c to 8d397a8 Compare October 14, 2026 10:09
@janickm

janickm commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 8d397a8

@janickm
janickm force-pushed the stack/zarr3/07-async branch from 8d397a8 to 64f5779 Compare October 14, 2026 11:58
@janickm

janickm commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 64f5779

@janickm
janickm force-pushed the stack/zarr3/07-async branch from 64f5779 to 83a25d1 Compare October 14, 2026 14:16
@janickm

janickm commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 83a25d1

@janickm
janickm force-pushed the stack/zarr3/07-async branch from 83a25d1 to 5cbee05 Compare October 14, 2026 14:43
@janickm

janickm commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 5cbee05

@janickm
janickm force-pushed the stack/zarr3/07-async branch from 5cbee05 to 592a27e Compare October 14, 2026 15:32
@janickm

janickm commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 592a27e

@janickm
janickm force-pushed the stack/zarr3/07-async branch from 592a27e to d8d030f Compare October 15, 2026 07:55
@janickm

janickm commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test d8d030f

@janickm
janickm force-pushed the stack/zarr3/07-async branch from d8d030f to 794ce16 Compare October 15, 2026 10:20
@janickm
janickm force-pushed the stack/zarr3/07-async branch from d0b9434 to d13b6ac Compare October 19, 2026 13:56
@janickm

janickm commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test d13b6ac

@janickm
janickm force-pushed the stack/zarr3/07-async branch from d13b6ac to 25b8674 Compare October 20, 2026 09:27
@janickm

janickm commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 25b8674

@janickm
janickm force-pushed the stack/zarr3/07-async branch from 25b8674 to 8a969f1 Compare October 20, 2026 10:19
@janickm

janickm commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 8a969f1

@janickm
janickm force-pushed the stack/zarr3/07-async branch from 8a969f1 to 3ae1545 Compare October 20, 2026 11:58
@janickm

janickm commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 3ae1545

Comment thread ncore/impl/data/backend_zarr3.py
Comment thread ncore/impl/data/itar.py Outdated
@janickm
janickm force-pushed the stack/zarr3/07-async branch from 3ae1545 to f73982a Compare October 20, 2026 12:48
@janickm

janickm commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test f73982a

@janickm
janickm force-pushed the stack/zarr3/07-async branch from f73982a to 3de89e6 Compare October 21, 2026 08:37
@janickm

janickm commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 3de89e6

@janickm
janickm force-pushed the stack/zarr3/07-async branch from 3de89e6 to 0135343 Compare October 21, 2026 08:53
@janickm

janickm commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 0135343

@janickm
janickm marked this pull request as ready for review October 21, 2026 08:59
@janickm
janickm force-pushed the stack/zarr3/07-async branch from 0135343 to 8c2bf4e Compare October 21, 2026 09:11
@janickm
janickm force-pushed the stack/zarr3/07-async branch from 8c2bf4e to 5670f3f Compare October 21, 2026 14:15
@janickm

janickm commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 5670f3f

Add asynchronous variants of all component reader methods reading
array data (get_frame_data_async, get_frame_ray_bundle_data_async,
get_frame_ray_bundle_return_data_async, get_generic_data_async,
get_camera_mask_image_async, get_pc_*_async, labels get_data_async,
...), returning the same data as the synchronous methods, based on
nodes.Array.read_async / read_bytes_async and
IndexedTarArchive.read_async.

Awaiting multiple reads concurrently overlaps their I/O and
decompression, without blocking the running event loop:

- zarr-python 3: chunks of remote indexed tar archives (asynchronous
  fsspec filesystems, e.g. s3fs, gcsfs, http) are read via concurrent
  exact range requests on the event loop of their filesystem, chunks of
  other zarr-python stores via their asynchronous API. On event loops of
  applications, blocking work (local reads, decompression, zarr-python's
  codec pipeline) runs on worker threads, on the event loops of the
  calling threads it runs inline
- zarr-python 2: reads run on worker threads
- IndexedTarArchive.read_async reads records of local archives on worker
  threads (common.async_util.run_in_thread)

On remote storage, the asynchronous APIs fetch exact byte ranges
concurrently, while the synchronous APIs read through the archive's
buffered file object (documented in storage_and_access.rst).

Metadata (attributes, names, timestamps) is held in memory and only
provided synchronously.
@janickm

janickm commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 27912d5

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.

1 participant