{"record":{"id":"cb23717cff252fba","repo":"sgl-project/sglang","slug":"keyframe-denoising-requires-semantic-frame-indices","errorCode":null,"errorMessage":"keyframe denoising requires semantic_frame_indices in {MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES!r}, got {semantic_indices!r}","messagePattern":"keyframe denoising requires semantic_frame_indices in (.+?), got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/stages/denoising.py","lineNumber":99,"sourceCode":"    \"\"\"Reject stale/middle/reordered keyframe payloads at the DiT sink.\"\"\"\n\n    task = None if plan is None else str(plan.task)\n    if task not in {\"fl2va\", \"ref2va\"}:\n        if keyframe is not None:\n            raise ValueError(\n                \"keyframe condition rows require plan.task='fl2va' or 'ref2va'\"\n            )\n        return\n    if keyframe is None:\n        if task == \"fl2va\":\n            raise ValueError(\"fl2va denoising requires encoded keyframe condition rows\")\n        return\n    if not isinstance(keyframe, Mapping):\n        raise ValueError(\"encoded keyframe condition rows must be a mapping\")\n\n    semantic_indices = tuple(keyframe.get(\"semantic_frame_indices\") or ())\n    if semantic_indices not in MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES:\n        raise ValueError(\n            \"keyframe denoising requires semantic_frame_indices in \"\n            f\"{MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES!r}, \"\n            f\"got {semantic_indices!r}\"\n        )\n    frame_count = keyframe.get(\"frame_count\")\n    if isinstance(frame_count, bool) or not isinstance(frame_count, int):\n        raise ValueError(\"keyframe payload requires an integer frame_count\")\n    if frame_count <= 1:\n        raise ValueError(\"keyframe payload frame_count must be greater than one\")\n    pixel_indices = keyframe.get(\"pixel_frame_indices\")\n    expected_pixel_indices = [\n        frame_count - 1 if index == -1 else index for index in semantic_indices\n    ]\n    if pixel_indices != expected_pixel_indices:\n        raise ValueError(\n            \"keyframe denoising requires pixel_frame_indices resolved from the \"\n            \"semantic anchors, \"\n            f\"got {pixel_indices!r} for frame_count={frame_count}\"","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/stages/denoising.py#L81-L117","documentation":"keyframe['semantic_frame_indices'] (after tuple coercion of a possibly-empty value) must be one of MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES — (0,), (-1,), or (0, -1). Anything else, including empty, raises this ValueError.","triggerScenarios":"An empty semantic_frame_indices list, or values like (1,), (0, 1), or (-1, 0) in the encoded keyframe payload.","commonSituations":"Producer stages emitting raw request indices without normalizing; ordering swapped between semantic and pixel index lists; partial payloads where the indices field is absent (defaults to empty).","solutions":["Normalize semantic_frame_indices to (0,), (-1,), or (0, -1)","Ensure the field is present and populated (its absence coerces to () which fails)","Keep semantic (0/-1) indices separate from resolved pixel indices"],"exampleFix":"# before\npayload[\"semantic_frame_indices\"] = [0, frame_count - 1]\n# after\npayload[\"semantic_frame_indices\"] = [0, -1]  # semantic anchors only","handlingStrategy":"validation","validationCode":"assert tuple(kf.get(\"semantic_frame_indices\") or ()) in MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES","typeGuard":"def valid_semantic_indices(vals) -> bool:\n    return tuple(vals or ()) in MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES","tryCatchPattern":null,"preventionTips":["Never put absolute frame numbers in semantic_frame_indices","Distinguish semantic anchors from resolved pixel indices"],"tags":["minimax-h3","keyframe","signature-validation"],"backgroundTag":"enum-value-invalid","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}