from fractions import Fraction as F def run(load,check): reg=load('C286_DATA.json')['target_register'];E=F(25,23);ratio=F(300,299);rows=[] for x in load('C340_DATA.json')['rows']: rec=x['records'];n,m,r,h=(rec[k]['center'] for k in ['N','M','R','H']);g=rec['N']['gear'];sg=rec['H']['gear'];sp=[z for z in reg if z['tradition']=='SP' and z['role']=='Shem birth' and z['gear']==sg and z['rail']==x['rail'] and z['Cainan']==z['Terah60']==0 and z['full430']==1];check(str(x['i'])+x['binding']+' SP Shem',len(sp)==1);s=sp[0]['center'];im=n+E*(m-n);ir=n+E*(r-n);full=im==s and ir==h;primary=x['rail']=='primary' and x['Shem_mode_sigma']==0 tag=str(x['i'])+x['binding'];check(tag+' affine interval width',im-ir==E*(m-r));check(tag+' source image predicate',full==primary) if primary:check(tag+' two valid outputs',E*(m-r)==650 and ratio*(m-r)==600 and ratio/E==F(12,13)) rows.append({'i':x['i'],'binding':x['binding'],'rail':x['rail'],'N':rec['N'],'M':rec['M'],'R':rec['R'],'SP_Shem':sp[0],'MT_base_Shem':rec['H'],'E_image_M':str(im),'E_image_R':str(ir),'image_gap':str(im-ir),'actual_Shem_gap':s-h,'both_images_source_matched':full}) check('two matched image pairs',sum(x['both_images_source_matched'] for x in rows)==2) return {'step':'C346','rows':rows,'ratio_identity':'(300/299)/(25/23)=12/13','new12_over13_operator_adopted':False,'dependency':'M→SP Shem is inherited fromC325;R→baseMT Shem fromC338. Joint650 interval reading is their consequence;C01 already retained598/650 scalar and source gains.'}