{"record":{"id":"40c7864babe83b7d","repo":"sgl-project/sglang","slug":"strict-fl2va-packed-layout-requires-keyframe-frame","errorCode":null,"errorMessage":"strict fl2va packed layout requires keyframe_frame_indices","messagePattern":"strict fl2va packed layout requires keyframe_frame_indices","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/packed_sequence.py","lineNumber":50,"sourceCode":"_FRAME_PER_TOKEN = (1, 4, 4, 4, 4)\n_FRAME_RESCALE = 5.0 / 3.0\n_PATCH_H = 2\n_PATCH_W = 2\n\n\ndef _keyframe_cond_frame_indices(\n    *,\n    include_keyframe_cond: bool,\n    keyframe_frame_indices: list[int] | tuple[int, ...] | None,\n) -> list[int]:\n    if not include_keyframe_cond:\n        if keyframe_frame_indices is not None:\n            raise ValueError(\n                \"keyframe_frame_indices must be omitted when keyframe cond is not included\"\n            )\n        return []\n    if keyframe_frame_indices is None:\n        raise ValueError(\"strict fl2va packed layout requires keyframe_frame_indices\")\n    if any(\n        isinstance(value, bool) or not isinstance(value, int)\n        for value in keyframe_frame_indices\n    ):\n        raise ValueError(\n            \"strict fl2va packed layout requires integer keyframe_frame_indices\"\n        )\n    out = list(keyframe_frame_indices)\n    if tuple(out) not in MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES:\n        raise ValueError(\n            \"strict fl2va packed layout requires keyframe_frame_indices in \"\n            f\"{MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES!r}, got {out!r}\"\n        )\n    return out\n\n\ndef _resolve_keyframe_frame_indices(\n    frame_indices: Sequence[int],","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/packed_sequence.py#L32-L68","documentation":"include_keyframe_cond=True but keyframe_frame_indices was None. The strict fl2va packed layout cannot be built without explicit keyframe frame positions.","triggerScenarios":"Calling minimax_h3_packed_sequence(..., include_keyframe_cond=True) without providing keyframe_frame_indices.","commonSituations":"Enabling keyframe conditioning in config while forgetting to set the frame indices; default None field passed through.","solutions":["Provide keyframe_frame_indices matching the enabled keyframes (e.g. [0] or [0, N-1])","Or disable include_keyframe_cond if conditioning is not needed","Validate both options together at config load time"],"exampleFix":"# before\nseq = minimax_h3_packed_sequence(..., include_keyframe_cond=True, keyframe_frame_indices=None)\n# after\nseq = minimax_h3_packed_sequence(..., include_keyframe_cond=True, keyframe_frame_indices=[0])","handlingStrategy":"validation","validationCode":"if include_keyframe_cond:\n    assert keyframe_frame_indices is not None, 'indices required'","typeGuard":null,"tryCatchPattern":"except ValueError as e: supply indices or disable keyframe cond","preventionTips":["Treat include flag and indices as one config unit"],"tags":["missing-parameter","minimax-h3","packed-sequence"],"backgroundTag":"missing-required-parameter","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}