{"record":{"id":"be9b4197b76bc044","repo":"sgl-project/sglang","slug":"minimax-h3-video-generation-produced-len-output-p","errorCode":null,"errorMessage":"MiniMax H3 video generation produced {len(output_paths)} output files, expected {expected_outputs}","messagePattern":"MiniMax H3 video generation produced (.+?) output files, expected (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/video_adapter.py","lineNumber":319,"sourceCode":"        queued_frame_count = shape.get(\"frame_count\")\n        if queued_frame_count is not None:\n            fields[\"seconds\"] = _format_video_seconds(\n                int(queued_frame_count) / float(shape[\"fps\"])\n            )\n        quality = getattr(batch.sampling_params, \"quality\", None)\n        explicit_fields = getattr(batch.sampling_params, \"_explicit_fields\", ())\n        if quality and \"quality\" in explicit_fields:\n            fields[\"quality\"] = str(quality)\n        return fields\n\n    def validate_final_outputs_sync(\n        self,\n        output_paths: list[str],\n        batch: Req,\n    ) -> dict[str, str]:\n        expected_outputs = int(getattr(batch, \"num_outputs_per_prompt\", 1))\n        if len(output_paths) != expected_outputs:\n            raise RuntimeError(\n                \"MiniMax H3 video generation produced \"\n                f\"{len(output_paths)} output files, expected {expected_outputs}\"\n            )\n\n        expected_frame_count = None\n        expected_size = None\n        shape = self._resolved_shape(batch)\n        if shape is not None:\n            if shape.get(\"frame_count\") is not None:\n                expected_frame_count = int(shape[\"frame_count\"])\n            if shape.get(\"width\") is not None and shape.get(\"height\") is not None:\n                expected_size = (int(shape[\"width\"]), int(shape[\"height\"]))\n\n        def probe_output(output_path: str) -> dict[str, str]:\n            return _probe_minimax_h3_output_fields(\n                output_path,\n                expected_frame_count=expected_frame_count,\n                expected_size=expected_size,","sourceCodeStart":301,"sourceCodeEnd":337,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/video_adapter.py#L301-L337","documentation":"After MiniMax H3 generation, the adapter validates that the number of produced output files equals batch.num_outputs_per_prompt (the requested N variations per prompt). A mismatch means generation produced fewer/more files than requested — typically a backend/scheduler bug or truncated generation, so it raises RuntimeError.","triggerScenarios":"validate_final_outputs_sync runs with len(output_paths) != num_outputs_per_prompt, e.g. requesting n=4 outputs but only 1 MP4 written, or duplicated files when n=1.","commonSituations":"Multi-sample generation (num_outputs_per_prompt>1) with partial failures; disk-full silently dropping writes; scheduler bugs losing some outputs.","solutions":["Retry the request; check scheduler logs for per-output failures","Verify output_path directory is writable and not full","Set num_outputs_per_prompt=1 to isolate whether multi-output handling is the issue","Report as a bug if reproducible with a single output request"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"expected = int(getattr(batch, \"num_outputs_per_prompt\", 1))\nassert expected >= 1  # sanity before submitting","typeGuard":null,"tryCatchPattern":"try:\n    result = adapter.validate_final_outputs_sync(paths, batch)\nexcept RuntimeError as e:\n    if \"expected\" in str(e):\n        paths = regenerate_with_retry(prompt, n=expected)\n    else:\n        raise","preventionTips":["Check len of returned output files against n immediately after generation","Retry transient count mismatches once before escalating"],"tags":["minimax-h3","output-count","validation","video-generation"],"backgroundTag":"output-count-mismatch","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}