{"record":{"id":"45c489ec14c28eb9","repo":"sgl-project/sglang","slug":"path-kind-unsupported-for-ref2va-kind-r","errorCode":null,"errorMessage":"{path}.kind unsupported for ref2va: {kind!r}","messagePattern":"(.+?)\\.kind unsupported for ref2va: (.+?)","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":354,"sourceCode":"            vh = _positive_int(raw, \"latent_h\", path)\n            vw = _positive_int(raw, \"latent_w\", path)\n            frame_rows = (vh // _PATCH_H) * (vw // _PATCH_W)\n            audio_rows = rt * audio_channel\n            video_rows = vt * frame_rows\n            item = {\n                \"kind\": kind,\n                \"ref_audio_t\": rt,\n                \"latent_t\": vt,\n                \"latent_h\": vh,\n                \"latent_w\": vw,\n                \"frame_rows\": frame_rows,\n                \"audio_rows\": audio_rows,\n                \"video_rows\": video_rows,\n            }\n            ref_audio_rows += audio_rows\n            ref_visual_rows += video_rows\n        else:\n            raise ValueError(f\"{path}.kind unsupported for ref2va: {kind!r}\")\n        parsed.append(item)\n\n    ph, pw = latent_h // _PATCH_H, latent_w // _PATCH_W\n    frame_rows = ph * pw\n    keyframe_indices = _keyframe_cond_frame_indices(\n        include_keyframe_cond=keyframe_frame_indices is not None,\n        keyframe_frame_indices=keyframe_frame_indices,\n    )\n    resolved_keyframe_indices = _resolve_keyframe_frame_indices(\n        keyframe_indices,\n        frame_count=frame_count,\n    )\n    keyframe_rows = len(keyframe_indices) * frame_rows\n    video_rows = latent_t * frame_rows\n    audio_rows = audio_t * audio_channel\n    ref_rows = ref_visual_rows + ref_audio_rows\n    used = text_len + keyframe_rows + ref_rows + audio_rows + video_rows\n    if seq_len is None:","sourceCodeStart":336,"sourceCodeEnd":372,"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#L336-L372","documentation":"After extracting a valid kind string from a ref_blocks entry, the ref2va builder only supports 'image', 'audio', and 'video' kinds; any other non-empty kind hits the unsupported-kind branch. This guards the layout arithmetic which is specialized per media type, so unknown kinds cannot be silently ignored.","triggerScenarios":"Calling minimax_h3_packed_sequence_ref2va_blocks with a ref_blocks entry whose 'kind'/'type' is e.g. 'text', 'Image' (capitalized), 'img', or a future media type not handled by this builder.","commonSituations":"Case or spelling drift between producer and consumer ('Image' vs 'image', 'vid' vs 'video'); adding a new media modality to the pipeline without extending the packer; copy-pasting blocks from a different model's stage that supports more kinds.","solutions":["Normalize the kind to one of image/audio/video exactly (lowercase).","If you genuinely need a new kind, extend the dispatch in minimax_h3_packed_sequence_ref2va_blocks in packed_sequence.py.","Whitelist-validate ref_blocks kinds upstream (e.g. in _branch) so unsupported kinds are rejected with context earlier."],"exampleFix":"# before\nref_blocks = [{\"kind\": \"Image\", \"latent_h\": 32, \"latent_w\": 32}]\n\n# after\nref_blocks = [{\"kind\": \"image\", \"latent_h\": 32, \"latent_w\": 32}]","handlingStrategy":"type-guard","validationCode":"ALLOWED_REF2VA_KINDS = {\"image\", \"audio\", \"video\"}\nassert all(b.get(\"kind\", b.get(\"type\")) in ALLOWED_REF2VA_KINDS for b in ref_blocks)","typeGuard":"def has_supported_ref2va_kind(raw: Mapping) -> bool:\n    return raw.get(\"kind\", raw.get(\"type\")) in {\"image\", \"audio\", \"video\"}","tryCatchPattern":null,"preventionTips":["Normalize kind to lowercase at ingestion time.","Extend the packer dispatch in the same PR that adds any new media kind, with tests."],"tags":["validation","enum","multimodal","minimax-h3"],"backgroundTag":"unsupported-value-rejected","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}