{"record":{"id":"7c8b71f3cdd780df","repo":"sgl-project/sglang","slug":"seed-must-not-exceed-the-signed-int64-maximum-got","errorCode":null,"errorMessage":"seed must not exceed the signed int64 maximum, got {normalized_seed}","messagePattern":"seed must not exceed the signed int64 maximum, 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":376,"sourceCode":"        \"conditions\": normalized_conditions,\n        \"target\": normalized_target,\n    }\n    normalized_flow_shift = _optional_positive_finite_float(flow_shift, \"flow_shift\")\n    normalized_audio_flow_shift = _optional_positive_finite_float(\n        audio_flow_shift, \"audio_flow_shift\"\n    )\n    if normalized_flow_shift is not None:\n        canonical[\"flow_shift\"] = normalized_flow_shift\n    if normalized_audio_flow_shift is not None:\n        canonical[\"audio_flow_shift\"] = normalized_audio_flow_shift\n    if seed is not None:\n        normalized_seed = _require_int(seed, \"seed\")\n        if normalized_seed < 0:\n            raise ValueError(f\"seed must be non-negative, got {normalized_seed}\")\n        if normalized_seed > MINIMAX_H3_MAX_SIGNED_SEED:\n            raise ValueError(\n                f\"seed must not exceed the signed int64 maximum, got {normalized_seed}\"\n            )\n        canonical[\"seed\"] = normalized_seed\n    return canonical\n\n\n__all__ = [\n    \"MINIMAX_H3_REQUEST_SCHEMA\",\n    \"MINIMAX_H3_MAX_SIGNED_SEED\",\n    \"MINIMAX_H3_SUPPORTED_FPS\",\n    \"minimax_h3_validate_canonical_request\",\n]\n","sourceCodeStart":358,"sourceCodeEnd":387,"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#L358-L387","documentation":"The `seed` field must fit in a signed 64-bit integer because it is forwarded to the sampling backend as int64. Values above MINIMAX_H3_MAX_SIGNED_SEED (2**63 - 1) are rejected before they could overflow downstream.","triggerScenarios":"Calling minimax_h3_validate_canonical_request with seed greater than 9223372036854775807, e.g. a 128-bit UUID-derived integer or a Python arbitrary-precision random value.","commonSituations":"Deriving seeds from cryptographic hashes/UUIDs without masking; using random.getrandbits(128) as a seed.","solutions":["Mask or modulo the seed into [0, 2**63-1], e.g. seed % (2**63)","Use seeds from random.getrandbits(63) or smaller"],"exampleFix":"# before\nseed = int(uuid.uuid4().int)\n# after\nseed = uuid.uuid4().int % (2**63 - 1)","handlingStrategy":"validation","validationCode":"def clamp_seed(seed): return None if seed is None else seed % (2**63 - 1)","typeGuard":"def is_valid_seed(v) -> bool: return v is None or (type(v) is int and 0 <= v <= 2**63 - 1)","tryCatchPattern":"null","preventionTips":["Mask hash-derived seeds with % (2**63 - 1)"],"tags":["minimax-h3","seed","int64-overflow","validation"],"backgroundTag":"integer-overflow","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}