from research import *
s=begin(786,'Verify rounding on the complete Terah triangle','Does the distinction between the Terah lifts survive rounding?',{},['C779–780; Q5 rule'])
f=json.loads((ROOT/'model/Terah_triangle.json').read_text());q=lambda n:5*((n+2)//5)
out={k:{'rounded_b':q(x['b']),'rounded_r':q(x['r']),'rounded_L':q(x['L']),'K':q(x['b'])+q(x['r'])-q(x['L'])} for k,x in f.items()}
finish(s,{'rounded_states':out},'Rounding fixes every component in the Terah triangle. It preserves the distinction between a repartition and a lifespan change, so rounding cannot justify conflating their cumulative effects.','Recover cumulative divergence on the SP/LXX aligned birth suffix.',{'all_fixed':all(out[k]['rounded_b']==x['b'] and out[k]['rounded_r']==x['r'] and out[k]['rounded_L']==x['L'] for k,x in f.items()),'no_defect':all(x['K']==0 for x in out.values())})
