"""Independent native export checks using stdlib exact JSON numbers and SHA-256. Copyright 2026 Renchao Wu. Apache-2.0. No inspector/generator import. """ import hashlib,json,math,struct,sys from pathlib import Path root=Path(sys.argv[1]) if len(sys.argv)>1 else Path(__file__).resolve().parent corpus=json.loads((root/'corpus.json').read_text());cases={c['name']:c for c in corpus['cases']} names=['example-'+n for n in ['router-good','router-payload-bitflip','router-truncated','overlap','unknown-dtype','invalid-json']]+['upload-'+n for n in ['metadata-string-map','duplicate-name','header-limit','tensor-limit','large-inventory','long-name','unsafe-integer','leading-json-space','subbyte-misaligned','prototype-key','unaligned-tensor','empty-interior','missing-dtype']]+['filtered-large-inventory'] count=rows=0;hashes={} for name in names: p=root/'native'/(name+'.json');r=json.loads(p.read_text());n=name.removeprefix('example-').removeprefix('upload-').removeprefix('filtered-');c=cases[n];b=(root/'fixtures'/c['file']).read_bytes();end=8+struct.unpack('