{"record":{"id":"f50af1ec641c0393","repo":"sgl-project/sglang","slug":"aligned-video-noise-shape-list-video-noise-shape","errorCode":null,"errorMessage":"aligned video noise shape {list(video_noise.shape)} != [{video_rows_n}, 96]","messagePattern":"aligned video noise shape (.+?) != \\[(.+?), 96\\]","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"critical","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/stages/latent_preparation.py","lineNumber":130,"sourceCode":"        gen_v = torch.Generator().manual_seed(int(seed))\n        video_tensor = torch.randn(\n            1,\n            24,\n            latent_t,\n            latent_h,\n            latent_w,\n            generator=gen_v,\n            dtype=torch.float32,\n        )\n        video_noise = minimax_h3_patchify_video_latent(\n            video_tensor, patch_size=[1, 2, 2]\n        ).to(torch.float32)\n        gen_a = torch.Generator().manual_seed(int(seed))\n        audio_noise = torch.randn(\n            audio_rows_n, 32, generator=gen_a, dtype=torch.float32\n        )\n        if list(video_noise.shape) != [video_rows_n, 96]:\n            raise ValueError(\n                f\"aligned video noise shape {list(video_noise.shape)} != \"\n                f\"[{video_rows_n}, 96]\"\n            )\n        batch.extra[MINIMAX_H3_DENOISE_STATE_EXTRA_KEY] = {\n            \"initial_video_rows\": video_noise,\n            \"initial_audio_rows\": audio_noise,\n            \"latent_t\": latent_t,\n            \"latent_h\": latent_h,\n            \"latent_w\": latent_w,\n            \"audio_t\": audio_t,\n        }\n\n    def verify_input(self, batch: Req, server_args: ServerArgs) -> VerificationResult:\n        result = VerificationResult()\n        result.add_check(\n            \"prompt_or_embeds\",\n            None,\n            lambda _: V.string_or_list_strings(batch.prompt)","sourceCodeStart":112,"sourceCodeEnd":148,"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#L112-L148","documentation":"The stage generates aligned video noise internally and asserts its shape equals [video_rows_n, 96] (96 latent channels). A mismatch means the noise-producing code path returned an unexpected layout — almost always a bug or version skew inside the noise generation helper, not user input.","triggerScenarios":"_prepare_denoise_state_from_plan computes video_noise whose list(shape) != [video_rows_n, 96], e.g. an older noise generator emitting a different channel count, or video_rows_n derived inconsistently from latent_t/latent_h/latent_w.","commonSituations":"Mixing versions of the minimax_h3 stage module and its noise-generation helper, monkey-patched noise code, or an upstream refactor that changed the latent channel dimension.","solutions":["Ensure the noise generation helper used by this stage matches its expected [rows, 96] contract (update the module/package to a consistent version)","Verify video_rows_n is computed from the same latent_t*latent_h*latent_w formula the noise generator uses","Report as an internal invariant break if versions are consistent"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    stage.forward(batch)\nexcept ValueError as e:\n    if \"aligned video noise shape\" in str(e):\n        raise RuntimeError(\"noise generator / stage version skew; realign packages\") from e\n    raise","preventionTips":["Pin sglang to one consistent version across all minimax_h3 modules","Never monkey-patch the noise generation helper"],"tags":["minimax-h3","noise-generation","internal-invariant"],"backgroundTag":"internal-invariant-violation","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}