from collections import Counter def run(load,check): reg=load('C286_DATA.json')['target_register'];by={} for i,r in enumerate(reg):by.setdefault(r['center'],[]).append(i) cs=set(by);arrows={(e['input'],e['output']) for e in load('C410_DATA.json')['source_edges']};rows=[];rolecounts=Counter() for upper in sorted(cs): lower=upper-1058 if lower not in cs:continue levels=[] for n in [0,1,2]: u,v=upper-500*n,lower-500*n;ui=by.get(u,[]);vi=by.get(v,[]);levels.append({'translation_steps':n,'upper':u,'lower':v,'upper_record_indices':ui,'lower_record_indices':vi,'both_endpoints_sourced':bool(ui and vi)}) check('width retained '+str((upper,n)),u-v==1058) one=levels[1]['both_endpoints_sourced'];two=one and levels[2]['both_endpoints_sourced'] check('first pair domain agrees with C410 '+str(upper),one==((upper,upper-500) in arrows and (lower,lower-500) in arrows)) if two:check('second pair domain agrees with C410 '+str(upper),(upper-500,upper-1000) in arrows and (lower-500,lower-1000) in arrows) for i in by[upper]: for j in by[lower]:rolecounts[reg[i]['role'],reg[j]['role']]+=1 rows.append({'upper':upper,'lower':lower,'levels':levels,'original_labelled_endpoint_pairs':len(by[upper])*len(by[lower]),'one_step_source_pair':one,'two_step_source_pair':two}) mirrors=[] for r in load('C287_DATA.json')['rows']: if r['i'] not in [3,5]:continue p=next(p for p in rows if p['upper']==r['Noah_required'] and p['lower']==r['R']);levels=[] for level in p['levels']: n=level['translation_steps'];levels.append({'steps':n,'both_regular_endpoints_sourced':level['both_endpoints_sourced'],'cross_spans':[level['lower']-r['S'],level['upper']-r['F']]}) check('fixed cumulative corner drift '+str((r['i'],n)),levels[-1]['cross_spans']==[8993-500*n]*2) mirrors.append({'i':r['i'],'cumulative_corners':[r['S'],r['F']],'pair':p['levels'][0],'transport_levels':levels}) return {'step':'C414','source_pairs':rows,'role_pair_counts':[{'upper_role':a,'lower_role':z,'labelled_pairs':n} for (a,z),n in sorted(rolecounts.items())],'original_Mirror_comparisons':mirrors,'counts':{'source_coordinates':len(cs),'coordinate_2K_pairs':len(rows),'labelled_2K_endpoint_pairs':sum(r['original_labelled_endpoint_pairs'] for r in rows),'one_step_source_pairs':sum(r['one_step_source_pair'] for r in rows),'two_step_source_pairs':sum(r['two_step_source_pair'] for r in rows)},'interpretation':'Pair membership is a coordinate census with every source label retained. It does not yet choose continuous record-labelled transport paths. Every simultaneous translation preserves1058 arithmetically; source-domain survival and fixed cumulative cross-spans are separate tests. No other intervals or shifts were searched.'}