Skip to content

Commit c753dc6

Browse files
committed
site audit
1 parent bfb6ed5 commit c753dc6

File tree

6 files changed

+65
-24
lines changed

6 files changed

+65
-24
lines changed

.claude/skills/pir-paper-analyzer/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ The 34 papers in this collection primarily address **computational PIR** (cPIR)
10271027

10281028
#### reported.json metric conventions
10291029

1030-
`docs/data/reported.json` is the source of truth for paper-reported benchmarks.
1030+
`docs/reported/data/reported.json` is the source of truth for paper-reported benchmarks.
10311031

10321032
**Problem:** PIR papers use inconsistent terminology for the same metrics. A paper may call server computation "online comp," "answer time," or "server time." Preprocessing may appear as "setup time," "offline computation," "hint generation," or "offline cost." You must recognize these aliases and normalize to the standard keys below — both in `*_notes.md` files and in `reported.json` entries.
10331033

docs/misc/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ <h2><a href="#catalog">Scheme Catalog</a></h2>
6060
<h2><a href="#references">References</a></h2>
6161
<div class="links">
6262
<a href="https://github.com/0xalizk/PIR-Eng-Notes/tree/main/docs" target="_blank" rel="noopener noreferrer">GitHub Repo</a>
63-
<a href="https://github.com/0xalizk/PIR-Eng-Notes/blob/main/docs/data/reported.json" target="_blank" rel="noopener noreferrer">Raw Data</a>
63+
<a href="https://github.com/0xalizk/PIR-Eng-Notes/blob/main/docs/reported/data/reported.json" target="_blank" rel="noopener noreferrer">Raw Data</a>
6464
<a href="https://hackmd.io/@keewoolee/SJyGoXCzZe#Taxonomy" target="_blank" rel="noopener noreferrer">Taxonomy</a>
6565
<a href="https://gist.github.com/0xalizk/50f0d78712c6afe952ab2f9a2cc07434" target="_blank" rel="noopener noreferrer">Research</a>
6666
<a href="https://notes.ethereum.org/U9xM4VOPR9isPK7lOZJUQg" target="_blank" rel="noopener noreferrer">PIR for Ethereum</a>

docs/reported/charts.js

Lines changed: 62 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* ── PIR Engineering Notes — charts.js ────────────────────────────────
22
*
33
* Main visualization engine for the "Benching PIR (WIP)" site.
4-
* Renders all Plotly charts from ../data/reported.json (v2 schema).
4+
* Renders all Plotly charts from data/reported.json (v2 schema).
55
*
66
* ── Architecture Overview ──────────────────────────────────────────
77
*
@@ -175,6 +175,22 @@
175175
return STORAGE_NOTE_IDS[s.id] ? STORAGE_NOTE_TEXT : '';
176176
}
177177

178+
// Returns a Plotly annotation explaining † (Tier 2) and * (Tier 3) badges,
179+
// or null if all items are Tier 1.
180+
function tierBadgeLegend(items, t) {
181+
var has2 = items.some(function (s) { return s.data_tier === 2; });
182+
var has3 = items.some(function (s) { return s.data_tier === 3; });
183+
if (!has2 && !has3) return null;
184+
var parts = [];
185+
if (has2) parts.push('\u2020 from figures/analytics');
186+
if (has3) parts.push('* from asymptotics');
187+
return {
188+
text: '<i>' + parts.join(' &nbsp; ') + '</i>',
189+
xref: 'paper', yref: 'paper', x: 0, y: 0, yanchor: 'top', yshift: -60,
190+
showarrow: false, font: { size: 11, color: t.muted }
191+
};
192+
}
193+
178194
function isDark() {
179195
return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
180196
}
@@ -893,12 +909,15 @@
893909
hoverinfo: 'text'
894910
});
895911

896-
Plotly.newPlot(el, traces, baseLayout('Server Time (ms)', {
912+
var layout = baseLayout('Server Time (ms)', {
897913
yaxis: { autorange: 'reversed', tickfont: { size: 11 }, gridcolor: t.grid },
898914
xaxis: { title: { text: 'Server Time (ms)', standoff: 20 }, type: 'log', gridcolor: t.grid },
899915
margin: { l: barLeftMargin(), r: 60, t: 48, b: 48 },
900916
height: Math.max(350, items.length * 26 + 120)
901-
}), plotConfig());
917+
});
918+
var badge = tierBadgeLegend(items, t);
919+
if (badge) { layout.annotations = (layout.annotations || []).concat(badge); layout.margin.b = 80; }
920+
Plotly.newPlot(el, traces, layout, plotConfig());
902921
}
903922

904923
// ── 4. Client Compute Bars ───────────────────────────────
@@ -912,7 +931,7 @@
912931
var items = data.filter(function (s) { return isPos(getVal(s, 'client_time_ms')); });
913932
items.sort(function (a, b) { return getVal(a, 'client_time_ms') - getVal(b, 'client_time_ms'); });
914933

915-
Plotly.newPlot(el, [{
934+
var traces = [{
916935
y: items.map(function (s) { return (TIER_BADGE[s.data_tier] ? TIER_BADGE[s.data_tier] + ' ' : '') + consolidatedName(s); }),
917936
x: items.map(function (s) { return getVal(s, 'client_time_ms'); }),
918937
type: 'bar', orientation: 'h',
@@ -928,12 +947,16 @@
928947
return consolidatedName(s) + (entrySizeLabel(s) ? ' (' + entrySizeLabel(s) + ' entries)' : '') + '<br>Client Time: ' + formatNum(getVal(s, 'client_time_ms')) + ' ms<br>Source: ' + (s.source_ref || 'N/A') + consolidatedHoverSuffix(s);
929948
}),
930949
hoverinfo: 'text'
931-
}], baseLayout('Client Computation Time (ms)', {
950+
}];
951+
var layout = baseLayout('Client Computation Time (ms)', {
932952
yaxis: { tickfont: { size: 11 }, gridcolor: t.grid },
933953
xaxis: { title: 'Client Time (ms)', type: 'log', gridcolor: t.grid },
934954
margin: { l: barLeftMargin(), r: 60, t: 48, b: 48 },
935955
height: Math.max(300, items.length * 30 + 100)
936-
}), plotConfig());
956+
});
957+
var badge = tierBadgeLegend(items, t);
958+
if (badge) { layout.annotations = (layout.annotations || []).concat(badge); layout.margin.b = 80; }
959+
Plotly.newPlot(el, traces, layout, plotConfig());
937960
}
938961

939962
// ── 5. Offline & Storage Bar Chart ───────────────────
@@ -1003,14 +1026,17 @@
10031026
hoverinfo: 'text'
10041027
});
10051028

1006-
Plotly.newPlot(el, traces, baseLayout('Offline & Client Storage', {
1029+
var layout = baseLayout('Offline & Client Storage', {
10071030
barmode: 'group',
10081031
xaxis: { title: 'Size (MB)', gridcolor: t.grid },
10091032
yaxis: { tickfont: { size: 11 }, gridcolor: t.grid },
10101033
legend: { orientation: 'h', x: 0, y: -0.12, font: { size: 11 } },
10111034
margin: { l: barLeftMargin(), r: 60, t: 48, b: 100 },
10121035
height: Math.max(400, items.length * 40 + 160)
1013-
}), plotConfig());
1036+
});
1037+
var badge = tierBadgeLegend(items, t);
1038+
if (badge) { badge.yshift = -70; layout.annotations = (layout.annotations || []).concat(badge); }
1039+
Plotly.newPlot(el, traces, layout, plotConfig());
10141040
}
10151041

10161042
// ── 5b. Preprocessing Time Bar Chart ──────────────────
@@ -1106,14 +1132,17 @@
11061132
var seenGroups = {};
11071133
items.forEach(function (s) { seenGroups[s.group] = true; });
11081134

1109-
Plotly.newPlot(el, traces, baseLayout('Preprocessing / Offline Computation Time', {
1135+
var layout = baseLayout('Preprocessing / Offline Computation Time', {
11101136
barmode: 'group',
11111137
showlegend: false,
11121138
yaxis: { tickfont: { size: 11 }, gridcolor: t.grid },
11131139
xaxis: { title: { text: 'Time (ms)', standoff: 20 }, type: 'log', gridcolor: t.grid },
11141140
margin: { l: isMobile() ? 140 : 160, r: 80, t: 48, b: 50 },
11151141
height: Math.max(300, items.length * 30 + 80)
1116-
}), plotConfig());
1142+
});
1143+
var badge = tierBadgeLegend(items, t);
1144+
if (badge) { layout.annotations = (layout.annotations || []).concat(badge); layout.margin.b = 80; }
1145+
Plotly.newPlot(el, traces, layout, plotConfig());
11171146

11181147
// HTML legend below the chart
11191148
var legendId = 'preproc-legend';
@@ -2458,7 +2487,7 @@
24582487
var items = data.filter(function (s) { return isPos(getVal(s, 'rate')); });
24592488
items.sort(function (a, b) { return getVal(b, 'rate') - getVal(a, 'rate'); });
24602489

2461-
Plotly.newPlot(el, [{
2490+
var traces = [{
24622491
y: items.map(function (s) { return (TIER_BADGE[s.data_tier] ? TIER_BADGE[s.data_tier] + ' ' : '') + consolidatedName(s); }),
24632492
x: items.map(function (s) { return getVal(s, 'rate'); }),
24642493
type: 'bar', orientation: 'h',
@@ -2477,12 +2506,16 @@
24772506
'<br>Source: ' + (s.source_ref || 'N/A') + consolidatedHoverSuffix(s);
24782507
}),
24792508
hoverinfo: 'text'
2480-
}], baseLayout('Communication Rate (plaintext / ciphertext)', {
2509+
}];
2510+
var layout = baseLayout('Communication Rate (plaintext / ciphertext)', {
24812511
yaxis: { autorange: 'reversed', tickfont: { size: 11 }, gridcolor: t.grid },
24822512
xaxis: { title: { text: 'Rate (higher = better, 1.0 = optimal)', standoff: 20 }, range: [0, 1.05], gridcolor: t.grid },
24832513
margin: { l: barLeftMargin(), r: 60, t: 48, b: 48 },
24842514
height: Math.max(350, items.length * 30 + 120)
2485-
}), plotConfig());
2515+
});
2516+
var badge = tierBadgeLegend(items, t);
2517+
if (badge) { layout.annotations = (layout.annotations || []).concat(badge); layout.margin.b = 80; }
2518+
Plotly.newPlot(el, traces, layout, plotConfig());
24862519
}
24872520

24882521
// ── Misc: Amortized Offline Communication Bars ─────────
@@ -2496,7 +2529,7 @@
24962529
var items = data.filter(function (s) { return isPos(getVal(s, 'amortized_offline_comm_kb')); });
24972530
items.sort(function (a, b) { return getVal(a, 'amortized_offline_comm_kb') - getVal(b, 'amortized_offline_comm_kb'); });
24982531

2499-
Plotly.newPlot(el, [{
2532+
var traces = [{
25002533
y: items.map(function (s) { return (TIER_BADGE[s.data_tier] ? TIER_BADGE[s.data_tier] + ' ' : '') + consolidatedName(s); }),
25012534
x: items.map(function (s) { return getVal(s, 'amortized_offline_comm_kb'); }),
25022535
type: 'bar', orientation: 'h',
@@ -2515,12 +2548,16 @@
25152548
'<br>Source: ' + (s.source_ref || 'N/A') + consolidatedHoverSuffix(s);
25162549
}),
25172550
hoverinfo: 'text'
2518-
}], baseLayout('Amortized Offline Communication (KB/query)', {
2551+
}];
2552+
var layout = baseLayout('Amortized Offline Communication (KB/query)', {
25192553
yaxis: { autorange: 'reversed', tickfont: { size: 11 }, gridcolor: t.grid },
25202554
xaxis: { title: { text: 'Amortized Offline Comm (KB/query)', standoff: 20 }, type: 'log', gridcolor: t.grid },
25212555
margin: { l: barLeftMargin(), r: 60, t: 48, b: 48 },
25222556
height: Math.max(350, items.length * 30 + 120)
2523-
}), plotConfig());
2557+
});
2558+
var badge = tierBadgeLegend(items, t);
2559+
if (badge) { layout.annotations = (layout.annotations || []).concat(badge); layout.margin.b = 80; }
2560+
Plotly.newPlot(el, traces, layout, plotConfig());
25242561
}
25252562

25262563
// ── Misc: Amortized Offline Time Bars ──────────────────
@@ -2534,7 +2571,7 @@
25342571
var items = data.filter(function (s) { return isPos(getVal(s, 'amortized_offline_time_ms')); });
25352572
items.sort(function (a, b) { return getVal(a, 'amortized_offline_time_ms') - getVal(b, 'amortized_offline_time_ms'); });
25362573

2537-
Plotly.newPlot(el, [{
2574+
var traces = [{
25382575
y: items.map(function (s) { return (TIER_BADGE[s.data_tier] ? TIER_BADGE[s.data_tier] + ' ' : '') + consolidatedName(s); }),
25392576
x: items.map(function (s) { return getVal(s, 'amortized_offline_time_ms'); }),
25402577
type: 'bar', orientation: 'h',
@@ -2553,12 +2590,16 @@
25532590
'<br>Source: ' + (s.source_ref || 'N/A') + consolidatedHoverSuffix(s);
25542591
}),
25552592
hoverinfo: 'text'
2556-
}], baseLayout('Amortized Offline Time (ms/query)', {
2593+
}];
2594+
var layout = baseLayout('Amortized Offline Time (ms/query)', {
25572595
yaxis: { autorange: 'reversed', tickfont: { size: 11 }, gridcolor: t.grid },
25582596
xaxis: { title: { text: 'Amortized Offline Time (ms/query)', standoff: 20 }, type: 'log', gridcolor: t.grid },
25592597
margin: { l: barLeftMargin(), r: 60, t: 48, b: 48 },
25602598
height: Math.max(350, items.length * 30 + 120)
2561-
}), plotConfig());
2599+
});
2600+
var badge = tierBadgeLegend(items, t);
2601+
if (badge) { layout.annotations = (layout.annotations || []).concat(badge); layout.margin.b = 80; }
2602+
Plotly.newPlot(el, traces, layout, plotConfig());
25622603
}
25632604

25642605
var _activeDbTier = 'tiny';
@@ -2776,7 +2817,7 @@
27762817
// Resolve data path: charts.js lives in reported/, data in data/
27772818
var scriptEl = document.querySelector('script[src$="charts.js"]');
27782819
var prefix = scriptEl ? scriptEl.getAttribute('src').replace('charts.js', '') : '';
2779-
fetch(prefix + '../data/reported.json')
2820+
fetch(prefix + 'data/reported.json')
27802821
.then(function (r) { return r.json(); })
27812822
.then(function (raw) {
27822823
// clear loading indicators
@@ -2806,7 +2847,7 @@
28062847
.catch(function (err) {
28072848
console.error('Failed to load PIR data:', err);
28082849
var el = document.getElementById('chart-heatmap');
2809-
if (el) el.innerHTML = '<p style="color:red;padding:20px">Failed to load data. Ensure data/reported.json exists.</p>';
2850+
if (el) el.innerHTML = '<p style="color:red;padding:20px">Failed to load data. Ensure reported/data/reported.json exists.</p>';
28102851
});
28112852
}
28122853

docs/reported/db_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
'use strict';
44

55
function fetchData() {
6-
return fetch('../data/reported.json')
6+
return fetch('data/reported.json')
77
.then(function (r) { return r.json(); })
88
.then(function (raw) { return raw.schemes || raw; });
99
}

0 commit comments

Comments
 (0)