{"record":{"id":"ae585b46826f5c2e","repo":"sgl-project/sglang","slug":"unused-video-block-token-count-entries","errorCode":null,"errorMessage":"unused video block token count entries","messagePattern":"unused video block token count entries","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":300,"sourceCode":"            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:\n            raise ValueError(f\"unsupported ref2va condition type {cond_type!r}\")\n    if image_seen != len(image_token_counts):\n        raise ValueError(\"unused image_token_count entries\")\n    if video_seen != len(video_counts_by_ref):\n        raise ValueError(\"unused video block token count entries\")\n    presentation.text(_text_ids(tokenizer, prompt))\n    return presentation.build(return_video_mask=return_video_mask)\n\n\n__all__ = [\n    \"minimax_h3_multi_image_presentation\",\n    \"minimax_h3_ref2va_presentation\",\n    \"minimax_h3_ref2va_video_presentation\",\n    \"minimax_h3_text_only_ids\",\n]\n","sourceCodeStart":282,"sourceCodeEnd":311,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/presentation.py#L282-L311","documentation":"Same trailing-consistency check as 2297 for videos: more video_block_token_counts groups were supplied than there are video references in condition_labels.","triggerScenarios":"video_block_token_counts=[[196],[196]] but condition_labels contains only one (\"video\", N) entry.","commonSituations":"Removing a video from the plan without removing its counts group; building counts for all segments while the plan references a subset.","solutions":["Remove unused counts (and their timestamps) groups","Add the missing video reference to condition_labels","Derive both from the same conditioning record"],"exampleFix":"// before\nvideo_block_token_counts=[[196],[196]], one video ref in plan\n// after\nvideo_block_token_counts=[[196]], one video ref in plan","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":["Keep counts/timestamps groups 1:1 with video references","Rebuild conditioning data after plan changes"],"tags":["minimax-h3","ref2va","alignment"],"backgroundTag":"length-mismatch-validation","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}