from fractions import Fraction as Q def run(load,check): regular=[e for e in load('C01_RESULTS.json')['events'] if e['tradition']=='MT' and e['role'].startswith('Flood')] cumulative=[e for e in load('C266_ENDPOINTS.json') if e['profile']=='MT_ON' and e['source_role']=='Flood'] check('held fields six and eight',len(regular)==6 and len(cumulative)==8) rows=[];hits=[] for e in regular: B=e['BC_Nisan'];rgap=8464-B-6 for c in cumulative: C=c['source_BC_base'];cgap=12696-C-1406;res=cgap-rgap row={'regular':e,'cumulative_index':c['source_index'],'cumulative_BC':C,'regular_gap':rgap,'cumulative_gap':cgap,'residual':res} rows.append(row) if res==0:hits.append(row) check('affine compatibility over all48',all(r['residual']==2832-(r['cumulative_BC']-r['regular']['BC_Nisan']) for r in rows)) check('four exact members',sorted((h['cumulative_index'],h['regular_gap']) for h in hits)==[(4,5998),(5,5999),(6,6000),(7,6001)]) check('6000 normalGear2start',len([h for h in hits if h['regular_gap']==6000 and h['regular']['gear']==2 and h['regular']['role']=='Flood start'])==1) for h in hits: for e in [Q(-1,4),Q(1,4)]:check(f'phase gap j{h["cumulative_index"]} {e}',(-h['regular']['BC_Nisan']+e+8464)-(6+e)==(-h['cumulative_BC']+e+12696)-(1406+e)) check('bridge and anchor difference',12696-8464-(1406-6)==2832) return {'all48_comparisons':rows,'matches':hits,'regular_register':regular,'cumulative_field':cumulative,'condition':'C-B=2832=8K-1400','regular_missing_cumulative_requirements':[{'regular':e,'required_C':e['BC_Nisan']+2832} for e in regular if e['gear']==1],'anchor_roles':'Q6 andQ1406 are reflected AD anchors, not literal BC endpoints.'}