"""Independent exact early-exit fixture and ideal lockstep calculation. Standard library only; no neural training, timing or benchmark data. """ import json,math conf=[.99,.98,.95,.9,.85,.8,.75,.7,.6,.55] early=[1,1,0,1,1,0,1,0,0,1];deep=[1,1,1,1,0,1,1,1,0,1] thresholds=[.5,.7,.8,.9,.96,1.01];cost=[];accuracy=[];exits=[] for t in thresholds: chosen=[a if c>=t else b for c,a,b in zip(conf,early,deep)] cost.append(sum(1 if c>=t else 5 for c in conf)/10) accuracy.append(sum(chosen)/10);exits.append(sum(c>=t for c in conf)) assert exits==[10,8,6,4,2,0]and accuracy==[.6,.6,.7,.7,.8,.8]and cost==[1,1.8,2.6,3.4,4.2,5] assert any(a>b for a,b in zip(early,deep))and any(a