"""Independent finite construction checks. Standard library only; no model training. Run: python this_file.py. Stdout contains the two figure datasets. """ import json, math from itertools import product, combinations from fractions import Fraction as F figures=[] qs=[.5,.6,.7,.8,.9,1];tv=[];means=[] for q in qs: v=(abs((1-q)-.5)+abs(q-.5))/2;assert math.isclose(v,q-.5,abs_tol=1e-12);tv.append(v);means.append(2*q-1) figures.append(dict(id="support-versus-marginal",x=qs,series=[dict(name="Total variation",y=tv),dict(name="Mean",y=means),dict(name="Nearest-support distance",y=[0]*6)])) k=[1,2,4,8,16];work=[8*i for i in k];full=[20+w for w in work] assert full==[28,36,52,84,148] and 3600000/(full[-1]-full[0])==30000 def constant_map(x,t):return 1.0 pairs=[(-2.,0.,-1.,1.),(-1.,0.,-.5,1.),(.5,0.,1.,1.),(1.,0.,2.,1.)] pair_loss=sum((constant_map(x,t)-constant_map(y,u))**2 for x,t,y,u in pairs)/len(pairs) endpoint_targets=[-1.,1.];endpoint_errors=[(constant_map(x,0)-x)**2 for x in endpoint_targets] assert pair_loss==0 and sum(endpoint_errors)/2==2 and endpoint_errors[0]==4 # This rejects the incomplete-constraint inference; it is not the full consistency objective. figures.append(dict(id="fixed-overhead-cost",x=k,series=[dict(name="Sampler work",y=work),dict(name="Full pipeline",y=full)])) assert len(figures)==2 print(json.dumps({"status":"PASS","scope":"Constructed analytic examples only; not neural training, a benchmark, or measured hardware performance.","figures":figures},indent=2))