{"record":{"id":"2fc5a9acad257f5c","repo":"sgl-project/sglang","slug":"minimax-h3-latent-preparation-requires-pre-queue-r","errorCode":null,"errorMessage":"MiniMax H3 latent preparation requires pre-queue resolved_v2 geometry, got {geometry!r}","messagePattern":"MiniMax H3 latent preparation requires pre-queue resolved_v2 geometry, got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/stages/latent_preparation.py","lineNumber":80,"sourceCode":"        batch.audio_latents = audio_rows\n        batch.raw_latent_shape = (1, 24, latent_t, latent_h, latent_w)\n        batch.raw_audio_latent_shape = (2, 32, audio_t)\n\n    def _prepare_denoise_state_from_plan(self, batch: Req, plan) -> None:\n        \"\"\"Direct initial-noise materialization (t2va recipe):\n        torch.Generator().manual_seed(seed); video rows drawn first,\n        then audio rows, CPU fp32. Every task consumes the final latent grid\n        frozen by the pre-queue shape resolver.\"\"\"\n        from sglang.multimodal_gen.runtime.pipelines_core.stages.model_specific_stages.minimax_h3.constants import (\n            MINIMAX_H3_DENOISE_STATE_EXTRA_KEY,\n        )\n\n        if MINIMAX_H3_DENOISE_STATE_EXTRA_KEY in batch.extra:\n            return\n        shape = plan.shape\n        geometry = str(shape[\"geometry\"])\n        if geometry != \"resolved_v2\":\n            raise ValueError(\n                \"MiniMax H3 latent preparation requires pre-queue resolved_v2 \"\n                f\"geometry, got {geometry!r}\"\n            )\n        latent_h = int(shape[\"height\"]) // 16\n        latent_w = int(shape[\"width\"]) // 16\n        if shape.get(\"video_latent_t\") is None or shape.get(\"audio_latent_t\") is None:\n            raise ValueError(\n                \"MiniMax H3 latent preparation requires pre-queue resolved \"\n                \"temporal dimensions\"\n            )\n        latent_t = int(shape[\"video_latent_t\"])\n        audio_t = int(shape[\"audio_latent_t\"])\n\n        seed = plan.seed\n        if seed is None:\n            seed = 42  # pinned default seed\n        video_rows_n = latent_t * (latent_h // 2) * (latent_w // 2)\n        audio_rows_n = audio_t * 2","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/stages/latent_preparation.py#L62-L98","documentation":"When the denoise state is not already present, the stage builds it from the request's resolved plan and requires plan.shape['geometry'] == 'resolved_v2' — the geometry string produced by the pre-queue resolution stage. Any other value (e.g. 'raw', 'resolved', or None coerced to string) is rejected because latent dimension math assumes the v2 resolution contract.","triggerScenarios":"_prepare_denoise_state_from_plan executes with plan.shape['geometry'] set to anything other than 'resolved_v2', or the geometry key missing (str(None) == 'None'), because the pre-queue resolution stage was skipped or an older resolver version wrote a different tag.","commonSituations":"Running the pipeline without the geometry-resolution pre-queue stage, using a stale/cached resolved plan from an older format, or feeding a raw un-resolved request directly into the model stages.","solutions":["Run the request through the pre-queue geometry resolution stage so plan.shape['geometry'] becomes 'resolved_v2' before latent preparation","Discard cached plans produced by older resolver versions and re-resolve","Verify height/width and latent_t fields are populated by the same resolver (v2 contract)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if str(plan.shape.get(\"geometry\")) != \"resolved_v2\":\n    plan = resolve_plan_through_prequeue(plan)  # run geometry resolution first","typeGuard":"def plan_is_resolved_v2(plan) -> bool:\n    return str(plan.shape.get(\"geometry\", \"\")) == \"resolved_v2\"","tryCatchPattern":null,"preventionTips":["Always run the pre-queue resolution stage before MiniMax H3 model stages","Invalidate cached plans after upgrading the resolver"],"tags":["minimax-h3","geometry","plan-validation","pipeline"],"backgroundTag":"schema-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}