Logbook: lead with '% done' (functions handled out of all 10,673), game functions decompiled, and unsorted; trend tracks done
This commit is contained in:
1 parent
b7e09cfbd1
commit
0d764799a7
2 files changed
+13
-4
No files matched your search
@@ -84,7 +84,13 @@ def set_stats(project, stats, history_point=True):
|
||||
_write(project, "stats.json", stats)
|
||||
if history_point:
|
||||
history = _read(project, "history.json", [])
|
||||
cats = stats.get("by_category") or {}
|
||||
total = stats.get("functions") or 0
|
||||
undone_game = max(0, (cats.get("game") or {}).get("functions", 0)
|
||||
- ((stats.get("by_status") or {}).get("decompiled") or {}).get("functions", 0))
|
||||
handled = total - (cats.get("unsorted") or {}).get("functions", 0) - undone_game
|
||||
history.append({"at": stats["updated_at"], "classified": stats.get("classified_percent", 0),
|
||||
"done": round(100 * handled / total, 2) if total else 0,
|
||||
"decompiled": stats.get("game_bytes_decompiled_percent", 0),
|
||||
"weighted": stats.get("weighted_percent", 0),
|
||||
"verified": stats.get("game_bytes_verified_percent", 0)})
|
||||
|
||||
+7
-4
@@ -690,7 +690,7 @@ button.chip:hover { color: var(--accent-ink); background: var(--accent-soft); }
|
||||
<section class="card" aria-labelledby="h-lbtrend">
|
||||
<header><h2 id="h-lbtrend"><svg class="i"><use href="static/icons.svg#activity"/></svg>Trend</h2></header>
|
||||
<div class="body"><svg id="lbTrend" viewBox="0 0 300 110" preserveAspectRatio="none" aria-label="Progress over time"></svg>
|
||||
<div class="lb-legend"><span><i class="lb-sw" style="background:var(--lb-game)"></i>classified</span><span><i class="lb-sw" style="background:var(--lb-platform)"></i>game code decompiled</span><span><i class="lb-sw" style="background:var(--lb-done)"></i>weighted progress</span></div>
|
||||
<div class="lb-legend"><span><i class="lb-sw" style="background:var(--lb-game)"></i>classified</span><span><i class="lb-sw" style="background:var(--lb-platform)"></i>game code decompiled</span><span><i class="lb-sw" style="background:var(--lb-done)"></i>done (functions handled)</span></div>
|
||||
<div class="note" id="lbTrendNote" style="margin-top:8px"></div></div>
|
||||
</section>
|
||||
</div>
|
||||
@@ -1136,8 +1136,11 @@ async function renderLogbook(){try{LB=await get('api/logbook')}catch(e){put('lbS
|
||||
const s=LB.stats||{},cat=k=>(s.by_category||{})[k]||{functions:0,bytes:0};
|
||||
const cur=LB.milestones.find(m=>/progress/i.test(m.state||''));el('lbMilestone').textContent=cur?'Milestone '+cur.code+' · '+cur.title:'Milestones';
|
||||
const au=LB.auto||{};put('lbStamp',(s.updated_at?'Statistics updated <b>'+esc(central(s.updated_at))+'</b><br>main at <b>'+esc(s.commit||'–')+'</b>':'No statistics yet')+(au.last_refresh?'<br>Keeps itself current: last checked '+esc(central(au.last_refresh))+(au.last_error?' · <span class="err">'+esc(String(au.last_error).slice(0,120))+'</span>':''):''));
|
||||
put('lbFigs',[[fmt(s.functions),'functions in the original executable',fmt(s.bytes)+' bytes of code'],[pct(s.classified_percent),'classified (category known)',fmt(cat('unsorted').functions)+' still unsorted'],
|
||||
[pct(s.weighted_percent),'weighted progress','documented 20 · decompiled 40 · reimplemented 75 · verified 100'],[pct(s.game_bytes_decompiled_percent),'of game code decompiled to readable C','Rust: '+pct(s.game_bytes_reimplemented_percent)+' reimplemented']]
|
||||
const total=s.functions||0,game=cat('game').functions,done=(s.by_status&&s.by_status.decompiled||{}).functions||0,uns=cat('unsorted').functions;
|
||||
const handled=total-uns-Math.max(0,game-done);
|
||||
put('lbFigs',[[pct(total?100*handled/total:0)+' done',fmt(handled)+' of '+fmt(total)+' functions handled','game code decompiled, everything else identified'],
|
||||
[fmt(done)+' of '+fmt(game),'game functions decompiled to readable C',fmt(game-done)+' to go'],
|
||||
[fmt(uns),'functions not sorted yet','each one is either game code (to decompile) or engine/library code (to name)']]
|
||||
.map(([v,l,n])=>'<div class="lb-fig"><div class="v">'+esc(v)+'</div><div class="l">'+esc(l)+'</div><div class="n">'+esc(n)+'</div></div>').join(''));
|
||||
put('lbLegend',LB_CATS.map(([k,n])=>'<span><i class="lb-sw'+(k==='unsorted'?' lb-hatch':'')+'" style="background:var(--lb-'+k+')"></i>'+esc(n)+'</span>').join('')+'<span><i class="lb-sw" style="background:var(--lb-done)"></i>decompiled share under each column</span>');
|
||||
drawLbMap();renderLbWhere(s);renderLbTrend(LB.history);renderLbMilestones(LB.milestones);
|
||||
@@ -1162,7 +1165,7 @@ function drawLbMap(){const m=LB&&LB.map,c=el('lbMap');if(!c||!m||!c.clientWidth)
|
||||
function renderLbTrend(points){const svg=el('lbTrend');if(!points.length){svg.innerHTML='';el('lbTrendNote').textContent='The trend starts with the second report.';return}
|
||||
const n=points.length,x=i=>n===1?150:i*300/(n-1),y=v=>104-Math.min(100,v||0)/100*96,path=k=>points.map((p,i)=>(i?'L':'M')+x(i).toFixed(1)+','+y(p[k]).toFixed(1)).join(' ');
|
||||
svg.innerHTML=[0,25,50,75,100].map(v=>'<line x1="0" x2="300" y1="'+y(v)+'" y2="'+y(v)+'" stroke="var(--line)" stroke-width="0.5"/>').join('')
|
||||
+[['classified','--lb-game'],['decompiled','--lb-platform'],['weighted','--lb-done']].map(([k,c])=>'<path d="'+path(k)+'" fill="none" stroke="var('+c+')" stroke-width="2" vector-effect="non-scaling-stroke"/>').join('');
|
||||
+[['classified','--lb-game'],['decompiled','--lb-platform'],['done','--lb-done']].map(([k,c])=>{const pts=points.map((p,i)=>[i,p[k]]).filter(q=>q[1]!=null);return pts.length?'<path d="'+pts.map(([i,v],j)=>(j?'L':'M')+x(i).toFixed(1)+','+y(v).toFixed(1)).join(' ')+'" fill="none" stroke="var('+c+')" stroke-width="2.5" vector-effect="non-scaling-stroke"/>':''}).join('');
|
||||
el('lbTrendNote').textContent=n+' reports since '+new Date(points[0].at).toLocaleDateString()+'. Scale 0–100%.'}
|
||||
function renderLbMilestones(list){let last='';put('lbMilestones',list.length?list.map(m=>{const head=m.phase&&m.phase!==last?'<div class="lb-phase">'+esc(m.phase)+'</div>':'';last=m.phase||last;
|
||||
const items=m.items||[],done=items.filter(i=>i.done).length,li=items.map(i=>'<li class="'+(i.done?'done':'')+'">'+esc(i.text)+'</li>').join(''),open=/progress/i.test(m.state||'');
|
||||
|
||||
Reference in new issue
Block a user