diff --git a/2026-05-10__episode_000_left_p01.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_000_left_p01.png similarity index 100% rename from 2026-05-10__episode_000_left_p01.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_000_left_p01.png diff --git a/2026-05-10__episode_000_left_p01rand.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_000_left_p01rand.png similarity index 100% rename from 2026-05-10__episode_000_left_p01rand.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_000_left_p01rand.png diff --git a/2026-05-10__episode_000_right_p01.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_000_right_p01.png similarity index 100% rename from 2026-05-10__episode_000_right_p01.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_000_right_p01.png diff --git a/2026-05-10__episode_000_right_p01rand.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_000_right_p01rand.png similarity index 100% rename from 2026-05-10__episode_000_right_p01rand.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_000_right_p01rand.png diff --git a/2026-05-10__episode_005_left_p01.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_005_left_p01.png similarity index 100% rename from 2026-05-10__episode_005_left_p01.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_005_left_p01.png diff --git a/2026-05-10__episode_005_left_p01rand.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_005_left_p01rand.png similarity index 100% rename from 2026-05-10__episode_005_left_p01rand.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_005_left_p01rand.png diff --git a/2026-05-10__episode_005_right_p01.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_005_right_p01.png similarity index 100% rename from 2026-05-10__episode_005_right_p01.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_005_right_p01.png diff --git a/2026-05-10__episode_005_right_p01rand.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_005_right_p01rand.png similarity index 100% rename from 2026-05-10__episode_005_right_p01rand.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_005_right_p01rand.png diff --git a/2026-05-10__episode_006_left_p01.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_006_left_p01.png similarity index 100% rename from 2026-05-10__episode_006_left_p01.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_006_left_p01.png diff --git a/2026-05-10__episode_006_left_p01rand.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_006_left_p01rand.png similarity index 100% rename from 2026-05-10__episode_006_left_p01rand.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_006_left_p01rand.png diff --git a/2026-05-10__episode_006_right_p01.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_006_right_p01.png similarity index 100% rename from 2026-05-10__episode_006_right_p01.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_006_right_p01.png diff --git a/2026-05-10__episode_006_right_p01rand.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_006_right_p01rand.png similarity index 100% rename from 2026-05-10__episode_006_right_p01rand.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-10__episode_006_right_p01rand.png diff --git a/2026-05-11__episode_003_left_p01.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-11__episode_003_left_p01.png similarity index 100% rename from 2026-05-11__episode_003_left_p01.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-11__episode_003_left_p01.png diff --git a/2026-05-11__episode_003_left_p01rand.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-11__episode_003_left_p01rand.png similarity index 100% rename from 2026-05-11__episode_003_left_p01rand.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-11__episode_003_left_p01rand.png diff --git a/2026-05-11__episode_003_right_p01.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-11__episode_003_right_p01.png similarity index 100% rename from 2026-05-11__episode_003_right_p01.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-11__episode_003_right_p01.png diff --git a/2026-05-11__episode_003_right_p01rand.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-11__episode_003_right_p01rand.png similarity index 100% rename from 2026-05-11__episode_003_right_p01rand.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-11__episode_003_right_p01rand.png diff --git a/2026-05-19__episode_002_left_p01.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-19__episode_002_left_p01.png similarity index 100% rename from 2026-05-19__episode_002_left_p01.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-19__episode_002_left_p01.png diff --git a/2026-05-19__episode_002_left_p01rand.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-19__episode_002_left_p01rand.png similarity index 100% rename from 2026-05-19__episode_002_left_p01rand.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-19__episode_002_left_p01rand.png diff --git a/2026-05-19__episode_002_right_p01.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-19__episode_002_right_p01.png similarity index 100% rename from 2026-05-19__episode_002_right_p01.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-19__episode_002_right_p01.png diff --git a/2026-05-19__episode_002_right_p01rand.png b/01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-19__episode_002_right_p01rand.png similarity index 100% rename from 2026-05-19__episode_002_right_p01rand.png rename to 01_tactile_delta_heatmaps_p01_vs_p01rand/2026-05-19__episode_002_right_p01rand.png diff --git a/01_tactile_delta_heatmaps_p01_vs_p01rand/README.md b/01_tactile_delta_heatmaps_p01_vs_p01rand/README.md new file mode 100644 index 0000000000000000000000000000000000000000..37ddc8db7a9092da0886d971a4f55bf5cec764b8 --- /dev/null +++ b/01_tactile_delta_heatmaps_p01_vs_p01rand/README.md @@ -0,0 +1,12 @@ +# 01 — Tactile Δ heatmaps: p01 fixed vs p01rand pool + +**Purpose**: motivate the reference-frame choice for `tactile_delta_to_ref` training. +Compare fixed episode-level p01 anchor vs random no-contact frame sampling. + +**Format**: `__.png`, 5 episodes × 2 sides × 2 modes = 20 PNGs. + +**Per PNG**: 6 rows (top-4 high-Δ contact + bottom-2 low-Δ background), 5 columns: +`raw t | ref RGB | ‖z_t‖ 16×16 | ‖z_ref‖ 16×16 | ‖Δz‖ 16×16`. + +**Read**: contact regions concentrate in ~5×5 latent tokens (10% of 16×16 map). +p01rand pool sizes: 8-19% of episode frames. diff --git a/debug_A_synthetic_encoder_bias.png b/02_videovae_tactile_debug/A_synthetic_input_bias.png similarity index 100% rename from debug_A_synthetic_encoder_bias.png rename to 02_videovae_tactile_debug/A_synthetic_input_bias.png diff --git a/debug_B_per_row_vmax_2026-05-10__episode_000.png b/02_videovae_tactile_debug/B_per_row_vmax_ep000.png similarity index 100% rename from debug_B_per_row_vmax_2026-05-10__episode_000.png rename to 02_videovae_tactile_debug/B_per_row_vmax_ep000.png diff --git a/debug_C_temporal_identity_2026-05-10__episode_000.png b/02_videovae_tactile_debug/C_temporal_identity_ep000.png similarity index 100% rename from debug_C_temporal_identity_2026-05-10__episode_000.png rename to 02_videovae_tactile_debug/C_temporal_identity_ep000.png diff --git a/02_videovae_tactile_debug/README.md b/02_videovae_tactile_debug/README.md new file mode 100644 index 0000000000000000000000000000000000000000..908b9fe6f94ab18ce703c8aa3e67369464b4c9a7 --- /dev/null +++ b/02_videovae_tactile_debug/README.md @@ -0,0 +1,15 @@ +# 02 — VideoVAE+ tactile-finetuned encoder artifact diagnosis + +3 tests to pin down the right-bottom hotspot + ti=0 boundary bleed. + +- **A_synthetic_input_bias**: encode uniform gray (0/64/128/192/255) + noise, look at ‖z‖. + gray-192 argmax = **(15, 15) right-bottom corner** — encoder positional bias on + non-zero uniform input. +- **B_per_row_vmax_ep000**: same 3+3 sample frames rendered with global vs + per-row vmax vs log-scale — proves the "contact frame right-bottom disappears" + observation is a colormap artifact (GroupNorm suppression). +- **C_temporal_identity_ep000**: encode 16 identical p01 ref frames → 4 latent + frames. left/right per-frame max = [52.67, 16.73, 10.17, 10.32] / [57.26, + 17.09, 10.18, 10.22]. **ti=0 is 5× baseline**, ti=1 is 1.7×. Boundary bleed + from temporal encoder's front-replicate pad + spatial encoder's + `TemporalAttention` position bias. diff --git a/visual_debug/debug_A_synthetic_encoder_bias_VISUAL.png b/03_videovae_visual_debug_base_vae/A_synthetic_input_bias.png similarity index 100% rename from visual_debug/debug_A_synthetic_encoder_bias_VISUAL.png rename to 03_videovae_visual_debug_base_vae/A_synthetic_input_bias.png diff --git a/visual_debug/debug_B_per_row_vmax_VISUAL_left_2026-05-10__episode_000.png b/03_videovae_visual_debug_base_vae/B_per_row_vmax_ep000_left.png similarity index 100% rename from visual_debug/debug_B_per_row_vmax_VISUAL_left_2026-05-10__episode_000.png rename to 03_videovae_visual_debug_base_vae/B_per_row_vmax_ep000_left.png diff --git a/visual_debug/debug_C_temporal_identity_VISUAL_left_2026-05-10__episode_000.png b/03_videovae_visual_debug_base_vae/C_temporal_identity_ep000_left.png similarity index 100% rename from visual_debug/debug_C_temporal_identity_VISUAL_left_2026-05-10__episode_000.png rename to 03_videovae_visual_debug_base_vae/C_temporal_identity_ep000_left.png diff --git a/03_videovae_visual_debug_base_vae/README.md b/03_videovae_visual_debug_base_vae/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5adf44fc0c9840f9069f0382c475474fba47eff5 --- /dev/null +++ b/03_videovae_visual_debug_base_vae/README.md @@ -0,0 +1,14 @@ +# 03 — Base VideoVAE+ (visual) artifact diagnosis + +Same 3 tests as `02_videovae_tactile_debug/`, but with the base +(never-finetuned) VideoVAE+ (`sota-4-16z.ckpt`) on `view_left` data. + +**Confirms both artifacts are architectural**, not tactile-finetune-specific: + +- gray-192 argmax = (15,15) — right-bottom hotspot ALSO on base VAE, and + **more severe** (max 20.51 vs tactile 16.94). +- Test C: base + visual_left = [37.39, 11.21, 7.20, 6.91] → same [5.4, 1.6, 1, 1] + temporal bleed pattern. + +**Implication**: our whole vision+tactile latent pipeline suffers from these +issues, not just tactile. diff --git a/04_videovae_full_latents_tactile_ep000/README.md b/04_videovae_full_latents_tactile_ep000/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8fb4e3aec17680108a4aa17795a191e356780ecb --- /dev/null +++ b/04_videovae_full_latents_tactile_ep000/README.md @@ -0,0 +1,10 @@ +# 04 — VideoVAE+ full-episode tactile latent video + +Every latent frame of `2026-05-10__episode_000.pt` (both tactile sides), +rendered from **non-overlapping T=16 raw windows** → 4 latent frames per window. + +Per video frame: 3 panels: `raw RGB | ‖z‖ GLOBAL vmax | ‖z‖ PER-FRAME vmax` ++ caption with `wi/ti/raw_idx/|z|max/contact_score`. Duration ~69 s at 25 fps. + +Watch for: ti=0 anchor (window-boundary bleed) + right-bottom hotspot on +background frames + spatial concentration on contact frames. diff --git a/all_latents_2026-05-10__episode_000/2026-05-10__episode_000_left_all_latents.mp4 b/04_videovae_full_latents_tactile_ep000/tactile_left_all_latents.mp4 similarity index 100% rename from all_latents_2026-05-10__episode_000/2026-05-10__episode_000_left_all_latents.mp4 rename to 04_videovae_full_latents_tactile_ep000/tactile_left_all_latents.mp4 diff --git a/all_latents_2026-05-10__episode_000/2026-05-10__episode_000_right_all_latents.mp4 b/04_videovae_full_latents_tactile_ep000/tactile_right_all_latents.mp4 similarity index 100% rename from all_latents_2026-05-10__episode_000/2026-05-10__episode_000_right_all_latents.mp4 rename to 04_videovae_full_latents_tactile_ep000/tactile_right_all_latents.mp4 diff --git a/05_videovae_full_latents_visual_ep000/README.md b/05_videovae_full_latents_visual_ep000/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9851d91842c570a60e01fe9d69efce0a9f9d18c6 --- /dev/null +++ b/05_videovae_full_latents_visual_ep000/README.md @@ -0,0 +1,5 @@ +# 05 — VideoVAE+ full-episode visual latent video (base VAE) + +Same format as `04_...tactile...`, but for `view_left` of the same episode, +encoded with the base VAE. Directly comparable to the tactile version at the +same window/ti index. No contact_score column (visual has none). diff --git a/all_latents_2026-05-10__episode_000_visual/2026-05-10__episode_000_visual_left_all_latents.mp4 b/05_videovae_full_latents_visual_ep000/visual_left_all_latents.mp4 similarity index 100% rename from all_latents_2026-05-10__episode_000_visual/2026-05-10__episode_000_visual_left_all_latents.mp4 rename to 05_videovae_full_latents_visual_ep000/visual_left_all_latents.mp4 diff --git a/cosmos_debug/cosmos_A_synthetic.png b/06_cosmos_debug/A_synthetic_input_bias.png similarity index 100% rename from cosmos_debug/cosmos_A_synthetic.png rename to 06_cosmos_debug/A_synthetic_input_bias.png diff --git a/cosmos_debug/cosmos_C_temporal_identity_tactile_left.png b/06_cosmos_debug/C_temporal_identity_tactile_left.png similarity index 100% rename from cosmos_debug/cosmos_C_temporal_identity_tactile_left.png rename to 06_cosmos_debug/C_temporal_identity_tactile_left.png diff --git a/cosmos_debug/cosmos_C_temporal_identity_tactile_right.png b/06_cosmos_debug/C_temporal_identity_tactile_right.png similarity index 100% rename from cosmos_debug/cosmos_C_temporal_identity_tactile_right.png rename to 06_cosmos_debug/C_temporal_identity_tactile_right.png diff --git a/cosmos_debug/cosmos_C_temporal_identity_visual_left.png b/06_cosmos_debug/C_temporal_identity_visual_left.png similarity index 100% rename from cosmos_debug/cosmos_C_temporal_identity_visual_left.png rename to 06_cosmos_debug/C_temporal_identity_visual_left.png diff --git a/cosmos_debug/cosmos_C_temporal_identity_visual_middle.png b/06_cosmos_debug/C_temporal_identity_visual_middle.png similarity index 100% rename from cosmos_debug/cosmos_C_temporal_identity_visual_middle.png rename to 06_cosmos_debug/C_temporal_identity_visual_middle.png diff --git a/cosmos_debug/cosmos_C_temporal_identity_visual_right.png b/06_cosmos_debug/C_temporal_identity_visual_right.png similarity index 100% rename from cosmos_debug/cosmos_C_temporal_identity_visual_right.png rename to 06_cosmos_debug/C_temporal_identity_visual_right.png diff --git a/06_cosmos_debug/README.md b/06_cosmos_debug/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3ca78a2e19e1e4c9c53ce184fdff09cf8b2263a9 --- /dev/null +++ b/06_cosmos_debug/README.md @@ -0,0 +1,13 @@ +# 06 — Cosmos CV4x8x8 encoder verification + +Same tests as `02` + `03`, but with Cosmos CV4x8x8 (encoder JIT from +`nvidia/Cosmos-0.1-Tokenizer-CV4x8x8`). + +- **A_synthetic_input_bias**: gray-192 max/mean ratio = **1.6×** (VideoVAE+ + base was 4.5×). Right-bottom hotspot much weaker. +- **C_temporal_identity_***: for each stream, encode 16 identical raw frames + → 5 Cosmos latent frames. **All 5 frames identical to 4 decimal digits** + (drift mean = 0.0000, bf16 precision noise). Perfect causal identity. + +**Verifies Cosmos is strictly causal** and has no temporal boundary bleed +architectural artifact. diff --git a/07_cosmos_vs_videovae_recon/README.md b/07_cosmos_vs_videovae_recon/README.md new file mode 100644 index 0000000000000000000000000000000000000000..80988648bd5b3161b574c03a4a9159408b2d16d2 --- /dev/null +++ b/07_cosmos_vs_videovae_recon/README.md @@ -0,0 +1,25 @@ +# 07 — Cosmos vs VideoVAE+ reconstruction comparison + +For each of 5 streams, encode a T=16 raw segment (ep000 frames [1000, 1016)) +with **both** tokenizers, decode back to pixels, compute PSNR/SSIM/L1 per frame. + +**Layout per MP4 frame**: +`orig | Cosmos recon | Cosmos |Δ| | VideoVAE+ recon | VideoVAE+ |Δ|`. +Each panel 128→256 upsample. Per-frame PSNR/SSIM in title, stream-level +averages in caption. + +**Key result** (average over 16 frames): + +| stream | Cosmos PSNR | Cosmos SSIM | VVAE+ PSNR | VVAE+ SSIM | +|---|---|---|---|---| +| visual_left | 30.04 | 0.892 | **32.99** | **0.949** | +| visual_middle | 29.94 | 0.885 | **33.20** | **0.945** | +| visual_right | 28.82 | 0.889 | **32.10** | **0.948** | +| tactile_left | **43.98** | **0.971** | 37.42 | 0.965 | +| tactile_right | **46.68** | **0.983** | 38.83 | 0.979 | + +**Interpretation**: +- VideoVAE+ wins visual by ~3 dB (expected — base VVAE+ was pretrained on + natural video too; Cosmos is competitive but slightly behind). +- Cosmos wins tactile by 6-8 dB **zero-shot**, despite VideoVAE+ being + finetuned on our exact tactile distribution. diff --git a/recon_compare_cosmos_vs_vvae/metrics.json b/07_cosmos_vs_videovae_recon/metrics.json similarity index 100% rename from recon_compare_cosmos_vs_vvae/metrics.json rename to 07_cosmos_vs_videovae_recon/metrics.json diff --git a/recon_compare_cosmos_vs_vvae/recon_compare_tactile_left.mp4 b/07_cosmos_vs_videovae_recon/recon_compare_tactile_left.mp4 similarity index 100% rename from recon_compare_cosmos_vs_vvae/recon_compare_tactile_left.mp4 rename to 07_cosmos_vs_videovae_recon/recon_compare_tactile_left.mp4 diff --git a/recon_compare_cosmos_vs_vvae/recon_compare_tactile_right.mp4 b/07_cosmos_vs_videovae_recon/recon_compare_tactile_right.mp4 similarity index 100% rename from recon_compare_cosmos_vs_vvae/recon_compare_tactile_right.mp4 rename to 07_cosmos_vs_videovae_recon/recon_compare_tactile_right.mp4 diff --git a/recon_compare_cosmos_vs_vvae/recon_compare_visual_left.mp4 b/07_cosmos_vs_videovae_recon/recon_compare_visual_left.mp4 similarity index 100% rename from recon_compare_cosmos_vs_vvae/recon_compare_visual_left.mp4 rename to 07_cosmos_vs_videovae_recon/recon_compare_visual_left.mp4 diff --git a/recon_compare_cosmos_vs_vvae/recon_compare_visual_middle.mp4 b/07_cosmos_vs_videovae_recon/recon_compare_visual_middle.mp4 similarity index 100% rename from recon_compare_cosmos_vs_vvae/recon_compare_visual_middle.mp4 rename to 07_cosmos_vs_videovae_recon/recon_compare_visual_middle.mp4 diff --git a/recon_compare_cosmos_vs_vvae/recon_compare_visual_right.mp4 b/07_cosmos_vs_videovae_recon/recon_compare_visual_right.mp4 similarity index 100% rename from recon_compare_cosmos_vs_vvae/recon_compare_visual_right.mp4 rename to 07_cosmos_vs_videovae_recon/recon_compare_visual_right.mp4 diff --git a/08_cosmos_full_latents_ep000/README.md b/08_cosmos_full_latents_ep000/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1ed2b6567b392140b4b9c0f67c0023f1f367ed29 --- /dev/null +++ b/08_cosmos_full_latents_ep000/README.md @@ -0,0 +1,27 @@ +# 08 — Cosmos full-episode latent visualization + +Cosmos CV4x8x8 encoding of episode_000 across all 5 streams +(visual_left/middle/right + tactile_left/right). + +Two artifacts per stream: + +- `_all_latents.mp4` — non-overlapping T=16 raw windows encoded with + Cosmos → 5 latent frames per window. Every latent frame rendered as + `raw | ‖z‖ GLOBAL vmax | ‖z‖ PER-FRAME vmax`. Caption tags ti=0 as + `[ANCHOR ti=0]` (which by Cosmos design is a single-frame encoding of + raw[window_start]). +- `_p01_delta.png` — same format as experiment 01: 6 rows × 5 cols + showing raw / ref RGB / ‖z_t‖ / ‖z_ref‖ / ‖Δz‖. Reference for tactile: + `_contact_meta['ref_p01_idx_']` (same as experiment 01). Reference + for visual: raw[0] (episode start). + +**Reference latent computed via Cosmos causality**: replicate the ref raw +frame 16× temporally → take ti=0 (which by strict causality depends only on +raw[0]). Cleanest possible single-frame encoding. + +**Compare to experiments 01/04/05 (VideoVAE+ same episode)** to see: +- No right-bottom hotspot +- No ti=0 boundary bleed +- Cleaner Δ maps on contact frames +- 5-7× smaller latent magnitudes (closer to unit variance → better for + downstream diffusion training). diff --git a/cosmos_full_episode_000/tactile_left_all_latents.mp4 b/08_cosmos_full_latents_ep000/tactile_left_all_latents.mp4 similarity index 100% rename from cosmos_full_episode_000/tactile_left_all_latents.mp4 rename to 08_cosmos_full_latents_ep000/tactile_left_all_latents.mp4 diff --git a/cosmos_full_episode_000/tactile_left_p01.png b/08_cosmos_full_latents_ep000/tactile_left_p01_delta.png similarity index 100% rename from cosmos_full_episode_000/tactile_left_p01.png rename to 08_cosmos_full_latents_ep000/tactile_left_p01_delta.png diff --git a/cosmos_full_episode_000/tactile_right_all_latents.mp4 b/08_cosmos_full_latents_ep000/tactile_right_all_latents.mp4 similarity index 100% rename from cosmos_full_episode_000/tactile_right_all_latents.mp4 rename to 08_cosmos_full_latents_ep000/tactile_right_all_latents.mp4 diff --git a/cosmos_full_episode_000/tactile_right_p01.png b/08_cosmos_full_latents_ep000/tactile_right_p01_delta.png similarity index 100% rename from cosmos_full_episode_000/tactile_right_p01.png rename to 08_cosmos_full_latents_ep000/tactile_right_p01_delta.png diff --git a/cosmos_full_episode_000/visual_left_all_latents.mp4 b/08_cosmos_full_latents_ep000/visual_left_all_latents.mp4 similarity index 100% rename from cosmos_full_episode_000/visual_left_all_latents.mp4 rename to 08_cosmos_full_latents_ep000/visual_left_all_latents.mp4 diff --git a/cosmos_full_episode_000/visual_left_p01.png b/08_cosmos_full_latents_ep000/visual_left_p01_delta.png similarity index 100% rename from cosmos_full_episode_000/visual_left_p01.png rename to 08_cosmos_full_latents_ep000/visual_left_p01_delta.png diff --git a/cosmos_full_episode_000/visual_middle_all_latents.mp4 b/08_cosmos_full_latents_ep000/visual_middle_all_latents.mp4 similarity index 100% rename from cosmos_full_episode_000/visual_middle_all_latents.mp4 rename to 08_cosmos_full_latents_ep000/visual_middle_all_latents.mp4 diff --git a/cosmos_full_episode_000/visual_middle_p01.png b/08_cosmos_full_latents_ep000/visual_middle_p01_delta.png similarity index 100% rename from cosmos_full_episode_000/visual_middle_p01.png rename to 08_cosmos_full_latents_ep000/visual_middle_p01_delta.png diff --git a/cosmos_full_episode_000/visual_right_all_latents.mp4 b/08_cosmos_full_latents_ep000/visual_right_all_latents.mp4 similarity index 100% rename from cosmos_full_episode_000/visual_right_all_latents.mp4 rename to 08_cosmos_full_latents_ep000/visual_right_all_latents.mp4 diff --git a/cosmos_full_episode_000/visual_right_p01.png b/08_cosmos_full_latents_ep000/visual_right_p01_delta.png similarity index 100% rename from cosmos_full_episode_000/visual_right_p01.png rename to 08_cosmos_full_latents_ep000/visual_right_p01_delta.png diff --git a/README.md b/README.md index b3350fe7d7e952fbfea2e2da0ff37e6faea8846c..5bd4112ddbf0d51c087c5e1421dab58f06710a15 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,81 @@ -# Tactile latent bottom-right hotspot — debug +# VideoVAE+ vs Cosmos — Latent tokenizer diagnostic for visuo-tactile world model -Three tests on the tactile-finetuned VideoVAE encoder. +**Timeline**: 2026-07-02 to 2026-07-03. Diagnosing whether our current VideoVAE+ +latent tokenizer has architectural issues that hurt downstream world model +training, and whether NVIDIA's Cosmos Tokenizer CV4x8x8 is a viable replacement. -## A — Synthetic encoder bias (`debug_A_synthetic_encoder_bias.png`) -Uniform inputs (gray 0/64/128/192/255 + random noise), each replicated 16× temporally. -If a uniform input produces a spatially non-uniform latent (esp. bottom-right hotspot), -the VAE encoder has intrinsic positional bias. +## TL;DR -**Per-input stats (channel-L2 heatmap, mean over T_lat=4):** +Two architectural issues found in VideoVAE+, both **absent in Cosmos**: -| input | min | mean | max | argmax (H, W) | +1. **Right-bottom spatial hotspot** — `Downsample2plus1D` uses asymmetric zero-pad + on right + bottom (`autoencoder2plus1d_1dcnn.py:396`), accumulated over 3 + downsample layers, produces a systematic (15, 15) activation on uniform + mid-gray inputs. Content-dependent via GroupNorm suppression → `delta-to-ref` + does NOT fully cancel it. + +2. **Temporal boundary bleed (ti=0 has 5× baseline magnitude)** — spatial + encoder's `TemporalAttention` uses RelativePosition embeddings with + full-bidirectional attention (no causal mask) + `EncoderTemporal1DCNN` front- + only replicate pad accumulates over 2 downsample layers, biasing ti=0 by 5× + and ti=1 by 1.7× on identical inputs. This is also a **training-time + information leak**: history latents encode future raw frames through + bidirectional attention. + +**Cosmos verification**: `CausalConv3d` uses strict left-only replication pad; +`CausalTemporalAttnBlock` uses lower-triangular mask. For 16 identical raw +frames, Cosmos produces 5 latent frames identical to 4 decimal digits (drift +mean = 0.0000, ~bf16 precision noise). + +**Cosmos reconstruction beats VideoVAE+ on tactile by 6–8 dB PSNR** even though +Cosmos is **zero-shot on tactile** and VideoVAE+ was finetuned on our exact +tactile distribution. Visual: VideoVAE+ leads by ~3 dB. + +**Recommendation**: switch tokenizer to Cosmos CV4x8x8. No tactile finetune +needed. Visual gap is acceptable and can be closed later if it becomes a +world-model bottleneck. + +--- + +## Experiments (chronological) + +| # | Directory | What | Key finding | +|---|---|---|---| +| 01 | [`01_tactile_delta_heatmaps_p01_vs_p01rand/`](./01_tactile_delta_heatmaps_p01_vs_p01rand) | Tactile Δ heatmaps on 5 episodes × 2 sides × 2 ref modes | Contact regions concentrate in 3-6 latent tokens; p01rand pool covers 8-19% of frames | +| 02 | [`02_videovae_tactile_debug/`](./02_videovae_tactile_debug) | VideoVAE+ tactile-finetuned encoder — synthetic input / per-row vmax / temporal identity | gray-192 argmax = (15,15); ti=0 max = 5× baseline; ti=1 max = 1.7× | +| 03 | [`03_videovae_visual_debug_base_vae/`](./03_videovae_visual_debug_base_vae) | Base VideoVAE+ (visual) — same 3 tests | Same artifacts as tactile — confirmed architectural, not finetune-specific | +| 04 | [`04_videovae_full_latents_tactile_ep000/`](./04_videovae_full_latents_tactile_ep000) | Every latent frame of ep_000 as MP4 (tactile) | 3-panel per-frame video: raw + \|z\| global vmax + \|z\| per-frame vmax | +| 05 | [`05_videovae_full_latents_visual_ep000/`](./05_videovae_full_latents_visual_ep000) | Every latent frame of ep_000 as MP4 (visual_left, base VAE) | Same layout for direct A/B viewing with tactile | +| 06 | [`06_cosmos_debug/`](./06_cosmos_debug) | Cosmos CV4x8x8 causality verification | drift mean = 0.0000 on 16 identical frames; hotspot much weaker | +| 07 | [`07_cosmos_vs_videovae_recon/`](./07_cosmos_vs_videovae_recon) | encode+decode reconstruction A/B on all 5 streams | **Cosmos beats VideoVAE+ on tactile by +6-8 dB PSNR (zero-shot)**; VVAE+ leads visual by +3 dB | +| 08 | [`08_cosmos_full_latents_ep000/`](./08_cosmos_full_latents_ep000) | Cosmos full-episode latent videos + p01 Δ heatmaps (all 5 streams) | Cosmos latent 5-7× smaller magnitude, cleaner spatial distribution | + +## Code + +All scripts committed to `scripts/` in the training repo: + +- `viz_tactile_latent_delta.py` — experiment 01 +- `debug_tactile_latent_bias.py` — experiment 02 +- `debug_visual_latent_bias.py` — experiment 03 +- `viz_all_latents_video.py` — experiments 04 + 05 +- `debug_cosmos_latent.py` — experiment 06 +- `compare_recon_cosmos_vs_videovae.py` — experiment 07 +- `viz_cosmos_episode.py` — experiment 08 + +## Reconstruction metrics summary + +From experiment 07, on `episode_000` raw frames [1000, 1016): + +| stream | Cosmos PSNR | Cosmos SSIM | VideoVAE+ PSNR | VideoVAE+ SSIM | |---|---|---|---|---| -| gray-0 | 8.021 | 9.464 | 9.773 | (np.int64(3), np.int64(5)) | -| gray-64 | 5.777 | 7.774 | 8.816 | (np.int64(12), np.int64(14)) | -| gray-128 | 2.446 | 3.371 | 11.223 | (np.int64(6), np.int64(15)) | -| gray-192 | 7.093 | 7.926 | 16.944 | (np.int64(15), np.int64(15)) | -| gray-255 | 8.986 | 10.320 | 10.617 | (np.int64(5), np.int64(11)) | -| noise | 3.029 | 3.720 | 4.393 | (np.int64(14), np.int64(4)) | - -## B — Per-row vmax rescale (`debug_B_per_row_vmax_*.png`) -Same 3 contact + 3 background frames, three heatmap variants: -column 2 = GLOBAL vmax (matches original viz), column 3 = PER-ROW vmax, -column 4 = log10 ‖z_t‖. - -**Read**: if bottom-right hotspot is visible under GLOBAL vmax only in background rows -but reappears in contact rows under PER-ROW vmax / log-scale → colormap artifact, -bias is present in ALL frames, just masked visually. - -## C — Temporal identity (`debug_C_temporal_identity_*.png`) -Feed 16 identical raw frames of the p01 ref → check 4 latent frames. -If they're near-identical (column 5 diff-map ~0), 3D conv preserves stationarity. -Otherwise the temporal conv introduces boundary drift. +| visual_left | 30.04 | 0.892 | **32.99** | **0.949** | +| visual_middle | 29.94 | 0.885 | **33.20** | **0.945** | +| visual_right | 28.82 | 0.889 | **32.10** | **0.948** | +| tactile_left | **43.98** | **0.971** | 37.42 | 0.965 | +| tactile_right | **46.68** | **0.983** | 38.83 | 0.979 | + +## Next steps + +- Robustness check across more episodes / segments +- Full-dataset re-encoding with Cosmos if the finding holds +- Smoke train on Cosmos latents to check world-model rollout quality diff --git a/all_latents_2026-05-10__episode_000/README.md b/all_latents_2026-05-10__episode_000/README.md deleted file mode 100644 index 7a8c6d115df7854e3bacdb53970ce349a7dc825f..0000000000000000000000000000000000000000 --- a/all_latents_2026-05-10__episode_000/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# All latent frames — 2026-05-10__episode_000.pt - -Video renders every latent frame from non-overlapping raw-16 windows. -3 panels per frame: - -1. **raw RGB** — 128×128 tactile frame (upsampled 2× for viewing) -2. **‖z‖ heatmap GLOBAL vmax** — heatmap normalized to 99th-percentile max across the whole episode; brightness comparable across frames -3. **‖z‖ heatmap PER-FRAME vmax** — heatmap normalized to the current frame's own max; always spans the full colormap → best for spatial pattern - -Caption: `raw / wi / ti / |z|max / vmax_global / contact` (contact = `tactile_{side}_mixed`, red bar = strong contact) - -The p01 reference frame is flagged with `*** p01 REF ***`. - -## Per-side stats - -| side | frames | duration | vmax global (P99) | vmax max | -|---|---|---|---|---| -| left | 1720 | 68.8s | 53.27 | 53.74 | -| right | 1720 | 68.8s | 58.57 | 59.41 | diff --git a/all_latents_2026-05-10__episode_000_visual/README.md b/all_latents_2026-05-10__episode_000_visual/README.md deleted file mode 100644 index df88418ab03113e5f20bdd73d56d1b29d61c5aba..0000000000000000000000000000000000000000 --- a/all_latents_2026-05-10__episode_000_visual/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# All latent frames — 2026-05-10__episode_000.pt - -Video renders every latent frame from non-overlapping raw-16 windows. -3 panels per frame: - -1. **raw RGB** — 128×128 tactile frame (upsampled 2× for viewing) -2. **‖z‖ heatmap GLOBAL vmax** — heatmap normalized to 99th-percentile max across the whole episode; brightness comparable across frames -3. **‖z‖ heatmap PER-FRAME vmax** — heatmap normalized to the current frame's own max; always spans the full colormap → best for spatial pattern - -Caption: `raw / wi / ti / |z|max / vmax_global / contact` (contact = `tactile_{side}_mixed`, red bar = strong contact) - -The p01 reference frame is flagged with `*** p01 REF ***`. - -## Per-side stats - -| side | frames | duration | vmax global (P99) | vmax max | -|---|---|---|---|---| -| left | 1720 | 68.8s | 40.94 | 42.34 | diff --git a/cosmos_debug/README.md b/cosmos_debug/README.md deleted file mode 100644 index 835a9d8106762ea273475408d9a45d88e0c001f2..0000000000000000000000000000000000000000 --- a/cosmos_debug/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# Cosmos Tokenizer CV4x8x8 — diagnostic vs VideoVAE+ - -**Encoder**: strictly left-causal (CausalConv3d + lower-triangular -CausalTemporalAttnBlock). For 16 identical raw frames, all latent frames -must be IDENTICAL up to bf16 numerical noise — hard prediction from -causality. - -**Latent shape** for T=16, H=W=128: (C=16, T_lat=5, 16, 16). -T_lat = (T−1)/4 + 1 (Cosmos convention: first-frame anchor + 4×). - -## Test A — synthetic input positional bias - -| input | min | mean | max | argmax (H, W) | T-var | -|---|---|---|---|---|---| -| gray-0 | 6.555 | 6.963 | 8.236 | (np.int64(0), np.int64(0)) | 1.12e-13 | -| gray-64 | 2.750 | 2.909 | 3.899 | (np.int64(15), np.int64(15)) | 2.22e-15 | -| gray-128 | 2.431 | 2.673 | 2.792 | (np.int64(0), np.int64(0)) | 0 | -| gray-192 | 3.687 | 4.182 | 6.685 | (np.int64(0), np.int64(0)) | 1.33e-14 | -| gray-255 | 7.079 | 7.420 | 7.949 | (np.int64(0), np.int64(0)) | 8.44e-14 | -| noise | 1.126 | 2.345 | 3.882 | (np.int64(15), np.int64(2)) | 2.28e-15 | - -**Compare to VideoVAE+** (from prior run — for gray-192 the argmax was (15,15) -on both base and tactile-finetuned VAEs). Look at whether Cosmos also -concentrates at the (15,15) right-bottom corner or is more uniform. - -## Test C — temporal identity check - -| ref frame | T_lat | per-t max | drift mean | drift max | -|---|---|---|---|---| -| tactile_left | 5 | [5.344841003417969, 5.344841003417969, 5.344841003417969, 5.344841003417969, 5.344841003417969] | 0.0000 | 0.0000 | -| tactile_right | 5 | [5.582459449768066, 5.582459449768066, 5.582459449768066, 5.582459449768066, 5.582459449768066] | 0.0000 | 0.0000 | -| visual_left | 5 | [6.511265754699707, 6.511265754699707, 6.511265754699707, 6.511265754699707, 6.511265754699707] | 0.0000 | 0.0000 | -| visual_middle | 5 | [5.943721771240234, 5.943721771240234, 5.943721771240234, 5.943721771240234, 5.943721771240234] | 0.0000 | 0.0000 | -| visual_right | 5 | [7.360844135284424, 7.360844135284424, 7.360844135284424, 7.360844135284424, 7.360844135284424] | 0.0000 | 0.0000 | - -**Compare to VideoVAE+ (tactile)**: -- left [52.67, 16.73, 10.17, 10.32] — drift mean=1.18 -- right [57.26, 17.09, 10.18, 10.22] — drift mean=1.14 - -**Compare to VideoVAE+ (base + visual_left)**: -- [37.39, 11.21, 7.20, 6.91] — drift mean=1.09 - -**Prediction**: Cosmos drift should be ~1e-2 or smaller (only bf16 noise). -If Cosmos drift is comparable to VideoVAE+'s ~1.0 → same architectural -problem, causality claim is broken. If Cosmos drift is tiny → confirms -causal design works and VideoVAE+ is the wrong tokenizer for us. diff --git a/cosmos_full_episode_000/README.md b/cosmos_full_episode_000/README.md deleted file mode 100644 index 509edaeb3effa41571508042672c817ea466725d..0000000000000000000000000000000000000000 --- a/cosmos_full_episode_000/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Cosmos CV4x8x8 — full-episode viz on `episode_000.pt` - -Two artifacts per stream: - -1. `_all_latents.mp4` — non-overlapping T=16 windows, 3 panels/frame: raw | ‖z‖ GLOBAL vmax | ‖z‖ PER-FRAME vmax -2. `_p01.png` — top-4 high-Δ + bottom-2 low-Δ frames, 5 columns: raw | ref RGB | ‖z_t‖ | ‖z_ref‖ | ‖Δz‖ - -**Cosmos latent shape** per window: `(C=16, T_lat=5, H=16, W=16)`. -T_lat=5 breakdown: ti=0 = image anchor at raw[start], ti=1..4 = 4-frame groups. - -**Reference latent**: for each stream we encode the reference raw frame (repeated 16× to form a static cube) and take ti=0 — since Cosmos ti=0 depends only on raw[0] by strict causality, this is a clean single-frame encoding. - - tactile: `_contact_meta['ref_p01_idx_']` - - visual: raw[0] (start-of-episode) - -## Per-stream stats - -| stream | frames | duration | vmax_global P99 | vmax_all_max | -|---|---|---|---|---| -| visual_left | 2150 | 86.0s | 7.88 | 8.94 | -| visual_middle | 2150 | 86.0s | 8.12 | 9.96 | -| visual_right | 2150 | 86.0s | 8.57 | 11.00 | -| tactile_left | 2150 | 86.0s | 8.97 | 12.18 | -| tactile_right | 2150 | 86.0s | 7.76 | 9.43 | diff --git a/recon_compare_cosmos_vs_vvae/README.md b/recon_compare_cosmos_vs_vvae/README.md deleted file mode 100644 index b16d51091752494db0e85a7d149181110eedc767..0000000000000000000000000000000000000000 --- a/recon_compare_cosmos_vs_vvae/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# Cosmos vs VideoVAE+ reconstruction comparison - -Episode: `episode_000.pt` segment=[1000, 1016) window=T=16 - -One MP4 per stream: `recon_compare_.mp4`. Layout per frame: - - | orig | Cosmos recon | Cosmos |Δ| | VideoVAE+ recon | VideoVAE+ |Δ| | - -## Averaged metrics - -| stream | Cosmos PSNR | Cosmos SSIM | Cosmos L1 | VVAE+ PSNR | VVAE+ SSIM | VVAE+ L1 | -|---|---|---|---|---|---|---| -| visual_left | 30.04 | 0.892 | 4.45 | 32.99 | 0.949 | 3.05 | -| visual_middle | 29.94 | 0.885 | 4.55 | 33.20 | 0.945 | 3.12 | -| visual_right | 28.82 | 0.889 | 5.06 | 32.10 | 0.948 | 3.44 | -| tactile_left | 43.98 | 0.971 | 1.14 | 37.42 | 0.965 | 2.84 | -| tactile_right | 46.68 | 0.983 | 0.85 | 38.83 | 0.979 | 2.43 | - -**Read**: -- Higher PSNR = better (dB, +6 = 2× closer per-pixel error) -- Higher SSIM = better (max 1.0) -- Lower L1 = better (in [0, 255] uint8 units) - -- VideoVAE+ was **finetuned on this exact tactile distribution**; - Cosmos is **zero-shot** on tactile — expect Cosmos < VVAE+ on tactile. -- On visual, both are pretrained on natural video — Cosmos may match - or beat VVAE+ base (which is 4-year-old sd-vae-adjacent architecture). - -**If Cosmos tactile PSNR/SSIM is much worse (>3 dB / >0.1)**: -we should finetune Cosmos on our tactile+visual data before using it -as the latent tokenizer. diff --git a/visual_debug/README.md b/visual_debug/README.md deleted file mode 100644 index 923e30f960babf13c3214e1514c7012109abcf7d..0000000000000000000000000000000000000000 --- a/visual_debug/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# Visual latent bottom-right hotspot debug (BASE VAE) - -Companion to `debug_A/B/C_*` (tactile). Same 3 tests, but: -- VAE: **base** `sota-4-16z.ckpt` (never finetuned on tactile) -- data: **visual_left** / `view_left` from raw - -## Test A per-input stats (channel-L2 heatmap mean over T_lat=4) - -| input | min | mean | max | argmax (H, W) | -|---|---|---|---|---| -| gray-0 | 9.333 | 10.174 | 10.350 | (np.int64(3), np.int64(3)) | -| gray-64 | 2.710 | 3.445 | 21.107 | (np.int64(15), np.int64(15)) | -| gray-128 | 0.951 | 1.690 | 8.774 | (np.int64(11), np.int64(15)) | -| gray-192 | 4.087 | 4.545 | 20.513 | (np.int64(15), np.int64(15)) | -| gray-255 | 9.217 | 10.247 | 11.880 | (np.int64(15), np.int64(15)) | -| noise | 1.893 | 2.157 | 5.164 | (np.int64(15), np.int64(2)) | - -## Comparison to tactile - -See `debug_A_synthetic_encoder_bias.png` (tactile-finetuned VAE) at repo root. -If BASE VAE argmax is at right/bottom for gray-128/192 too → the right-bottom -hotspot is **architectural** (asymmetric pad in `Downsample2plus1D`), -not finetune-specific. - -If BASE VAE Test C shows the same [~5×, ~1.7×, 1, 1] boundary bleed → confirms -the front-only replicate pad + TemporalAttention rel-pos bias mechanism -is baked into the base architecture, not learned by tactile finetune.