Skip to content

rldb: move MultiDataset and format-neutral pieces out of zarr/ - #717

Draft
RyanPCo wants to merge 4 commits into
ryanco/lance-migrationfrom
ryanco/rldb-multi
Draft

RyanPCo wants to merge 4 commits into
ryanco/lance-migrationfrom
ryanco/rldb-multi

Conversation

@RyanPCo

@RyanPCo RyanPCo commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

rldb: move MultiDataset and format-neutral pieces out of zarr/

MultiDataset, EvenStrideDataset, pinned_episode_subset, worker_context and
_IndexMap move to egomimic/rldb/multi.py; PinError and _ensure_dataset_filter
to rldb/filters.py. zarr_dataset_multi re-exports them so the Hydra
_target_s (MultiDataset._from_resolver) and older imports keep resolving.

Also moved, since both the zarr and Lance paths use them:

  • zarr/action_chunk_transforms.py -> rldb/transforms.py
  • zarr/norm_cache.py, zarr/episode_norm_samples.py -> rldb/norm/
  • zarr/utils.py (set_global_seed) -> utils/seed.py

MultiDataset._from_resolver no longer type-checks for LocalEpisodeResolver:
it forwards sync_from_s3 only when set, so a resolver that cannot sync now
raises instead of silently ignoring it. The tutorials that passed it to an
S3EpisodeResolver (a no-op) drop it.

norm_cache hashes both rldb.multi and zarr_dataset_multi as reader modules.
code_hash covers module source, so every existing norm cache misses once.

Co-Authored-By: Claude Opus 5.5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01KY4JqVTaiGrzTaprPEzwZo

rldb: EpisodeLeaf base for zarr and Lance leaves

LanceRecordingDataset subclassed ZarrDataset only for its keymap windowing,
and carried a hand copy of the end of ZarrDataset.getitem that had already
drifted (no multi-camera or 3x4 K handling). Both now subclass
egomimic/rldb/leaf.EpisodeLeaf, which owns:

  • the windowing, padding and mask helpers (_read_windows, _history_indices,
    _action_pad_mask, ...), with _chunk_end_idx still the per-subclass hook;
  • _finish: masks, transforms, tensors, embodiment, fps, intrinsics and
    episode_hash for every leaf. A flat 9-value K (how Lance stores it) is now
    reshaped instead of becoming the NaN sentinel;
  • the batch contract (plan_sample / fetch_planned / assemble_sample) and a
    default cache_fingerprint.

MultiDataset.getitems batches leaves with batched_fetch set rather than
any leaf with a fetch_planned attribute, which every leaf now has.
LanceStreamingDataset and format_bench's FastZarrDataset set it.

test_leaf_equivalence reads one recording as a Lance leaf and as a zarr
episode written from the same rows and checks every sample matches.

Co-Authored-By: Claude Opus 5.5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01KY4JqVTaiGrzTaprPEzwZo

rldb/lance: annotations table with review, commit and loader support

annotations.lance is one global table keyed by a content-addressed
annotation_id, with half-open [t_start_ns, t_end_ns) intervals on the
recording clock and in-place grading columns. apply_annotations adds and
deletes in one commit; the release tag covers it like every other table.
The loader optionally returns all covering texts per frame, with opt-in
action clamping and annotated-only sampling. task_instance_id is now
deterministic, and the pilot commit's validation is reusable as
load_deliveries.

The format bench writes its spans to annotations.lance too, since the tasks
annotations column and schema.ANNOTATION are gone.

Co-Authored-By: Claude Opus 5.5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01AeFJsNDQrLsyrDyJ2xgbrW

aria_process: Ray pipeline from raw Aria recordings to Lance tables

Converts and chunks recordings as Ray tasks and commits them in batches
from the driver; reruns skip committed recordings.

Co-Authored-By: Claude Opus 5.5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01AeFJsNDQrLsyrDyJ2xgbrW

https://claude.ai/code/session_01HjCQBqQCr2igFEMR7yUovw

@RyanPCo RyanPCo mentioned this pull request Oct 19, 2026

RyanPCo commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

RyanPCo and others added 4 commits October 23, 2026 15:58
MultiDataset, EvenStrideDataset, pinned_episode_subset, worker_context and
_IndexMap move to egomimic/rldb/multi.py; PinError and _ensure_dataset_filter
to rldb/filters.py. zarr_dataset_multi re-exports them so the Hydra
`_target_`s (MultiDataset._from_resolver) and older imports keep resolving.

Also moved, since both the zarr and Lance paths use them:
- zarr/action_chunk_transforms.py -> rldb/transforms.py
- zarr/norm_cache.py, zarr/episode_norm_samples.py -> rldb/norm/
- zarr/utils.py (set_global_seed) -> utils/seed.py

MultiDataset._from_resolver no longer type-checks for LocalEpisodeResolver:
it forwards sync_from_s3 only when set, so a resolver that cannot sync now
raises instead of silently ignoring it. The tutorials that passed it to an
S3EpisodeResolver (a no-op) drop it.

norm_cache hashes both rldb.multi and zarr_dataset_multi as reader modules.
code_hash covers module source, so every existing norm cache misses once.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KY4JqVTaiGrzTaprPEzwZo
LanceRecordingDataset subclassed ZarrDataset only for its keymap windowing,
and carried a hand copy of the end of ZarrDataset.__getitem__ that had already
drifted (no multi-camera or 3x4 K handling). Both now subclass
egomimic/rldb/leaf.EpisodeLeaf, which owns:

- the windowing, padding and mask helpers (_read_windows, _history_indices,
  _action_pad_mask, ...), with _chunk_end_idx still the per-subclass hook;
- _finish: masks, transforms, tensors, embodiment, fps, intrinsics and
  episode_hash for every leaf. A flat 9-value K (how Lance stores it) is now
  reshaped instead of becoming the NaN sentinel;
- the batch contract (plan_sample / fetch_planned / assemble_sample) and a
  default cache_fingerprint.

MultiDataset.__getitems__ batches leaves with batched_fetch set rather than
any leaf with a fetch_planned attribute, which every leaf now has.
LanceStreamingDataset and format_bench's FastZarrDataset set it.

test_leaf_equivalence reads one recording as a Lance leaf and as a zarr
episode written from the same rows and checks every sample matches.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KY4JqVTaiGrzTaprPEzwZo
annotations.lance is one global table keyed by a content-addressed
annotation_id, with half-open [t_start_ns, t_end_ns) intervals on the
recording clock and in-place grading columns. apply_annotations adds and
deletes in one commit; the release tag covers it like every other table.
The loader optionally returns all covering texts per frame, with opt-in
action clamping and annotated-only sampling. task_instance_id is now
deterministic, and the pilot commit's validation is reusable as
load_deliveries.

The format bench writes its spans to annotations.lance too, since the tasks
annotations column and schema.ANNOTATION are gone.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFJsNDQrLsyrDyJ2xgbrW
Converts and chunks recordings as Ray tasks and commits them in batches
from the driver; reruns skip committed recordings.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFJsNDQrLsyrDyJ2xgbrW
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