HWu0101 commited on
Commit
b7d51ff
·
verified ·
1 Parent(s): 9cf97aa

Sync from HWu0101/Local-LLM-Hardware-Explorer via hub-sync

Browse files
Files changed (1) hide show
  1. index.html +35 -10
index.html CHANGED
@@ -988,13 +988,18 @@ const CARD_MAX = 11;
988
  // Speed has to be compared on a fixed model or it is meaningless -- each build's
989
  // own best model differs, so "108 t/s" and "44 t/s" can describe different work.
990
  // The reference is whatever your current rig runs best today.
 
 
 
 
991
  function refModel(base){
992
  const b=bestUsable(base);
993
- return b ? b.m : M.slice().sort((x,y)=>x.gb-y.gb)[0];
 
994
  }
995
  function impactList(){
996
  const base=HW.find(h=>h.mine)||HW[0];
997
- const ref=refModel(base);
998
  const rows=HW.map(h=>{
999
  const b=bestUsable(h), rr=calc(ref,h);
1000
  return {h:h, best:b, q:b?qv(b.m):-Infinity,
@@ -1040,17 +1045,30 @@ function impactList(){
1040
  const dom=k=>k.h.id!==r.h.id && k.q>=r.q && k.s>=r.s && k.h.price<=r.h.price;
1041
  r.by = keep.filter(dom)[0] || rows.filter(dom)[0];
1042
  }
1043
- return {keep:keep, drop:drop, base:base, ref:ref, bq:bq, bs:bs};
1044
  }
1045
 
1046
  function card(r,L){
1047
  const h=r.h, b=r.best, chips=[];
1048
  if(h.mine) chips.push('<i>your baseline</i>');
1049
  else {
1050
- const dq=r.q-L.bq, ds=L.bs>0?r.s/L.bs:0;
1051
- chips.push(dq>=1 ? '<i class="up">+'+Math.round(dq)+' quality</i>'
1052
- : dq<=-1 ? '<i class="dn">'+Math.round(dq)+' quality</i>'
1053
- : '<i>same quality</i>');
 
 
 
 
 
 
 
 
 
 
 
 
 
1054
  chips.push(ds>=1.1 ? '<i class="up">'+ds.toFixed(ds<10?1:0)+'\u00d7 faster</i>'
1055
  : ds<=0.9 ? '<i class="dn">'+ds.toFixed(1)+'\u00d7 speed</i>'
1056
  : '<i>same speed</i>');
@@ -1092,9 +1110,13 @@ function hwCards(){
1092
  }
1093
  const worst=distinct.slice().sort((a,b)=>b.waste-a.waste).slice(0,3);
1094
  const li=r=>{
1095
- const dq=Math.round(r.q-L.bq), ds=L.bs>0?r.s/L.bs:0;
 
 
 
 
1096
  return `<li><b>${r.h.name}</b> \u00b7 ${r.h.priceTxt} \u00b7 ` +
1097
- `${dq>0?'+'+dq:dq} quality, ${ds.toFixed(1)}\u00d7 speed vs your rig` +
1098
  (!r.by ? ` \u2014 under the ${MT().step}-point / ${SPEED_STEP}\u00d7 bar`
1099
  : r.waste<=0 ? ` \u2014 no better than ${r.by.h.name} at the same price`
1100
  : ` \u2014 ${AUD(r.waste)} over ${r.by.h.name}, which already matches it on both`)+`</li>`;};
@@ -1103,7 +1125,10 @@ function hwCards(){
1103
  $('hwNote').innerHTML= L.drop.length
1104
  ? `<b>${nMain}</b> build${nMain>1?'s':''} shown beat everything cheaper by at least
1105
  <b>${MT().step} ${MT().unit}</b> of quality or <b>${SPEED_STEP}\u00d7</b>
1106
- the speed of <b>${L.ref.name}</b>, your rig\u2019s best model today.` +
 
 
 
1107
  (nFam?` A further <b>${nFam}</b> place a whole kind of machine on the map that the
1108
  field-wide comparison hid \u2014 ${FAMS.map(f=>f.long).join(', ')} \u2014 each contributing
1109
  at most its cheapest real step over your rig (<b>entry</b>) and the cheapest build that
 
988
  // Speed has to be compared on a fixed model or it is meaningless -- each build's
989
  // own best model differs, so "108 t/s" and "44 t/s" can describe different work.
990
  // The reference is whatever your current rig runs best today.
991
+ // On a sparse lens your own rig may run nothing that is rated at all, in which
992
+ // case there is no "best model today" to measure speed against. Fall back to the
993
+ // smallest model so the axis still has a scale, but flag it -- describing that
994
+ // fallback as your best model would be a plain lie.
995
  function refModel(base){
996
  const b=bestUsable(base);
997
+ return b ? {m:b.m, fallback:false}
998
+ : {m:M.slice().sort((x,y)=>x.gb-y.gb)[0], fallback:true};
999
  }
1000
  function impactList(){
1001
  const base=HW.find(h=>h.mine)||HW[0];
1002
+ const R0=refModel(base), ref=R0.m;
1003
  const rows=HW.map(h=>{
1004
  const b=bestUsable(h), rr=calc(ref,h);
1005
  return {h:h, best:b, q:b?qv(b.m):-Infinity,
 
1045
  const dom=k=>k.h.id!==r.h.id && k.q>=r.q && k.s>=r.s && k.h.price<=r.h.price;
1046
  r.by = keep.filter(dom)[0] || rows.filter(dom)[0];
1047
  }
1048
+ return {keep:keep, drop:drop, base:base, ref:ref, refFallback:R0.fallback, bq:bq, bs:bs};
1049
  }
1050
 
1051
  function card(r,L){
1052
  const h=r.h, b=r.best, chips=[];
1053
  if(h.mine) chips.push('<i>your baseline</i>');
1054
  else {
1055
+ const ds=L.bs>0?r.s/L.bs:0;
1056
+ // Quality deltas are only meaningful when BOTH ends are real numbers. If your
1057
+ // rig runs nothing rated on this lens the baseline is -Infinity, and
1058
+ // subtracting it yielded "+Infinity quality" on every card.
1059
+ if(!isFinite(r.q)) chips.push('<i>nothing rated runs</i>');
1060
+ else if(!isFinite(L.bq))chips.push('<i class="up">unlocks '+MT().fmt(r.q)+'</i>');
1061
+ else {
1062
+ // Scale-aware: a third of the metric's own step is the noise floor, and the
1063
+ // precision follows the metric. Hardcoded integers read every agent-lens
1064
+ // delta as "same quality", because that whole scale spans 0.27.
1065
+ const dq=r.q-L.bq, eps=MT().step/3;
1066
+ const t=v=>(v>0?'+':'\u2212')+(MT().step>=1?Math.round(Math.abs(v))
1067
+ :Math.abs(v).toFixed(3));
1068
+ chips.push(dq>=eps ? '<i class="up">'+t(dq)+' quality</i>'
1069
+ : dq<=-eps ? '<i class="dn">'+t(dq)+' quality</i>'
1070
+ : '<i>same quality</i>');
1071
+ }
1072
  chips.push(ds>=1.1 ? '<i class="up">'+ds.toFixed(ds<10?1:0)+'\u00d7 faster</i>'
1073
  : ds<=0.9 ? '<i class="dn">'+ds.toFixed(1)+'\u00d7 speed</i>'
1074
  : '<i>same speed</i>');
 
1110
  }
1111
  const worst=distinct.slice().sort((a,b)=>b.waste-a.waste).slice(0,3);
1112
  const li=r=>{
1113
+ const ds=L.bs>0?r.s/L.bs:0;
1114
+ const dtxt = !isFinite(r.q) ? 'nothing rated runs'
1115
+ : !isFinite(L.bq) ? 'unlocks '+MT().fmt(r.q)
1116
+ : (()=>{const d=r.q-L.bq;
1117
+ return (d>0?'+':'')+(MT().step>=1?Math.round(d):d.toFixed(3))+' quality';})();
1118
  return `<li><b>${r.h.name}</b> \u00b7 ${r.h.priceTxt} \u00b7 ` +
1119
+ `${dtxt}, ${ds.toFixed(1)}\u00d7 speed vs your rig` +
1120
  (!r.by ? ` \u2014 under the ${MT().step}-point / ${SPEED_STEP}\u00d7 bar`
1121
  : r.waste<=0 ? ` \u2014 no better than ${r.by.h.name} at the same price`
1122
  : ` \u2014 ${AUD(r.waste)} over ${r.by.h.name}, which already matches it on both`)+`</li>`;};
 
1125
  $('hwNote').innerHTML= L.drop.length
1126
  ? `<b>${nMain}</b> build${nMain>1?'s':''} shown beat everything cheaper by at least
1127
  <b>${MT().step} ${MT().unit}</b> of quality or <b>${SPEED_STEP}\u00d7</b>
1128
+ the speed of <b>${L.ref.name}</b>, ${L.refFallback
1129
+ ? 'the smallest model here \u2014 your rig runs nothing rated on this lens, so there is no '+
1130
+ 'best model to measure against and quality is shown as an absolute score rather than a gain'
1131
+ : 'your rig\u2019s best model today'}.` +
1132
  (nFam?` A further <b>${nFam}</b> place a whole kind of machine on the map that the
1133
  field-wide comparison hid \u2014 ${FAMS.map(f=>f.long).join(', ')} \u2014 each contributing
1134
  at most its cheapest real step over your rig (<b>entry</b>) and the cheapest build that