HuggingFriends commited on
Commit
070e60e
·
verified ·
1 Parent(s): 99caaf4

Refresh PixelWorld monitoring frontend

Browse files
Files changed (2) hide show
  1. flash.html +2 -2
  2. flash.js +3 -2
flash.html CHANGED
@@ -9,6 +9,6 @@
9
  <p id="condition" class="notice"></p><p id="scope" class="small muted"></p><p id="sync" class="small muted">正在加载…</p>
10
  <div class="table"><table><thead><tr><th>设置</th><th>生成</th><th>Input / Output 均值</th><th>成本估算 / attempt</th><th>评分数 · IoU v1 / v2</th><th>配对 v1 变化</th></tr></thead><tbody id="rows"></tbody></table></div>
11
  <section class="panel"><h2>成本与质量</h2><div id="chart"></div><p class="small muted">只绘制已完成全部匹配评分的条件。子集指标不能当作完整 Physics-IQ Verified 分数;置信区间与独立验证完成后再确定正式版本。</p></section>
12
- <details><summary>Trace 中的实际行为</summary><div class="table"><table><thead><tr><th>设置</th><th>exec / case</th><th>图片调用 / case</th><th>真实图片返回 / case</th><th>helper 失败 / case</th><th>读 artifact_io.py</th><th>读 player template</th></tr></thead><tbody id="trace"></tbody></table></div></details>
13
  <footer>成本采用公开列明的参考费率:input $10/M、cached input $1/M、output $50/M。70% 缓存是假设场景;测试模型免费,表中估算不是实际账单。原始协议状态、RGB 有效性和接口故障分别保留。</footer></main>
14
- <script src="flash.js?v=2e3f23363296"></script></body></html>
 
9
  <p id="condition" class="notice"></p><p id="scope" class="small muted"></p><p id="sync" class="small muted">正在加载…</p>
10
  <div class="table"><table><thead><tr><th>设置</th><th>生成</th><th>Input / Output 均值</th><th>成本估算 / attempt</th><th>评分数 · IoU v1 / v2</th><th>配对 v1 变化</th></tr></thead><tbody id="rows"></tbody></table></div>
11
  <section class="panel"><h2>成本与质量</h2><div id="chart"></div><p class="small muted">只绘制已完成全部匹配评分的条件。子集指标不能当作完整 Physics-IQ Verified 分数;置信区间与独立验证完成后再确定正式版本。</p></section>
12
+ <details open><summary>已发布视频与完整 Trace · 同一案例对照</summary><div id="examples"></div></details><details><summary>Trace 中的实际行为</summary><div class="table"><table><thead><tr><th>设置</th><th>exec / case</th><th>图片调用 / case</th><th>真实图片返回 / case</th><th>helper 失败 / case</th><th>读 artifact_io.py</th><th>读 player template</th></tr></thead><tbody id="trace"></tbody></table></div></details>
13
  <footer>成本采用公开列明的参考费率:input $10/M、cached input $1/M、output $50/M。70% 缓存是假设场景;测试模型免费,表中估算不是实际账单。原始协议状态、RGB 有效性和接口故障分别保留。</footer></main>
14
+ <script src="flash.js?v=ffc5e68ca239"></script></body></html>
flash.js CHANGED
@@ -1,10 +1,11 @@
1
  (()=>{
2
  const HF='https://huggingface.co/datasets/HuggingFriends/PixelWorld/resolve/main/analyses/flash/';
3
- let cohort='confirmation',report;
4
  const $=id=>document.getElementById(id),esc=x=>String(x??'').replace(/[&<>"']/g,c=>({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]));
5
  const fmt=(x,n=2)=>typeof x==='number'?x.toFixed(n):'—',tok=x=>typeof x==='number'?(x/1000).toFixed(1)+'k':'—';
6
  async function load(){const path=cohort+'.json';let urls=[HF+path];if(!document.body.dataset.liveBase)urls.unshift('flash_'+path);let error;for(const url of urls){try{let r=await fetch(url+'?t='+Date.now(),{cache:'no-store',signal:AbortSignal.timeout(12000)});if(!r.ok)throw Error('HTTP '+r.status);return await r.json()}catch(e){error=e}}throw error}
7
  function chart(arms){const pts=arms.filter(a=>a.scored_cases===a.expected_cases&&typeof a.mean_cost_normalized70==='number'&&typeof a.mean_v1==='number');if(!pts.length){$('chart').innerHTML='<p class="muted">等待完整匹配评分。这里不展示占位分数。</p>';return}const W=850,H=340,L=70,T=25,R=30,B=55,xmax=Math.max(...pts.map(a=>a.mean_cost_normalized70))*1.15,ymax=Math.max(.3,...pts.map(a=>a.mean_v1))*1.2;let s='<svg viewBox="0 0 '+W+' '+H+'" role="img" aria-label="Measured cost and subset quality">';for(let i=0;i<=4;i++){let y=H-B-(H-B-T)*i/4;s+='<line x1="'+L+'" y1="'+y+'" x2="'+(W-R)+'" y2="'+y+'" stroke="#dfe5ee"/><text x="'+(L-8)+'" y="'+(y+4)+'" text-anchor="end" fill="#64748b" font-size="12">'+fmt(ymax*i/4)+'</text>';let x=L+(W-R-L)*i/4;s+='<text x="'+x+'" y="'+(H-B+20)+'" text-anchor="middle" fill="#64748b" font-size="12">$'+fmt(xmax*i/4)+'</text>'}const colors=['#2563eb','#16803b','#7c3aed','#a8650a','#c43e30'];pts.forEach((a,i)=>{let x=L+a.mean_cost_normalized70/xmax*(W-L-R),y=H-B-a.mean_v1/ymax*(H-T-B);const anchor=x>W*.7?'end':'start',labelX=x+(anchor==='end'?-12:12),labelY=y+(a.key==='baseline'?24:a.key==='receipt'?-32:-12),short={baseline:'Baseline',api:'Save API',receipt:'API + receipt',strict:'Four-call guidance'}[a.key]||a.label;s+='<circle cx="'+x+'" cy="'+y+'" r="7" fill="'+colors[i%colors.length]+'"><title>'+esc(a.label)+' · '+a.scored_cases+' cases · $'+fmt(a.mean_cost_normalized70)+' · IoU '+fmt(a.mean_v1,4)+'</title></circle><text x="'+labelX+'" y="'+labelY+'" text-anchor="'+anchor+'" fill="'+colors[i%colors.length]+'" font-size="12">'+esc(short)+'</text>'});s+='<text x="'+(W/2)+'" y="'+(H-8)+'" text-anchor="middle" fill="#64748b" font-size="13">Cost / fully measured attempt · 70% cache scenario</text><text x="18" y="'+H/2+'" transform="rotate(-90 18 '+H/2+')" text-anchor="middle" fill="#64748b" font-size="13">Subset weighted spatial IoU v1 ↑</text></svg>';$('chart').innerHTML=s}
8
  function render(){const arms=report.arms||[];$('scope').textContent=report.scope;$('sync').textContent='更新:'+new Date(report.updated_utc).toLocaleString();$('condition').textContent=cohort==='confirmation'?'工作中的视觉工具 · 20 个独立场景 · 正式 Flash 版本待确认':'旧开发条件:附带首帧,但输出图片工具因 helper 校验失败而不可用。此处数据不作为完整 Vision 主评测。';$('rows').innerHTML=arms.map(a=>{let c=a.counts||{},q=a.paired?.v1;return'<tr><td><b>'+esc(a.label)+'</b></td><td>'+a.valid_rgb+'/'+a.expected_cases+' RGB · '+a.original_protocol_pass+' 协议通过<br><span class="small muted">'+(a.excluded_from_acceptance?'已停止 · 不用于版本选择':(c.running||0)+' 运行 · '+a.pending+' 待生成')+'</span></td><td>'+tok(a.mean_input)+' / '+tok(a.mean_output)+'<br><span class="small muted">'+a.usage_measured_cases+' 次完整 usage</span></td><td>'+ (typeof a.mean_cost_normalized70==='number'?'$'+fmt(a.mean_cost_normalized70):'—')+(typeof a.cost_per_protocol_delivery_normalized70==='number'?'<br><span class="small muted">$'+fmt(a.cost_per_protocol_delivery_normalized70)+' / 有效交付</span>':'')+'<br><span class="small muted">实测缓存:$'+fmt(a.mean_cost_measured_cache)+'</span></td><td>'+a.scored_cases+'/'+a.expected_cases+'<br>'+fmt(a.mean_v1,4)+' / '+fmt(a.mean_v2,4)+'</td><td>'+(q?fmt(q.relative_mean_delta*100,1)+'%<br><span class="small muted">'+(Array.isArray(q.ci95)?'Δ CI ['+fmt(q.ci95[0],4)+', '+fmt(q.ci95[1],4)+']':'样本不足以估计区间')+'</span>':'—')+'</td></tr>'}).join('');$('trace').innerHTML=arms.map(a=>{let t=a.trace||{};return'<tr><td>'+esc(a.label)+'</td><td>'+fmt(t.mean_exec_calls,1)+'</td><td>'+fmt(t.mean_image_calls,1)+'</td><td>'+fmt(t.mean_returned_image_messages,1)+'</td><td>'+fmt(t.mean_image_helper_failures,1)+'</td><td>'+(t.source_reads?.['artifact_io.py']??'—')+'</td><td>'+(t.source_reads?.['player_template.html']??'—')+'</td></tr>'}).join('');chart(arms)}
9
- async function poll(){try{report=await load();render()}catch(e){$('sync').textContent='报告同步等待:'+e.message}}document.querySelectorAll('[data-cohort]').forEach(b=>b.onclick=()=>{cohort=b.dataset.cohort;poll()});poll();setInterval(poll,30000)
 
10
  })();
 
1
  (()=>{
2
  const HF='https://huggingface.co/datasets/HuggingFriends/PixelWorld/resolve/main/analyses/flash/';
3
+ let cohort='confirmation',report,exampleCase='0047';
4
  const $=id=>document.getElementById(id),esc=x=>String(x??'').replace(/[&<>"']/g,c=>({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]));
5
  const fmt=(x,n=2)=>typeof x==='number'?x.toFixed(n):'—',tok=x=>typeof x==='number'?(x/1000).toFixed(1)+'k':'—';
6
  async function load(){const path=cohort+'.json';let urls=[HF+path];if(!document.body.dataset.liveBase)urls.unshift('flash_'+path);let error;for(const url of urls){try{let r=await fetch(url+'?t='+Date.now(),{cache:'no-store',signal:AbortSignal.timeout(12000)});if(!r.ok)throw Error('HTTP '+r.status);return await r.json()}catch(e){error=e}}throw error}
7
  function chart(arms){const pts=arms.filter(a=>a.scored_cases===a.expected_cases&&typeof a.mean_cost_normalized70==='number'&&typeof a.mean_v1==='number');if(!pts.length){$('chart').innerHTML='<p class="muted">等待完整匹配评分。这里不展示占位分数。</p>';return}const W=850,H=340,L=70,T=25,R=30,B=55,xmax=Math.max(...pts.map(a=>a.mean_cost_normalized70))*1.15,ymax=Math.max(.3,...pts.map(a=>a.mean_v1))*1.2;let s='<svg viewBox="0 0 '+W+' '+H+'" role="img" aria-label="Measured cost and subset quality">';for(let i=0;i<=4;i++){let y=H-B-(H-B-T)*i/4;s+='<line x1="'+L+'" y1="'+y+'" x2="'+(W-R)+'" y2="'+y+'" stroke="#dfe5ee"/><text x="'+(L-8)+'" y="'+(y+4)+'" text-anchor="end" fill="#64748b" font-size="12">'+fmt(ymax*i/4)+'</text>';let x=L+(W-R-L)*i/4;s+='<text x="'+x+'" y="'+(H-B+20)+'" text-anchor="middle" fill="#64748b" font-size="12">$'+fmt(xmax*i/4)+'</text>'}const colors=['#2563eb','#16803b','#7c3aed','#a8650a','#c43e30'];pts.forEach((a,i)=>{let x=L+a.mean_cost_normalized70/xmax*(W-L-R),y=H-B-a.mean_v1/ymax*(H-T-B);const anchor=x>W*.7?'end':'start',labelX=x+(anchor==='end'?-12:12),labelY=y+(a.key==='baseline'?24:a.key==='receipt'?-32:-12),short={baseline:'Baseline',api:'Save API',receipt:'API + receipt',strict:'Four-call guidance'}[a.key]||a.label;s+='<circle cx="'+x+'" cy="'+y+'" r="7" fill="'+colors[i%colors.length]+'"><title>'+esc(a.label)+' · '+a.scored_cases+' cases · $'+fmt(a.mean_cost_normalized70)+' · IoU '+fmt(a.mean_v1,4)+'</title></circle><text x="'+labelX+'" y="'+labelY+'" text-anchor="'+anchor+'" fill="'+colors[i%colors.length]+'" font-size="12">'+esc(short)+'</text>'});s+='<text x="'+(W/2)+'" y="'+(H-8)+'" text-anchor="middle" fill="#64748b" font-size="13">Cost / fully measured attempt · 70% cache scenario</text><text x="18" y="'+H/2+'" transform="rotate(-90 18 '+H/2+')" text-anchor="middle" fill="#64748b" font-size="13">Subset weighted spatial IoU v1 ↑</text></svg>';$('chart').innerHTML=s}
8
  function render(){const arms=report.arms||[];$('scope').textContent=report.scope;$('sync').textContent='更新:'+new Date(report.updated_utc).toLocaleString();$('condition').textContent=cohort==='confirmation'?'工作中的视觉工具 · 20 个独立场景 · 正式 Flash 版本待确认':'旧开发条件:附带首帧,但输出图片工具因 helper 校验失败而不可用。此处数据不作为完整 Vision 主评测。';$('rows').innerHTML=arms.map(a=>{let c=a.counts||{},q=a.paired?.v1;return'<tr><td><b>'+esc(a.label)+'</b></td><td>'+a.valid_rgb+'/'+a.expected_cases+' RGB · '+a.original_protocol_pass+' 协议通过<br><span class="small muted">'+(a.excluded_from_acceptance?'已停止 · 不用于版本选择':(c.running||0)+' 运行 · '+a.pending+' 待生成')+'</span></td><td>'+tok(a.mean_input)+' / '+tok(a.mean_output)+'<br><span class="small muted">'+a.usage_measured_cases+' 次完整 usage</span></td><td>'+ (typeof a.mean_cost_normalized70==='number'?'$'+fmt(a.mean_cost_normalized70):'—')+(typeof a.cost_per_protocol_delivery_normalized70==='number'?'<br><span class="small muted">$'+fmt(a.cost_per_protocol_delivery_normalized70)+' / 有效交付</span>':'')+'<br><span class="small muted">实测缓存:$'+fmt(a.mean_cost_measured_cache)+'</span></td><td>'+a.scored_cases+'/'+a.expected_cases+'<br>'+fmt(a.mean_v1,4)+' / '+fmt(a.mean_v2,4)+'</td><td>'+(q?fmt(q.relative_mean_delta*100,1)+'%<br><span class="small muted">'+(Array.isArray(q.ci95)?'Δ CI ['+fmt(q.ci95[0],4)+', '+fmt(q.ci95[1],4)+']':'样本不足以估计区间')+'</span>':'—')+'</td></tr>'}).join('');$('trace').innerHTML=arms.map(a=>{let t=a.trace||{};return'<tr><td>'+esc(a.label)+'</td><td>'+fmt(t.mean_exec_calls,1)+'</td><td>'+fmt(t.mean_image_calls,1)+'</td><td>'+fmt(t.mean_returned_image_messages,1)+'</td><td>'+fmt(t.mean_image_helper_failures,1)+'</td><td>'+(t.source_reads?.['artifact_io.py']??'—')+'</td><td>'+(t.source_reads?.['player_template.html']??'—')+'</td></tr>'}).join('');chart(arms)}
9
+ async function showExamples(){if(cohort!=='confirmation'){$('examples').textContent='旧开发条件单独保留,不与当前示例混排。';return}const playing=$('examples').querySelector('video');if(playing&&!playing.paused)return;try{const response=await fetch(HF+'examples.json?t='+Date.now(),{cache:'no-store',signal:AbortSignal.timeout(12000)});if(!response.ok)throw Error('HTTP '+response.status);const data=await response.json(),rows=data.examples||[],ids=[...new Set(rows.map(x=>x.case))].sort();if(!ids.length)return;if(!ids.includes(exampleCase))exampleCase=ids[0];const labels=Object.fromEntries((report.arms||[]).map(a=>[a.key,a.label]));$('examples').innerHTML='<label class="small muted">同一案例 </label><select id="example-case">'+ids.map(id=>'<option '+(id===exampleCase?'selected ':'')+'value="'+esc(id)+'">'+esc(id)+'</option>').join('')+'</select><div class="versions">'+rows.filter(x=>x.case===exampleCase).map(x=>{const candidate=(x.candidates||[]).at(-1);return'<article class="panel"><b>'+esc(labels[x.arm]||x.arm)+'</b><p class="small '+(x.protocol_pass?'muted':'failed')+'">'+(x.protocol_pass?'交付协议通过':'交付协议未通过 · 保留生成结果供检查')+'</p>'+(candidate?.preview_mp4?'<video controls preload="none" poster="'+esc(candidate.poster)+'" src="'+esc(candidate.preview_mp4)+'"></video>':'<p class="muted">尚无可播放候选</p>')+'<p class="small"><a target="_blank" rel="noopener" href="'+esc(x.detail)+'">完整详情</a>'+(x.trace?' · <a href="'+esc(x.trace)+'">完整脱敏 Trace</a>':'')+'</p></article>'}).join('')+'</div>';$('example-case').onchange=e=>{exampleCase=e.target.value;showExamples()}}catch(e){$('examples').textContent='已完成视频和完整 Trace 正在自动发布;汇总数据继续刷新。'}}
10
+ async function poll(){try{report=await load();render();showExamples()}catch(e){$('sync').textContent='报告同步等待:'+e.message}}document.querySelectorAll('[data-cohort]').forEach(b=>b.onclick=()=>{cohort=b.dataset.cohort;poll()});poll();setInterval(poll,30000)
11
  })();