fix cost curve: x-axis starts at left edge (normalize log scale from minT to maxT)
Browse files522 unmodified lines523524525526527528529522 unmodified linesconst maxT=Math.max(...data.map(d=>d.T)),us=data.map(d=>d.us_per_token),ce=data.map(d=>d.cells),maxU=Math.max(...us)*1.25,maxC=Math.max(...ce)*1.15,maxA=Math.max(...data.map(d=>d.flops_attention_equiv));const X=t=>P+(Math.log(t)/Math.log(maxT))*(W-P-16),Y=u=>H-30-(u/maxU)*(H-56),Y2=v=>H-30-(v/maxC)*(H-56),YA=v=>H-30-(v/maxA)*(H-56);x.fillStyle="#fff";x.fillRect(0,0,W,H);x.strokeStyle="#eceef2";x.fillStyle="#6b7280";x.font="11px -apple-system,sans-serif";522 unmodified lines523524525526527528529530522 unmodified linesconst maxT=Math.max(...data.map(d=>d.T)),us=data.map(d=>d.us_per_token),ce=data.map(d=>d.cells),maxU=Math.max(...us)*1.25,maxC=Math.max(...ce)*1.15,maxA=Math.max(...data.map(d=>d.flops_attention_equiv));const minT=Math.min(...data.map(d=>d.T)),lgMin=Math.log(minT),lgMax=Math.log(maxT);const X=t=>P+((Math.log(t)-lgMin)/(lgMax-lgMin||1))*(W-P-16),Y=u=>H-30-(u/maxU)*(H-56),Y2=v=>H-30-(v/maxC)*(H-56),YA=v=>H-30-(v/maxA)*(H-56);x.fillStyle="#fff";x.fillRect(0,0,W,H);x.strokeStyle="#eceef2";x.fillStyle="#6b7280";x.font="11px -apple-system,sans-serif";
experiments/demo_server.py+2-1