{"record":{"id":"71be2e9126ae1adb","repo":"sgl-project/sglang","slug":"kimi-expert-pack-sha-256-does-not-match-manifest","errorCode":null,"errorMessage":"Kimi expert-pack SHA-256 does not match manifest","messagePattern":"Kimi expert-pack SHA-256 does not match manifest","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"critical","filePath":"python/sglang/srt/layers/moe/expert_pack.py","lineNumber":898,"sourceCode":"                    quant_scheme=str(roles[physical_role][\"dtype\"]),\n                    transform_id=\"identity-v1\",\n                    block_size=256,\n                    generation=generation,\n                )\n\n        if previous_end != self.path.stat().st_size:\n            raise ValueError(\"Kimi expert-pack file has trailing or missing bytes\")\n        actual_index_sha256 = index_digest.hexdigest()\n        if actual_index_sha256 != pack_manifest[\"index_sha256\"]:\n            raise ValueError(\"Kimi expert-pack index SHA-256 does not match manifest\")\n        if verify_pack_sha256:\n            expected_sha256 = pack_manifest.get(\"sha256\")\n            if not expected_sha256:\n                raise ValueError(\n                    \"full pack verification requested, but manifest has no full SHA-256\"\n                )\n            if _sha256_file(self.path) != expected_sha256:\n                raise ValueError(\"Kimi expert-pack SHA-256 does not match manifest\")\n\n        self.header = ExpertPackHeader(\n            flags=REQUIRED_FLAGS,\n            index_count=expected_entry_count,\n            data_start=int(pack_manifest[\"data_start\"]),\n            alignment=int(pack_manifest[\"alignment\"]),\n            num_layers=expected_layers,\n            num_experts=expected_experts,\n            top_k=expected_top_k,\n            role_count=len(ROLE_NAMES),\n            model_identity_sha256=\"0\" * 64,\n            source_blob_sha256=str(self.manifest[\"source\"][\"inventory_sha256\"]),\n            config_sha256=str(model[\"config_sha256\"]),\n        )\n        self.active_moe_layer_ids = frozenset(active_layers)\n        self.role_offsets = role_offsets\n        self.role_nbytes = role_nbytes\n        self.role_bytes = role_nbytes[\"gate\"]","sourceCodeStart":880,"sourceCodeEnd":916,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/moe/expert_pack.py#L880-L916","documentation":"Full-file SHA-256 (_sha256_file over the whole pack) does not match manifest.expert_pack.sha256 when verify_pack_sha256 is enabled. The file content differs from the recorded digest — corruption, partial download, or wrong revision.","triggerScenarios":"verify_pack_sha256=True with a truncated/re-downgraded/modified pack, or a sha256 recorded for a different file version.","commonSituations":"See trigger scenarios.","solutions":["Re-download the pack from the original source and re-verify the digest","If the pack was legitimately regenerated, recompute and update manifest sha256","Use sha256sum locally to compare before retrying the load"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import hashlib\nsha = hashlib.sha256(open(pack_path,'rb').read()).hexdigest()\nassert sha == manifest['expert_pack']['sha256'], 'pack file digest mismatch'","typeGuard":null,"tryCatchPattern":"try:\n    pack = KimiExpertPack(path, manifest, verify_pack_sha256=True)\nexcept ValueError as e:\n    if 'SHA-256 does not match' in str(e):\n        log.error('corrupt or wrong-revision pack; re-download')\n    raise","preventionTips":["Always sha256-verify downloads of large weight files"],"tags":["kimi","moe","expert-pack","sha256","integrity"],"backgroundTag":"checksum-mismatch","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}