from fractions import Fraction as Q def run(load,check): reg=load('C286_DATA.json')['target_register'];ks=['tradition','rail','Cainan','Terah60','full430'];births=[r for r in reg if r['role']=='Shem birth'];deaths=[r for r in reg if r['role']=='Shem death'] def fam(r):return tuple(r.get(k) for k in ks) fs=sorted({fam(r) for r in births},key=str);B={(fam(r),r['gear']):r for r in births};D={(fam(r),r['gear']):r for r in deaths};trials=[];hits=[] check('complete three Gear Shem families',len(fs)==32 and len(B)==len(D)==96 and all((f,g) in B and (f,g) in D for f in fs for g in [1,2,3])) for fi,f in enumerate(fs): for ni,n in enumerate(fs): for g in [1,2]: lo,hi,V,A=B[f,g],B[f,g+1],B[n,g],D[f,g+1];x,y=hi['center'],lo['center'];ep=Q(25,23)*(x-V['center'])==y-V['center'];jp=Q(300,299)*(y-A['center'])==x-A['center'];ok=ep and jp trials.append({'moving_family':fi,'held_family':ni,'lower_Gear':g,'E_pass':ep,'J_pass':jp,'loop':ok}) if ok: p=y-69*(x-y);ps=[r for r in reg if r['center']==p] hits.append({'moving_family':dict(zip(ks,f)),'held_family':dict(zip(ks,n)),'lower_Gear':g,'records':{'lower_Shem':lo,'higher_Shem':hi,'held_Shem':V,'J_Shem_death':A},'coordinate_loop':[V['center'],x,y,A['center']],'unique_P_pivot':p,'P_pivot_records':ps}) expected=load('C405_DATA.json')['loop_translations'] def signature(r):return(tuple(sorted(r['lower_Shem'].items())),tuple(sorted(r['higher_Shem'].items())),tuple(sorted(r['held_Shem'].items())),tuple(sorted(r['J_Shem_death'].items()))) expected_records=[{'lower_Shem':h['Shem_records']['lower_Noah'],'higher_Shem':h['Shem_records']['higher_Noah'],'held_Shem':h['Shem_records']['held_Noah'],'J_Shem_death':h['Shem_records']['J_Flood']} for h in expected] check('complete labelled match to independent500 proposal',{signature(h['records']) for h in hits}=={signature(r) for r in expected_records} and len(hits)==12) loops=sorted({tuple(h['coordinate_loop']) for h in hits});complete=[h for h in hits if h['P_pivot_records']] check('six coordinate and two complete loops',len(loops)==6 and len(complete)==2 and [list(t) for t in loops]==load('C405_DATA.json')['coordinate_Shem_loops']) for i,h in enumerate(hits): f,n=h['moving_family'],h['held_family'];V,x,y,A=h['coordinate_loop'] check('fixed source loop geometry '+str(i),x-y==2 and V-y==25 and V-x==23 and x-A==600 and y-A==598) check('variant displacement '+str(i),f['Cainan']==f['Terah60']==1 and f['full430']==0 and n['Cainan']==n['Terah60']==0 and n['full430']==1) check('all next death J comparisons pass',all(t['J_pass'] for t in trials)) return {'step':'C406','families':[dict(zip(ks,f)) for f in fs],'trials':trials,'hits':hits,'coordinate_loops':[list(t) for t in loops],'counts':{'moving_families':32,'held_families':32,'adjacent_Gear_transitions':2,'labelled_trials':len(trials),'labelled_E_J_loops':len(hits),'coordinate_E_J_loops':len(loops),'complete_labelled_E_P_J_loops':len(complete),'loops_outside_C405_correspondence':0},'source_equivalence':'Within this fixed Shem-birth/next-Shem-death grammar, the entire direct census equals the−500 image of the C396 Noah/Flood-boundary census. J follows from the source600 lifespan and Gear increment2; E requires held-minus-lower25=215−130−60.','interpretation':'No500 or529 filter was used in enumeration. The match remains conditional on the declared roles, same-family adjacency and held-Shem same-lower-Gear requirement; it is not a census of every conceivable source graph.'}