{"record":{"id":"5f440ea5e271ab4c","repo":"sgl-project/sglang","slug":"video-reference-requires-block-token-counts-and-ti","errorCode":null,"errorMessage":"video reference requires block token counts and timestamps","messagePattern":"video reference requires block token counts and timestamps","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/presentation.py","lineNumber":277,"sourceCode":"        raise ValueError(\"video block token counts and timestamps must align\")\n    image_seen = 0\n    video_seen = 0\n    for cond_type, ordinal in condition_labels:\n        if cond_type == \"image\":\n            image_seen += 1\n            if image_seen > len(image_token_counts):\n                raise ValueError(\"image_token_count required for an image reference\")\n            count = int(image_token_counts[image_seen - 1])\n            if count <= 0:\n                raise ValueError(\"image_token_count required for an image reference\")\n            presentation.text(_text_ids(tokenizer, f\"<Picture {ordinal}>: \"))\n            presentation.vision(_vision_block_ids(tokenizer, IMAGE_PAD, count))\n        elif cond_type == \"audio\":\n            presentation.text(_text_ids(tokenizer, f\"<Audio {ordinal}>: \"))\n        elif cond_type == \"video\":\n            video_seen += 1\n            if video_seen > len(video_counts_by_ref):\n                raise ValueError(\n                    \"video reference requires block token counts and timestamps\"\n                )\n            counts = video_counts_by_ref[video_seen - 1]\n            timestamps = video_timestamps_by_ref[video_seen - 1]\n            if not counts or not timestamps:\n                raise ValueError(\n                    \"video reference requires block token counts and timestamps\"\n                )\n            presentation.text(_text_ids(tokenizer, f\"<Video {ordinal}>: \"))\n            _timestamped_video_blocks(\n                presentation,\n                tokenizer,\n                counts=counts,\n                timestamps=timestamps,\n                context=\"\",\n                video_token_id=video_token_id,\n            )\n        else:","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/presentation.py#L259-L295","documentation":"A video reference appears in condition_labels but there are fewer normalized video_block_token_counts groups than video references — no per-block data exists for this video.","triggerScenarios":"condition_labels=[(\"video\",1),(\"video\",2)] but video_block_token_counts=[[196]] (only one group).","commonSituations":"Single-video convenience form (flat list) used with a multi-video plan; forgetting per-video groups when the plan has several videos.","solutions":["Provide one counts group per video reference: [[...],[...]]","Trim extra video references from condition_labels","Regenerate conditioning data from the current plan"],"exampleFix":"// before\ncondition_labels=[(\"video\",1),(\"video\",2)], video_block_token_counts=[196]\n// after\ncondition_labels=[(\"video\",1),(\"video\",2)], video_block_token_counts=[[196],[196]]","handlingStrategy":"validation","validationCode":"n_videos = sum(1 for t, _ in condition_labels if t == \"video\")\nassert len(video_counts_by_ref) >= n_videos","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provide one counts group per video reference","Use nested form for multi-video plans"],"tags":["minimax-h3","ref2va","video-presentation","alignment"],"backgroundTag":"length-mismatch-validation","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}