Skip to content

lance_pilot: migrate pilot tables to one lab column and end_effector - #741

Open
RyanPCo wants to merge 4 commits into
ryanco/lance-annotations-stagefrom
ryanco/lance-migrate-pilot
Open

RyanPCo wants to merge 4 commits into
ryanco/lance-annotations-stagefrom
ryanco/lance-migrate-pilot

Conversation

@RyanPCo

@RyanPCo RyanPCo commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

The pilot roots were written with lab = source format ("aria"/"eva"), site =
collecting lab, and steps/{aria,eva}.lance. The tables now have one lab column (the
collecting lab), a required end_effector, and steps tables at
steps/{lab}/{embodiment}/{end_effector}.lance, so the pilot roots need a one-off copy
into the new layout before the new readers can use them.

egomimic/scripts/lance_pilot/migrate_lab_end_effector.py merges one or more old roots
(--src, repeatable) into a new root (--dst), never in place:

  • recordings: site becomes lab, end_effector comes from the old lab (aria ->
    hand, eva -> gripper). Null sites fail unless --lab-for-null-site is given.
  • steps: every old steps table is split by its recordings' new (lab, embodiment,
    end_effector) in source row order. Steps rows of recordings missing from
    recordings.lance need --drop-orphan-steps.
  • tasks, aliases, annotations and changes are unioned across sources; a recording_id or
    alias episode_hash found twice fails the run. recording_id is unchanged (its hash
    input stays "aria/").
  • changes: the old lab becomes source, and steps_tables lists the steps tables
    each batch's recordings now live in ([] for annotation commits).
  • the legacy tasks.annotations column is dropped; --dry-run counts the rows that carry
    one.
  • videos/ and other files are copied as is (video_path is root-relative).
  • row counts and recording placement are verified after writing.

Lance history is not carried over: every new table starts at version 1 and is tagged
--tag (default migrate-lab-end-effector). Old tags are listed and dropped; changes.tag
keeps naming them.

Run on the two pilot roots (/coc/flash7/scratch/lance_pilot/lance and lance_eva) into
/coc/flash7/scratch/lance_pilot/lance_v2 (5.5G); the source roots are unchanged:

  • 99 recordings, 99 tasks, 99 aliases, 0 annotations; neither source had a changes table.
  • 12 steps tables. The hand tables total 381,921 rows and the gripper tables 49,000, the
    same as the old steps/aria.lance and steps/eva.lance.
  • 0 non-empty tasks.annotations rows dropped.

The branch also points aria_pilot_lance.yaml, eva_pilot_lance.yaml and the lance_pilot
bench/check scripts at lance_v2; the old roots keep the old schema, which the stack no
longer reads.

Testing: on a compute node, test_lance_migrate_lab_end_effector, test_lance_commit and the
pilot cases of test_data_configs_compose pass (25 passed). LanceStreamingResolver reads
frames from lance_v2 for 34 aria human_bimanual and 49 eva_bimanual recordings.

https://claude.ai/code/session_01HjCQBqQCr2igFEMR7yUovw

@RyanPCo
RyanPCo force-pushed the ryanco/lance-migrate-pilot branch from 66443e0 to de074f0 Compare October 23, 2026 19:36
@RyanPCo
RyanPCo force-pushed the ryanco/lance-annotations-stage branch 2 times, most recently from 6c62f33 to 5c415cf Compare October 23, 2026 20:03
@RyanPCo
RyanPCo force-pushed the ryanco/lance-migrate-pilot branch 2 times, most recently from 546c4fa to dee1b2c Compare October 30, 2026 18:27

@RyanPCo RyanPCo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated adversarial review (read-only; findings were checked by a second skeptical pass before posting): 1 low, 2 nit.

]
return _union(parts) if parts else None

copied = {n: union(n) for n in COPIED_TABLES}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low (data-integrity): --drop-orphan-steps drops steps rows of recordings missing from recordings.lance, but tasks, aliases and annotations are copied wholesale. Rows written by the same crashed append (aliases and tasks are written before recordings) therefore carry over and reference recordings that do not exist in the new root, and verify does not check for this. Filter the copied tables to recording_id in new_rec, or fail the plan when they reference unknown recordings. Report the count in the dry run and add a containment check to verify.

episode_hash found twice fails the run. The legacy tasks.annotations column is dropped
(--dry-run counts the rows that carry one). Sources are never written.

Lance history does not carry over: every new table starts at version 1 and is tagged

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit (docs): The docstring says every new table starts at version 1, but drop_task_annotations (drop_columns) and create_scalar_index both add a version before tagging. Suggested wording: 'every new table starts fresh and the migrated version is tagged --tag'. Line 5 also says the recording_id hash input is 'aria/', but EVA uses 'eva/'; say '/'.

COPIED_TABLES = ("tasks.lance", "aliases.lance", "annotations.lance")


def new_steps_uri(root, path: str) -> str:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit (dead-code): new_steps_uri is just join(root, path). Drop it and call join directly.

The schema is moving to `lab` = collecting lab (old `site`), a required
`end_effector` column, and steps tables keyed steps/{lab}/{embodiment}/{end_effector}.lance.
The pilot roots were written with lab = source format and steps/{aria,eva}.lance,
so they need a one-off copy into the new layout before the new readers can use them.

The script merges one or more old roots (--src, repeatable) into a new root, never in
place: it splits every old steps table by its recordings' new key in source row
order, unions tasks/aliases/annotations/changes, fails on recording_id or alias
episode_hash collisions across sources, drops the legacy tasks.annotations column
(dry-run counts the non-empty rows), copies videos and other files as is (video_path
is root-relative), maps changes rows to the new key in one function, refuses null
sites unless --lab-for-null-site is given, and verifies row counts and recording
placement after writing. Lance history is not carried over; new tables are tagged
instead. NEW_RECORDINGS_COLUMNS must match schema.RECORDINGS once that commit lands.

Claude-Session: https://claude.ai/code/session_01HjCQBqQCr2igFEMR7yUovw
The schema commit landed, so the migration takes the recordings columns from
schema.RECORDINGS (null content_digest for roots that predate it), end_effector values
from END_EFFECTOR and table paths from steps_path instead of local copies. Changes rows
follow the landed design: one row per old row, the old `lab` becomes `source`, and
`steps_tables` lists the steps tables its recordings live in ([] for annotation commits).

Claude-Session: https://claude.ai/code/session_01HjCQBqQCr2igFEMR7yUovw
The aria and eva pilot roots were merged into /coc/flash7/scratch/lance_pilot/lance_v2
with the new lab/end_effector schema and per-key steps tables; the old roots use the
pre-migration schema the readers no longer accept.

Claude-Session: https://claude.ai/code/session_01HjCQBqQCr2igFEMR7yUovw
The old roots keep the pre-migration schema, which the stack no longer reads.

Claude-Session: https://claude.ai/code/session_01HjCQBqQCr2igFEMR7yUovw
@RyanPCo
RyanPCo force-pushed the ryanco/lance-migrate-pilot branch from dee1b2c to bd32eea Compare October 30, 2026 23:05
@RyanPCo

RyanPCo commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Review findings: status after the fixup pass. The fixes are squashed into this PR's commits, and the whole stack was force-pushed.

Fixed

  • Migration drops orphan steps rows but keeps their aliases, tasks and annotations: Orphan rows in copied tables need --drop-orphan-steps and are then dropped. The run prints their count, and verify checks containment; test added. Fixup targets 4eb3a26 (same PR) because a fixup on 21292d0 conflicts
  • Docstring claims every new table starts at version 1: Reworded to 'starts fresh and its migrated version is tagged'; hash input is now '/'
  • new_steps_uri is a no-op wrapper around join: Deleted; callers use join(root, key)

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