{
  "chapter": "02-video-data-and-optical-flow",
  "milestone_artifact": "kinesis v0.2",
  "gpu_environment": {
    "gpu_name": "NVIDIA L4",
    "total_vram_mib": 22563.1,
    "compute_capability": "8.9",
    "python": "3.13.16",
    "torch": "2.14.1+cu130",
    "torchvision": "0.29.1+cu130",
    "cuda": "13.0",
    "diffusers": "0.36.0",
    "transformers": "4.57.6",
    "peft": "0.18.1"
  },
  "exp_01_scene_cut_and_safe_crop": {
    "raw_stream_sha256_prefix": "ae8f241837e51058",
    "ground_truth": {
      "hard_cut_frame": 45,
      "dissolve_frame_span": [
        90,
        101
      ],
      "clean_shot_intervals": [
        [
          0,
          45
        ],
        [
          45,
          90
        ],
        [
          102,
          160
        ]
      ],
      "clean_spatial_box_y0_y1_x0_x1": [
        28,
        256,
        0,
        512
      ]
    },
    "transition_detection": {
      "naive_single_step_cuts": [
        45
      ],
      "naive_leaked_dissolve_frames": 20,
      "dual_window_hard_cuts": [
        45
      ],
      "dual_window_detected_dissolve_span": [
        90,
        109
      ],
      "extracted_clean_segments": [
        [
          0,
          45
        ],
        [
          45,
          90
        ],
        [
          110,
          160
        ]
      ],
      "hard_cut_delta1_peak": 0.4884,
      "dissolve_per_frame_delta1_mean": 0.0253
    },
    "safe_region_cropping": {
      "raw_hw": [
        320,
        512
      ],
      "detected_letterbox_stripped_y": [
        28,
        292
      ],
      "safe_crop_box_y0_y1_x0_x1": [
        28,
        256,
        0,
        512
      ],
      "cropped_hw": [
        228,
        512
      ],
      "residual_black_bar_rows": 0
    }
  },
  "exp_02_raft_optical_flow_filtering": {
    "candidate_pool_sha256_prefix": "439c8c9305ec2864",
    "num_candidates": 12,
    "raft_model": "torchvision.models.optical_flow.raft_small (DEFAULT pretrained)",
    "thresholds": {
      "min_flow_px": 1.2,
      "max_flow_px": 14.5,
      "max_jerk_ratio": 0.9
    },
    "naive_pixel_diff_accuracy_pct": 33.33,
    "raft_motion_gate_accuracy_pct": 100.0,
    "summary_by_archetype": {
      "static_ppt_slide": {
        "count": 3,
        "mean_pixel_l1_diff": 0.0005,
        "mean_raft_flow_px": 0.104,
        "mean_jerk_ratio": 0.003,
        "naive_accepted": 0,
        "raft_accepted": 0
      },
      "curated_cinematic_motion": {
        "count": 3,
        "mean_pixel_l1_diff": 0.022,
        "mean_raft_flow_px": 3.505,
        "mean_jerk_ratio": 0.014,
        "naive_accepted": 1,
        "raft_accepted": 3
      },
      "handheld_jelly_shake": {
        "count": 3,
        "mean_pixel_l1_diff": 0.1476,
        "mean_raft_flow_px": 45.748,
        "mean_jerk_ratio": 2.017,
        "naive_accepted": 3,
        "raft_accepted": 0
      },
      "strobe_luma_flicker_trap": {
        "count": 3,
        "mean_pixel_l1_diff": 0.1299,
        "mean_raft_flow_px": 0.124,
        "mean_jerk_ratio": 0.5,
        "naive_accepted": 3,
        "raft_accepted": 0
      }
    },
    "per_clip_audit": [
      {
        "clip_id": "clip_00_static_ppt_slide_0",
        "archetype": "static_ppt_slide",
        "ground_truth_keep": false,
        "pixel_l1_diff": 0.0005,
        "naive_pixel_gate_keep": false,
        "raft_mean_flow_px": 0.104,
        "raft_p95_flow_px": 0.197,
        "raft_temporal_jerk_ratio": 0.003,
        "raft_gate_keep": false
      },
      {
        "clip_id": "clip_01_static_ppt_slide_1",
        "archetype": "static_ppt_slide",
        "ground_truth_keep": false,
        "pixel_l1_diff": 0.0005,
        "naive_pixel_gate_keep": false,
        "raft_mean_flow_px": 0.104,
        "raft_p95_flow_px": 0.197,
        "raft_temporal_jerk_ratio": 0.003,
        "raft_gate_keep": false
      },
      {
        "clip_id": "clip_02_static_ppt_slide_2",
        "archetype": "static_ppt_slide",
        "ground_truth_keep": false,
        "pixel_l1_diff": 0.0005,
        "naive_pixel_gate_keep": false,
        "raft_mean_flow_px": 0.104,
        "raft_p95_flow_px": 0.197,
        "raft_temporal_jerk_ratio": 0.003,
        "raft_gate_keep": false
      },
      {
        "clip_id": "clip_03_curated_cinematic_motion_0",
        "archetype": "curated_cinematic_motion",
        "ground_truth_keep": true,
        "pixel_l1_diff": 0.0172,
        "naive_pixel_gate_keep": false,
        "raft_mean_flow_px": 2.718,
        "raft_p95_flow_px": 2.931,
        "raft_temporal_jerk_ratio": 0.014,
        "raft_gate_keep": true
      },
      {
        "clip_id": "clip_04_curated_cinematic_motion_1",
        "archetype": "curated_cinematic_motion",
        "ground_truth_keep": true,
        "pixel_l1_diff": 0.022,
        "naive_pixel_gate_keep": false,
        "raft_mean_flow_px": 3.515,
        "raft_p95_flow_px": 3.757,
        "raft_temporal_jerk_ratio": 0.014,
        "raft_gate_keep": true
      },
      {
        "clip_id": "clip_05_curated_cinematic_motion_2",
        "archetype": "curated_cinematic_motion",
        "ground_truth_keep": true,
        "pixel_l1_diff": 0.0267,
        "naive_pixel_gate_keep": true,
        "raft_mean_flow_px": 4.282,
        "raft_p95_flow_px": 4.531,
        "raft_temporal_jerk_ratio": 0.013,
        "raft_gate_keep": true
      },
      {
        "clip_id": "clip_06_handheld_jelly_shake_0",
        "archetype": "handheld_jelly_shake",
        "ground_truth_keep": false,
        "pixel_l1_diff": 0.1331,
        "naive_pixel_gate_keep": true,
        "raft_mean_flow_px": 35.718,
        "raft_p95_flow_px": 45.853,
        "raft_temporal_jerk_ratio": 2.021,
        "raft_gate_keep": false
      },
      {
        "clip_id": "clip_07_handheld_jelly_shake_1",
        "archetype": "handheld_jelly_shake",
        "ground_truth_keep": false,
        "pixel_l1_diff": 0.1508,
        "naive_pixel_gate_keep": true,
        "raft_mean_flow_px": 45.729,
        "raft_p95_flow_px": 56.062,
        "raft_temporal_jerk_ratio": 2.017,
        "raft_gate_keep": false
      },
      {
        "clip_id": "clip_08_handheld_jelly_shake_2",
        "archetype": "handheld_jelly_shake",
        "ground_truth_keep": false,
        "pixel_l1_diff": 0.1588,
        "naive_pixel_gate_keep": true,
        "raft_mean_flow_px": 55.798,
        "raft_p95_flow_px": 66.175,
        "raft_temporal_jerk_ratio": 2.014,
        "raft_gate_keep": false
      },
      {
        "clip_id": "clip_09_strobe_luma_flicker_trap_0",
        "archetype": "strobe_luma_flicker_trap",
        "ground_truth_keep": false,
        "pixel_l1_diff": 0.1099,
        "naive_pixel_gate_keep": true,
        "raft_mean_flow_px": 0.119,
        "raft_p95_flow_px": 0.252,
        "raft_temporal_jerk_ratio": 0.494,
        "raft_gate_keep": false
      },
      {
        "clip_id": "clip_10_strobe_luma_flicker_trap_1",
        "archetype": "strobe_luma_flicker_trap",
        "ground_truth_keep": false,
        "pixel_l1_diff": 0.1299,
        "naive_pixel_gate_keep": true,
        "raft_mean_flow_px": 0.123,
        "raft_p95_flow_px": 0.264,
        "raft_temporal_jerk_ratio": 0.49,
        "raft_gate_keep": false
      },
      {
        "clip_id": "clip_11_strobe_luma_flicker_trap_2",
        "archetype": "strobe_luma_flicker_trap",
        "ground_truth_keep": false,
        "pixel_l1_diff": 0.1499,
        "naive_pixel_gate_keep": true,
        "raft_mean_flow_px": 0.129,
        "raft_p95_flow_px": 0.278,
        "raft_temporal_jerk_ratio": 0.516,
        "raft_gate_keep": false
      }
    ]
  },
  "exp_03_qwen25_vl_temporal_captioning": {
    "vlm_repo": "Qwen/Qwen2.5-VL-7B-Instruct",
    "sampled_keyframes_per_clip": 6,
    "second_per_grid_ts": [
      1.0
    ],
    "json_schema_pass_rate_pct": 100.0,
    "single_frame_motion_direction_recall_pct": 0.0,
    "six_frame_motion_direction_recall_pct": 100.0,
    "avg_multiframe_caption_latency_ms": 5455.4,
    "peak_vram_mib": 16021.4,
    "caption_samples": [
      {
        "clip_id": "red_sphere_center_to_right",
        "single_frame_caption": {
          "subject_appearance": "A red circle is centered on a black rectangle.",
          "temporal_action": "unknown from single static image",
          "camera_motion": "static"
        },
        "multi_frame_temporal_caption": {
          "subject_appearance": "Two red circles",
          "temporal_action": "The two red circles move from left to right.",
          "camera_motion": "static",
          "start_to_end_position": "[179, 150, 263, 234] -> [280, 180, 324, 224]"
        },
        "single_frame_direction_hit": false,
        "multi_frame_direction_hit": true
      },
      {
        "clip_id": "yellow_square_center_to_top",
        "single_frame_caption": {
          "subject_appearance": "A small yellow square is centered on a black background.",
          "temporal_action": "unknown from single static image",
          "camera_motion": "static"
        },
        "multi_frame_temporal_caption": {
          "subject_appearance": "A small yellow square",
          "temporal_action": "The yellow square moves upwards.",
          "camera_motion": "No camera motion detected.",
          "start_to_end_position": "{'start': [203, 154], 'end': [203, 156]}"
        },
        "single_frame_direction_hit": false,
        "multi_frame_direction_hit": true
      },
      {
        "clip_id": "magenta_ball_center_to_bottom",
        "single_frame_caption": {
          "subject_appearance": "A small pink circle is centered on a black rectangular background.",
          "temporal_action": "unknown from single static image",
          "camera_motion": "static"
        },
        "multi_frame_temporal_caption": {
          "subject_appearance": "Two overlapping circles, one pink and one purple, positioned near the center of the screen.",
          "temporal_action": "The two circles move downward together.",
          "camera_motion": "static",
          "start_to_end_position": "[[205, 148], [205, 236]]"
        },
        "single_frame_direction_hit": false,
        "multi_frame_direction_hit": true
      }
    ]
  },
  "exp_04_safetensors_bucket_cache_audit": {
    "spatiotemporal_bucket_routing_examples": [
      {
        "raw_thw": [
          22,
          540,
          960
        ],
        "bucket_thw": [
          17,
          480,
          832
        ],
        "latent_thw": [
          5,
          60,
          104
        ],
        "dit_tokens": 7800
      },
      {
        "raw_thw": [
          38,
          720,
          720
        ],
        "bucket_thw": [
          33,
          624,
          624
        ],
        "latent_thw": [
          9,
          78,
          78
        ],
        "dit_tokens": 13689
      },
      {
        "raw_thw": [
          55,
          1080,
          1920
        ],
        "bucket_thw": [
          49,
          480,
          832
        ],
        "latent_thw": [
          13,
          60,
          104
        ],
        "dit_tokens": 20280
      },
      {
        "raw_thw": [
          86,
          1280,
          720
        ],
        "bucket_thw": [
          81,
          832,
          480
        ],
        "latent_thw": [
          21,
          104,
          60
        ],
        "dit_tokens": 32760
      }
    ],
    "safetensors_bucket_shards": [
      {
        "bucket_thw": [
          17,
          480,
          832
        ],
        "latent_shape": [
          16,
          5,
          60,
          104
        ],
        "raw_bf16_video_mib": 38.85,
        "cached_safetensors_mib": 2.72,
        "offline_preencode_ms": 2719.2,
        "roundtrip_max_abs_err": 0.0
      },
      {
        "bucket_thw": [
          49,
          480,
          832
        ],
        "latent_shape": [
          16,
          13,
          60,
          104
        ],
        "raw_bf16_video_mib": 111.97,
        "cached_safetensors_mib": 4.24,
        "offline_preencode_ms": 7274.1,
        "roundtrip_max_abs_err": 0.0
      },
      {
        "bucket_thw": [
          81,
          480,
          832
        ],
        "latent_shape": [
          16,
          21,
          60,
          104
        ],
        "raw_bf16_video_mib": 185.1,
        "cached_safetensors_mib": 5.76,
        "offline_preencode_ms": 12127.6,
        "roundtrip_max_abs_err": 0.0
      }
    ],
    "online_umt5_vae_dit_49x480x832": {
      "status": "OK",
      "peak_vram_mib": 18512.1,
      "step_ms": 22903.1
    },
    "offline_cached_dit_49x480x832": {
      "status": "OK",
      "peak_vram_mib": 7320.5,
      "step_ms": 15512.8
    },
    "training_vram_reduction_pct": 60.46,
    "training_step_speedup_x": 1.48
  }
}
