Clarify v1.1 multiview graph schema and feature tensors
Browse files- docs/SCHEMA.md +266 -0
docs/SCHEMA.md
CHANGED
|
@@ -391,3 +391,269 @@ data/v1_no_depth/
|
|
| 391 |
```
|
| 392 |
|
| 393 |
This LeRobot-like chunked layout is the publication target. Per-episode directories in the extraction plan are an intermediate/debugging layout.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 391 |
```
|
| 392 |
|
| 393 |
This LeRobot-like chunked layout is the publication target. Per-episode directories in the extraction plan are an intermediate/debugging layout.
|
| 394 |
+
|
| 395 |
+
|
| 396 |
+
# Schema v1.1 normative update
|
| 397 |
+
|
| 398 |
+
|
| 399 |
+
|
| 400 |
+
Fable 5 and Codex both reviewed the six design questions about multi-view graphs, velocity, feature balance, source availability, task-family coverage, and vocabulary edges. The v1.1 clarification is now the normative design.
|
| 401 |
+
|
| 402 |
+
### 1. One global graph, not one graph per camera
|
| 403 |
+
|
| 404 |
+
Use one authoritative global graph per timestep:
|
| 405 |
+
|
| 406 |
+
```text
|
| 407 |
+
G_t = (V_t, E_state_t, E_prior, globals_t)
|
| 408 |
+
```
|
| 409 |
+
|
| 410 |
+
Do not create separate physical graphs for `robot0_agentview_right`, `robot0_agentview_left`, and `robot0_eye_in_hand`.
|
| 411 |
+
|
| 412 |
+
Reason:
|
| 413 |
+
|
| 414 |
+
- Object identity is global. A mug visible in the right camera and wrist camera is the same MuJoCo body/node.
|
| 415 |
+
- Physical relations are global. Contact, support, containment, qpos, held state, and robot interaction do not become false because a camera cannot see one endpoint.
|
| 416 |
+
- Per-camera graphs would confuse occlusion with object deletion and make physical edges view-dependent.
|
| 417 |
+
- RoboCasa/MuJoCo already gives free cross-view association through `segmentation objid -> geom -> body -> node`.
|
| 418 |
+
|
| 419 |
+
But the user’s concern is correct: camera evidence is different. Therefore v1.1 stores **one global graph with per-view node evidence and per-view visual features**.
|
| 420 |
+
|
| 421 |
+
Normative multi-view tensors:
|
| 422 |
+
|
| 423 |
+
```text
|
| 424 |
+
visual_views float16[T, N_max, 3, 256] # per-view masked RGB/SAM2-style visual features
|
| 425 |
+
view_visible bool[T, N_max, 3]
|
| 426 |
+
view_centroid float16[T, N_max, 3, 2]
|
| 427 |
+
view_area float16[T, N_max, 3, 1]
|
| 428 |
+
```
|
| 429 |
+
|
| 430 |
+
View order:
|
| 431 |
+
|
| 432 |
+
```text
|
| 433 |
+
0 = robot0_agentview_right
|
| 434 |
+
1 = robot0_agentview_left
|
| 435 |
+
2 = robot0_eye_in_hand
|
| 436 |
+
```
|
| 437 |
+
|
| 438 |
+
The canonical side visual feature remains in the flat compatibility node tensor, but the complete visual evidence is `visual_views`.
|
| 439 |
+
|
| 440 |
+
### 2. Velocity definition
|
| 441 |
+
|
| 442 |
+
Velocity means node-level physical velocity from the simulator, source-tagged.
|
| 443 |
+
|
| 444 |
+
Recommended source in RoboCasa/MuJoCo:
|
| 445 |
+
|
| 446 |
+
```text
|
| 447 |
+
mujoco.mj_objectVelocity(model, data, mjOBJ_BODY, body_id, res, flg_local=0)
|
| 448 |
+
```
|
| 449 |
+
|
| 450 |
+
This gives 6D world-frame body velocity. Store as linear and angular world velocity after confirming convention in the exporter.
|
| 451 |
+
|
| 452 |
+
Do not use raw free-joint `qvel` as object angular velocity without care: MuJoCo free-joint angular velocity conventions can be body-local. Use `mj_objectVelocity` for body-level velocity and store raw `qvel` only for joint/articulation state.
|
| 453 |
+
|
| 454 |
+
Per family:
|
| 455 |
+
|
| 456 |
+
| Family | Body velocity | Joint velocity |
|
| 457 |
+
|---|---|---|
|
| 458 |
+
| `object` / movable item | root body world velocity | zero unless jointed |
|
| 459 |
+
| `articulated_part` | part body world velocity | scalar qvel is primary articulation signal |
|
| 460 |
+
| `control` | body velocity if meaningful | scalar qvel / control state if jointed |
|
| 461 |
+
| `surface` / `receptacle` / `fixture` | zero, with `velocity_source=static_fixture` | zero unless fixture state joint exists |
|
| 462 |
+
| optional robot node | TCP/eef velocity from robot state or MuJoCo body velocity | robot proprio stream remains primary |
|
| 463 |
+
|
| 464 |
+
Add QA:
|
| 465 |
+
|
| 466 |
+
```text
|
| 467 |
+
finite_difference(position_world) ~= stored_linear_velocity
|
| 468 |
+
```
|
| 469 |
+
|
| 470 |
+
on contact-free segments, and assert static fixtures have zero velocity.
|
| 471 |
+
|
| 472 |
+
### 3. Feature balance: 256D visual block should not dominate by raw concat
|
| 473 |
+
|
| 474 |
+
The dataset stores typed feature blocks. It does not recommend feeding a raw 300D+ concatenation directly into a GNN.
|
| 475 |
+
|
| 476 |
+
Downstream models should use per-block projections:
|
| 477 |
+
|
| 478 |
+
```text
|
| 479 |
+
static_proj = MLP(node_static_feats)
|
| 480 |
+
dynamic_proj = MLP(node_dynamic_feats)
|
| 481 |
+
view_proj = PerViewEncoder(view_geom_feats, visual_views, view_visible)
|
| 482 |
+
edge_proj = EdgeEncoder(rel_state, rel_prior)
|
| 483 |
+
```
|
| 484 |
+
|
| 485 |
+
Then fuse into common `d_model` tokens.
|
| 486 |
+
|
| 487 |
+
Export rules:
|
| 488 |
+
|
| 489 |
+
- L2-normalize masked visual embeddings.
|
| 490 |
+
- Store per-block normalization stats.
|
| 491 |
+
- Keep visual features physically separate from symbolic state features.
|
| 492 |
+
- Publish a `symbolic_only_v1_1` tensor view for ablation.
|
| 493 |
+
- Treat the old flat `node_feats` as a compatibility view, not the only model input.
|
| 494 |
+
|
| 495 |
+
### 4. Final v1.1 tensor layout
|
| 496 |
+
|
| 497 |
+
Published graph tensor file:
|
| 498 |
+
|
| 499 |
+
```text
|
| 500 |
+
graph_tensors.npz
|
| 501 |
+
node_feats float32[T, N_max, 323] # flat compatibility typed-block view
|
| 502 |
+
node_mask bool[N_max]
|
| 503 |
+
category_ids int16[N_max]
|
| 504 |
+
|
| 505 |
+
visual_views float16[T, N_max, 3, 256]
|
| 506 |
+
view_visible bool[T, N_max, 3]
|
| 507 |
+
view_centroid float16[T, N_max, 3, 2]
|
| 508 |
+
view_area float16[T, N_max, 3, 1]
|
| 509 |
+
|
| 510 |
+
rel_state float32[T, N_max, N_max, 8]
|
| 511 |
+
rel_prior float32[N_max, N_max, 5]
|
| 512 |
+
event_masks uint8[T, 13]
|
| 513 |
+
```
|
| 514 |
+
|
| 515 |
+
`node_feats` v1.1 slicing map, D = 323:
|
| 516 |
+
|
| 517 |
+
```text
|
| 518 |
+
[0:256] visual_256 canonical-side visual feature = visual_views[:, :, 0]
|
| 519 |
+
[256:259] pos_world_3
|
| 520 |
+
[259:263] quat_xyzw_4
|
| 521 |
+
[263:266] linvel_world_3
|
| 522 |
+
[266:269] angvel_world_3
|
| 523 |
+
[269:270] qpos_norm_1
|
| 524 |
+
[270:271] qvel_norm_1
|
| 525 |
+
[271:272] binary_state_1
|
| 526 |
+
[272:274] movability_2 [free_movable, articulated]
|
| 527 |
+
[274:275] robot_contact_1
|
| 528 |
+
[275:276] held_1
|
| 529 |
+
[276:279] visibility_3 [side_right, side_left, wrist]
|
| 530 |
+
[279:291] family_12
|
| 531 |
+
[291:323] type_clip_32
|
| 532 |
+
```
|
| 533 |
+
|
| 534 |
+
### 5. Updated node families
|
| 535 |
+
|
| 536 |
+
Use 12 frozen family slots. Family is the relational role, not the full semantic class. Semantic class is carried by `category_text`, `category_id`, and CLIP type encoding.
|
| 537 |
+
|
| 538 |
+
```text
|
| 539 |
+
0 object free movable item: mug, can, food
|
| 540 |
+
1 distractor free movable non-task item; metadata-derived, not language-derived
|
| 541 |
+
2 surface static support plane: counter, stove top
|
| 542 |
+
3 receptacle containment volume: cabinet/drawer/fridge/sink basin
|
| 543 |
+
4 fixture appliance/furniture body: stove, microwave, kettle, blender, fridge
|
| 544 |
+
5 articulated_part door, drawer, lid, rack, mixer head
|
| 545 |
+
6 handle grasp point rigidly attached to articulated part
|
| 546 |
+
7 control knob, button, switch, faucet lever; actuates fixture state
|
| 547 |
+
8 region named zone: burner zone, rack slot, navigation region; v1 optional/reserved
|
| 548 |
+
9 robot optional aggregate robot/TCP node for ablations
|
| 549 |
+
10 reserved
|
| 550 |
+
11 reserved
|
| 551 |
+
```
|
| 552 |
+
|
| 553 |
+
`appliance_part` is removed because it is ambiguous. Use `articulated_part`, `handle`, or `control` instead.
|
| 554 |
+
|
| 555 |
+
### 6. Updated relation tensors
|
| 556 |
+
|
| 557 |
+
State relation tensor:
|
| 558 |
+
|
| 559 |
+
```text
|
| 560 |
+
rel_state: float32[T, N_max, N_max, 8]
|
| 561 |
+
channels:
|
| 562 |
+
contact
|
| 563 |
+
support
|
| 564 |
+
near
|
| 565 |
+
inside
|
| 566 |
+
rel_dx
|
| 567 |
+
rel_dy
|
| 568 |
+
rel_dz
|
| 569 |
+
dist_norm
|
| 570 |
+
```
|
| 571 |
+
|
| 572 |
+
Prior relation tensor:
|
| 573 |
+
|
| 574 |
+
```text
|
| 575 |
+
rel_prior: float32[N_max, N_max, 5]
|
| 576 |
+
channels:
|
| 577 |
+
part_of
|
| 578 |
+
controls
|
| 579 |
+
same_fixture_group
|
| 580 |
+
can_contain
|
| 581 |
+
can_support
|
| 582 |
+
```
|
| 583 |
+
|
| 584 |
+
Direction conventions:
|
| 585 |
+
|
| 586 |
+
```text
|
| 587 |
+
support[i,j] = 1 means node i rests on/supports-contact with node j as support destination
|
| 588 |
+
inside[i,j] = 1 means node i is inside node j
|
| 589 |
+
part_of[i,j] = 1 means node i is part of node j
|
| 590 |
+
controls[i,j] = 1 means node i actuates/controls node j
|
| 591 |
+
can_contain[i,j] = 1 means node i can contain node j
|
| 592 |
+
can_support[i,j] = 1 means node i can support node j
|
| 593 |
+
```
|
| 594 |
+
|
| 595 |
+
Robot contact and held state are node flags by default. Robot-object edges are created only in a robot-node ablation.
|
| 596 |
+
|
| 597 |
+
### 7. Vocabulary information
|
| 598 |
+
|
| 599 |
+
Node vocabulary is included:
|
| 600 |
+
|
| 601 |
+
```text
|
| 602 |
+
category_text
|
| 603 |
+
category_id
|
| 604 |
+
type_clip_32
|
| 605 |
+
full CLIP 512D type table
|
| 606 |
+
```
|
| 607 |
+
|
| 608 |
+
Edge vocabulary is primarily discrete and rule-table based:
|
| 609 |
+
|
| 610 |
+
```text
|
| 611 |
+
relation channel IDs
|
| 612 |
+
human-reviewed affordance matrix
|
| 613 |
+
sim kinematic tree relations
|
| 614 |
+
```
|
| 615 |
+
|
| 616 |
+
Optional metadata may include CLIP embeddings of relation names, but relation CLIP vectors are not part of the default relation tensor.
|
| 617 |
+
|
| 618 |
+
Reasoning/VLM/LLM policy:
|
| 619 |
+
|
| 620 |
+
- No reasoning-model dependency in sim v1.
|
| 621 |
+
- LLM may draft rule tables, but committed source is `human_reviewed_rule_table`.
|
| 622 |
+
- `category_text` comes only from fixed rename tables keyed by asset/sim metadata; no per-episode language edits.
|
| 623 |
+
- No reasoning output is allowed for contact, support, held state, qpos, current inside state, or physical relations.
|
| 624 |
+
|
| 625 |
+
### 8. Feature source table
|
| 626 |
+
|
| 627 |
+
| Feature | Source in v1 | Needs CLIP/VLM/LLM? |
|
| 628 |
+
|---|---|---|
|
| 629 |
+
| node inventory | sim metadata + deterministic grouping rules | no |
|
| 630 |
+
| body/geom/joint IDs | MuJoCo model | no |
|
| 631 |
+
| family | deterministic role rules | no |
|
| 632 |
+
| category_text/category_id | fixed rename table from sim metadata | no |
|
| 633 |
+
| type_clip_32 | frozen CLIP text encoder | CLIP yes, VLM/LLM no |
|
| 634 |
+
| RGB | replay render or stored video | no |
|
| 635 |
+
| masks/segmentation | MuJoCo segmentation render | no |
|
| 636 |
+
| bbox/centroid/area | masks | no |
|
| 637 |
+
| visual_views 256D | masked RGB visual encoder pooled by oracle mask | visual encoder yes; not reasoning |
|
| 638 |
+
| pose/orientation | sim state xpose/xquat | no |
|
| 639 |
+
| velocity | `mj_objectVelocity`; FD only QA/fallback | no |
|
| 640 |
+
| qpos/qvel | sim qpos/qvel via joint addresses | no |
|
| 641 |
+
| binary state | qpos/state thresholds | no |
|
| 642 |
+
| contact/support | sim contacts + deterministic filter/rule | no |
|
| 643 |
+
| inside/near/relative geometry | sim pose/AABB geometry | no |
|
| 644 |
+
| part_of/controls | kinematic tree/fixture metadata | no |
|
| 645 |
+
| can_contain/can_support | human-reviewed rule table | no LLM dependency |
|
| 646 |
+
| target labels | task metadata | supervision/eval only |
|
| 647 |
+
| depth-derived geometry | not in v1 | not available |
|
| 648 |
+
|
| 649 |
+
### 9. New sanity checks
|
| 650 |
+
|
| 651 |
+
- Swapping instruction text must not change node features, edge features, node inventory, or relation tensors.
|
| 652 |
+
- A node hidden in one camera but visible in another remains one global node.
|
| 653 |
+
- `visual_views[t,n,v]` is valid only when `view_visible[t,n,v]` is true.
|
| 654 |
+
- `visual_views[:, :, 0]` must match `node_feats[:, :, 0:256]` for the compatibility block.
|
| 655 |
+
- Every category ID resolves in the type table.
|
| 656 |
+
- Static fixtures have zero velocity.
|
| 657 |
+
- FD velocity approximately agrees with stored velocity on contact-free segments.
|
| 658 |
+
- Affordance channels must reproduce exactly from the published matrix gather.
|
| 659 |
+
- Event vocabulary must match across README, SCHEMA, relation vocab, and exporter output.
|