scalingX's picture
Add cell-response-bench: 30 computational virtual-cell benchmarks (byte-frozen real VCC 2025 data; truth recomputed by verifier) (part 2)
c0567cd verified
Raw History Blame Contribute Delete
961 Bytes
# Standard-library SHA-256 integrity check for the provided real VCC files.
import hashlib, os, sys
def sha256_file(path):
h = hashlib.sha256()
with open(path, 'rb') as fh:
for chunk in iter(lambda: fh.read(1 << 20), b''):
h.update(chunk)
return h.hexdigest()
def main():
base = sys.argv[1] if len(sys.argv) > 1 else 'data'
sums = os.path.join(base, 'SHA256SUMS')
bad = 0
with open(sums) as fh:
for line in fh:
parts = line.split()
if len(parts) != 2:
continue
want, name = parts
got = sha256_file(os.path.join(base, name))
if got != want:
print('CHECKSUM MISMATCH ' + name)
bad += 1
else:
print('OK ' + name + ' ' + got[:12])
if bad:
print('DATA INTEGRITY FAILED')
sys.exit(1)
print('ALL CHECKSUMS OK')
if __name__ == '__main__':
main()