{"record":{"id":"ffc916ed0cd1571c","repo":"sgl-project/sglang","slug":"kimi-expert-pack-index-sha-256-does-not-match-mani","errorCode":null,"errorMessage":"Kimi expert-pack index SHA-256 does not match manifest","messagePattern":"Kimi expert-pack index SHA-256 does not match manifest","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"critical","filePath":"python/sglang/srt/layers/moe/expert_pack.py","lineNumber":890,"sourceCode":"                    dtype=str(roles[physical_role][\"dtype\"]),\n                    tensor_name=name,\n                    source_slice_offset=0,\n                    source_slice_nbytes=nbytes,\n                    pack_offset=offset,\n                    pack_nbytes=nbytes,\n                    checksum=\"\",\n                    shape=logical_shape,\n                    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),","sourceCodeStart":872,"sourceCodeEnd":908,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/moe/expert_pack.py#L872-L908","documentation":"The SHA-256 computed incrementally over the header plus every index entry does not match manifest.expert_pack.index_sha256. The index bytes on disk differ from what the manifest recorded — the file or manifest was modified/corrupted.","triggerScenarios":"Any bit-level change in header or index region: partial write, disk corruption, byte-level patching of entry fields, or a manifest from a different pack revision.","commonSituations":"See trigger scenarios.","solutions":["Verify and re-download/rebuild the pack so index bytes match the manifest","Regenerate the manifest after any legitimate repack (index_sha256 must be recomputed)","Never hand-edit pack bytes or manifest hashes"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import hashlib\nh = hashlib.sha256()\n# for quick pre-check, verify the full-file sha256 first if available\nif 'sha256' in manifest['expert_pack']:\n    assert _sha256_file(pack_path) == manifest['expert_pack']['sha256']","typeGuard":null,"tryCatchPattern":"try:\n    pack = KimiExpertPack(path, manifest)\nexcept ValueError as e:\n    if 'index SHA-256' in str(e):\n        log.error('pack index corrupted; re-download from source')\n    raise","preventionTips":["Run sha256sum on downloads before loading","Treat any hash mismatch as corruption, never patch the manifest"],"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"}