{"record":{"id":"e769bc6ab6516095","repo":"sgl-project/sglang","slug":"path-short-edge-must-be-positive-got-short-edg","errorCode":null,"errorMessage":"{path}.short_edge must be positive, got {short_edge}","messagePattern":"(.+?)\\.short_edge 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/request_validation.py","lineNumber":89,"sourceCode":"        return None\n    if isinstance(value, bool) or not isinstance(value, (int, float)):\n        raise ValueError(f\"{path} must be a number\")\n    normalized = float(value)\n    if not math.isfinite(normalized) or normalized < 0.0:\n        raise ValueError(f\"{path} must be a non-negative finite number\")\n    return normalized\n\n\ndef _validate_target(target: Any, *, profile: MiniMaxH3TaskProfile) -> dict[str, Any]:\n    path = \"target\"\n    if not isinstance(target, Mapping):\n        raise ValueError(f\"{path} is required and must be an object\")\n    # The canonical target has a deliberately small projection.  Transport\n    # compatibility keys are ignored; only these three declared values are\n    # validated and emitted below.\n    short_edge = _require_int(target.get(\"short_edge\"), f\"{path}.short_edge\")\n    if short_edge <= 0:\n        raise ValueError(f\"{path}.short_edge must be positive, got {short_edge}\")\n    if short_edge != MINIMAX_H3_RECOMMENDED_SHORT_EDGE:\n        # Same guard the resolver applies. Without it the recommended value warns\n        # that it is \"outside the verified configuration\", naming itself as the\n        # verified one.\n        warn_unverified_short_edge(short_edge)\n    aspect_ratio = _require_str(target.get(\"aspect_ratio\"), f\"{path}.aspect_ratio\")\n    if profile.aspect_ratio_forced_auto and aspect_ratio != \"auto\":\n        raise ValueError(\n            f'{path}.aspect_ratio must be \"auto\" for task {profile.task!r}, '\n            f\"got {aspect_ratio!r}\"\n        )\n    has_duration = target.get(\"duration_seconds\") is not None\n    if (\n        profile.task in {MINIMAX_H3_TASK_T2VA, MINIMAX_H3_TASK_REF2VA}\n        and aspect_ratio != \"auto\"\n        and aspect_ratio not in MINIMAX_H3_FINITE_ASPECT_RATIOS\n    ):\n        raise ValueError(","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/request_validation.py#L71-L107","documentation":"Raised by the MiniMax-H3 canonical request validator when target.short_edge is an integer <= 0. short_edge controls the shorter output dimension and must be a positive int; the recommended value is MINIMAX_H3_RECOMMENDED_SHORT_EDGE, which also suppresses an 'unverified configuration' warning.","triggerScenarios":"Calling minimax_h3_validate_canonical_request with a target dict where short_edge is 0 or negative (e.g. copied from a placeholder or computed from a subtraction that underflowed).","commonSituations":"Defaulting short_edge to 0 in a config template; computing it as height - crop where crop > height; passing a bool (False == 0) after _require_int accepted it via bool-int equivalence.","solutions":["Set short_edge to MINIMAX_H3_RECOMMENDED_SHORT_EDGE (the verified default)","Ensure any computed short_edge is clamped to >= 1 before submission","Audit config templates for 0/None placeholders that reach the validator"],"exampleFix":"// before\n{\"target\": {\"short_edge\": 0, \"aspect_ratio\": \"auto\"}}\n// after\n{\"target\": {\"short_edge\": 768, \"aspect_ratio\": \"auto\"}}","handlingStrategy":"validation","validationCode":"if not isinstance(target['short_edge'], int) or target['short_edge'] <= 0:\n    raise ValueError('short_edge must be a positive integer')","typeGuard":"def is_valid_short_edge(v) -> bool:\n    return isinstance(v, int) and not isinstance(v, bool) and v > 0","tryCatchPattern":null,"preventionTips":["Default short_edge to MINIMAX_H3_RECOMMENDED_SHORT_EDGE","Clamp computed dimensions to >= 1"],"tags":["minimax-h3","validation","request","short-edge"],"backgroundTag":"schema-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}