{"record":{"id":"e1f62073e2d0523e","repo":"sgl-project/sglang","slug":"target-aspect-ratio-components-must-be-positive-g","errorCode":null,"errorMessage":"target.aspect_ratio components must be positive, got {value!r}","messagePattern":"target\\.aspect_ratio components must be positive, 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":90,"sourceCode":"    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(\n            f\"target.short_edge must be an integer, got {value!r}\"\n        ) from exc\n    if short_edge != value or short_edge <= 0:\n        raise ValueError(f\"target.short_edge must be a positive integer, got {value!r}\")","sourceCodeStart":72,"sourceCodeEnd":108,"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#L72-L108","documentation":"Both integer components of target.aspect_ratio must be strictly positive. A parseable pair like '0:9' or '-16:9' fails this check because a zero/negative dimension is meaningless.","triggerScenarios":"Calling minimax_h3_resolve_plan with target.aspect_ratio such as '0:9', '-1:1', or computed values where one side evaluates to 0.","commonSituations":"Aspect ratio computed from a zero width/height upstream (e.g. failed probe defaults to 0) and rendered as '0:0'.","solutions":["Fix the upstream computation so neither component is zero/negative","Guard with a fallback like '1:1' when computed ratios are degenerate"],"exampleFix":"# before\naspect = f\"{w}:{h}\"  # w==0\n# after\naspect = f\"{w or 1}:{h or 1}\"","handlingStrategy":"validation","validationCode":"def parts_positive(v):\n    try: w, h = v.split(\":\"); return int(w) > 0 and int(h) > 0\n    except Exception: return False","typeGuard":"def is_positive_ratio(v) -> bool:\n    try:\n        w, h = v.split(\":\"); return int(w) > 0 and int(h) > 0\n    except Exception:\n        return False","tryCatchPattern":"null","preventionTips":["Guard zero-dimension probes before formatting the ratio"],"tags":["minimax-h3","aspect-ratio","positive-validation","resolved-plan"],"backgroundTag":"invalid-parameter-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}