from fractions import Fraction as F def run(load,check): old=load('PREVIOUS_DATA.json');data=load('C286_DATA.json');reg=data['target_register'];keys=['tradition','gear','Cainan','Terah60','full430'];rows=[];comparisons=0 for i in range(8): p,q,f,n=-6350+i,-5750+i,2643+i,3243+i sp=[r for r in data['source_pairs'] if r['Shem_Cainan']==r['Flood_Cainan']==1 and r['Shem_index']==r['Flood_index']==i] check(f'i{i} nativeONsourcepair',len(sp)==1 and sp[0]['S']==p and sp[0]['F']==q) nh=[];fh=[] for r in reg: comparisons+=2 if r['role']=='Noah birth' and r['center']==n:nh.append(r) if r['role'] in ['Flood start','Flood close'] and r['center']==f:fh.append(r) pairs=[] for N in nh: for B in fh: if any(N[k]!=B[k] for k in keys):continue check(f'i{i} pair600',N['center']-B['center']==600) before=old['rows'][i];oldsp=[z for z in before['matched_context_rectangles'] if z['Noah']['tradition']=='SP'];check(f'i{i} uniqueSPantecedent',len(oldsp)==1);os=oldsp[0] check(f'i{i} typed460',os['Noah']['gear']==N['gear'] and os['Flood']['role']==B['role'] and os['Noah']['center']-N['center']==os['Flood']['center']-B['center']==460 and before['p']-p==before['q']-q==460) check(f'i{i} restoredMTcontext',N['tradition']=='MT' and N['Cainan']==1 and N['Terah60']==1 and N['full430']==1 and N.get('rail') is None and B['role']=='Flood start' and os['Noah']['rail']=='primary') comps=[] for e in [F(-1,4),F(1,4)]: v=[F(z)+e for z in [p,q,f,n]];check(f'i{i} {e} exactONrectangle',v[2]-v[0]==v[3]-v[1]==8993 and v[1]-v[0]==v[3]-v[2]==600) check(f'i{i} {e} fourcornercovariance',all(F(z)+e-vv==460 for z,vv in zip([before['p'],before['q'],os['Flood']['center'],os['Noah']['center']],v))) comps.append([str(z) for z in v]) pairs.append({'Noah':N,'Flood':B,'SP_OFF_antecedent':os,'components':comps}) rows.append({'i':i,'p':p,'q':q,'f_required':f,'n_required':n,'Noah_point_records':nh,'Flood_point_records':fh,'matched_context_rectangles':pairs,'OFF_SP_companion_at_i':any(z['Noah']['tradition']=='SP' and z['Noah']['rail']=='companion' for z in old['rows'][i]['matched_context_rectangles'])}) counts={'point_record_comparisons':comparisons,'Noah_point_labels':sum(len(r['Noah_point_records']) for r in rows),'Flood_point_labels':sum(len(r['Flood_point_records']) for r in rows),'context_rectangles':sum(len(r['matched_context_rectangles']) for r in rows),'coordinate_rectangles':sum(bool(r['matched_context_rectangles']) for r in rows),'Flood_only_rows':sum(bool(r['Flood_point_records']) and not r['Noah_point_records'] for r in rows)} check('full register census',comparisons==8448) check('nativeONcompleteindices',[r['i'] for r in rows if r['matched_context_rectangles']]==[3,5,7]) check('sixFloodthreeNoah',counts['Flood_point_labels']==6 and counts['Noah_point_labels']==3 and counts['context_rectangles']==3) return {'step':'C321','rows':rows,'counts':counts,'typed_shift':{'cumulative':'OFF→nativeON:−460','regular':'SP_OFF/T0→sameGearMT_ON/T60:−650+130+60=−460','full430':True},'phase_covariance':'sameoffset retained, no dilation','complete_biography_extension_tested':False,'interpretation':'Three primaryNoah/Flood rectangles transport; three companionNoah counterparts are absent. This is a qualified source-state correspondence, not a universal operator.'}