{"record":{"id":"6235dbe9fdf50fea","repo":"sgl-project/sglang","slug":"target-aspect-ratio-must-be-integer-w-h-got-va","errorCode":null,"errorMessage":"target.aspect_ratio must be integer 'W:H', got {value!r}","messagePattern":"target\\.aspect_ratio must be integer 'W:H', got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/resolved_plan.py","lineNumber":86,"sourceCode":"    materials: tuple[MiniMaxH3MaterialPlanItem, ...]\n    encoders: dict\n    branches: tuple[dict, ...]\n    default_flow_shift: float\n    default_audio_flow_shift: float\n    flow_shift: float | None\n    audio_flow_shift: float | None\n    shape: dict\n    condition_mask: dict\n\n\ndef _parse_aspect_ratio(value: str) -> tuple[int, int]:\n    parts = value.split(\":\")\n    if len(parts) != 2:\n        raise ValueError(f\"target.aspect_ratio must be 'W:H' or 'auto', got {value!r}\")\n    try:\n        w, h = int(parts[0]), int(parts[1])\n    except ValueError as exc:\n        raise ValueError(\n            f\"target.aspect_ratio must be integer 'W:H', got {value!r}\"\n        ) from exc\n    if w <= 0 or h <= 0:\n        raise ValueError(\n            f\"target.aspect_ratio components must be positive, got {value!r}\"\n        )\n    return w, h\n\n\ndef _nearest_multiple(value: float, multiple: int) -> int:\n    return max(multiple, int(round(float(value) / multiple)) * multiple)\n\n\ndef _validate_base_short_edge(value: Any) -> int:\n    try:\n        short_edge = int(value)\n    except (TypeError, ValueError) as exc:\n        raise ValueError(","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/resolved_plan.py#L68-L104","documentation":"After splitting target.aspect_ratio on ':', both components must parse as integers. This error fires when int() raises — i.e. either side is non-numeric like '16:9.5', 'a:b', or '16:'.","triggerScenarios":"Calling minimax_h3_resolve_plan with target.aspect_ratio containing a float, empty component, or non-numeric text on either side of the colon.","commonSituations":"Supplying '1.91:1' (common cinematic notation) instead of an integer pair; trailing whitespace or empty component after a typo'd colon.","solutions":["Use integer components: '191:100' instead of '1.91:1'","Validate the string with a regex like ^\\d+:\\d+$ before submitting"],"exampleFix":"// before\n\"aspect_ratio\":\"1.91:1\"\n// after\n\"aspect_ratio\":\"191:100\"","handlingStrategy":"validation","validationCode":"import re\ndef ratio_ok(v): return isinstance(v, str) and re.fullmatch(r\"\\d+:\\d+\", v) is not None","typeGuard":"def is_int_ratio(v) -> bool:\n    import re\n    return isinstance(v, str) and bool(re.fullmatch(r\"-?\\d+:-?\\d+\", v))","tryCatchPattern":"null","preventionTips":["Expand decimals to integer pairs ('1.91:1' -> '191:100')"],"tags":["minimax-h3","aspect-ratio","integer-parse","resolved-plan"],"backgroundTag":"invalid-format-string","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}