Spaces:
Running
Running
deploy(hf): sync szl-holdings/a11oy@main derived COPY set
Browse filesReusable Dockerfile-COPY-derived deploy from szl-holdings/a11oy main.
Files: 905 Pruned: 0
Derived from Dockerfile COPY sources (NO hand-maintained allowlist).
Signed-off-by: SZL Holdings <noreply@szlholdings.ai>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- static/3d/surfaces/estate.js +30 -51
- static/3d/surfaces/fabric.js +29 -61
- static/3d/surfaces/flowmatch.js +31 -101
- static/3d/surfaces/formalmath.js +32 -102
- static/3d/surfaces/frontier.js +27 -15
- static/3d/surfaces/genie.js +29 -99
- static/3d/surfaces/gitthoughts.js +34 -104
- static/3d/surfaces/goat.js +32 -102
- static/3d/surfaces/governance.js +23 -14
- static/3d/surfaces/graphmem.js +31 -101
- static/3d/surfaces/grpo.js +34 -104
- static/3d/surfaces/herotq.js +34 -104
- static/3d/surfaces/hrm.js +36 -106
- static/3d/surfaces/inplacettt.js +35 -105
- static/3d/surfaces/interpretability.js +28 -98
- static/3d/surfaces/kan.js +31 -101
static/3d/surfaces/estate.js
CHANGED
|
@@ -26,6 +26,8 @@
|
|
| 26 |
//
|
| 27 |
// CONTRACT: default-export { id, title, endpoints[], mount(ctx), unmount() }.
|
| 28 |
|
|
|
|
|
|
|
| 29 |
const ID = "estate";
|
| 30 |
const TITLE = "Estate Hologram";
|
| 31 |
|
|
@@ -44,8 +46,8 @@ const C = {
|
|
| 44 |
|
| 45 |
let _stage = null, _THREE = null, _ctx = null;
|
| 46 |
let _root = null, _overlay = null, _frameFn = null;
|
|
|
|
| 47 |
let _hud = {}; // live HUD chip/value rows
|
| 48 |
-
let _plain = false, _plainEl = null; // "what this means" plain-language toggle
|
| 49 |
let _scene = null; // built scene-object refs the frame loop animates
|
| 50 |
const _anim = {}; // eased animation targets
|
| 51 |
const _handles = []; // every poll handle (stopped on unmount)
|
|
@@ -206,25 +208,33 @@ function buildScene() {
|
|
| 206 |
// ----------------------------------------------------------------------------
|
| 207 |
function buildHud() {
|
| 208 |
const lab = _ctx.label;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
_overlay = document.createElement("div");
|
| 210 |
_overlay.className = "szl3d-estate-hud";
|
| 211 |
Object.assign(_overlay.style, {
|
| 212 |
-
position: "absolute", left: "14px", top: "14px", zIndex: "6",
|
| 213 |
display: "flex", flexDirection: "column", gap: "6px",
|
| 214 |
-
|
| 215 |
-
color: "#cfe0ea", background: "rgba(6,11,16,.74)", border: "1px solid #15212c",
|
| 216 |
-
borderRadius: "10px", padding: "12px 14px", backdropFilter: "blur(3px)",
|
| 217 |
});
|
| 218 |
|
| 219 |
-
const title = document.createElement("div");
|
| 220 |
-
title.style.cssText = "font:600 13px ui-sans-serif,system-ui;color:#eef3f6;letter-spacing:.4px;display:flex;gap:8px;align-items:center";
|
| 221 |
-
title.innerHTML = "◇ Estate Hologram <span style='color:#46586a;font-weight:400'>· 5 endpoints · one scene</span>";
|
| 222 |
-
_overlay.appendChild(title);
|
| 223 |
-
|
| 224 |
-
const badge = _ctx.live.createBadge();
|
| 225 |
-
_overlay.appendChild(badge.el);
|
| 226 |
-
_hud.badge = badge;
|
| 227 |
-
|
| 228 |
function row(key, name) {
|
| 229 |
const wrap = document.createElement("div");
|
| 230 |
wrap.style.cssText = "display:flex;align-items:center;gap:8px;justify-content:space-between";
|
|
@@ -256,42 +266,11 @@ function buildHud() {
|
|
| 256 |
row("credits", "reservoir work_credits"); // anatomy
|
| 257 |
row("ayni", "Ayni balance"); // anatomy
|
| 258 |
|
| 259 |
-
|
| 260 |
-
note.style.cssText = "color:#6d7d8a;font-size:10.5px;line-height:1.45;margin-top:4px;border-top:1px solid #15212c;padding-top:6px";
|
| 261 |
-
note.textContent = "Unified overview: governance arc (kpi-board) + energy ring + fabric hex + PNT horizon + anatomy beat glance. Every value wired live; NO-LIVE-DATA shown grayed, never fabricated. Λ = Conjecture 1, clamped < 1.0.";
|
| 262 |
-
_overlay.appendChild(note);
|
| 263 |
-
|
| 264 |
-
const legend = _ctx.label.legend(); legend.style.opacity = "0.85"; legend.style.marginTop = "2px";
|
| 265 |
-
_overlay.appendChild(legend);
|
| 266 |
-
|
| 267 |
-
// "what this means" plain-language toggle (matches the research surfaces).
|
| 268 |
-
const pl = document.createElement("button");
|
| 269 |
-
pl.textContent = "◑ what this means";
|
| 270 |
-
pl.title = "Toggle plain-language explanation for investors & consumers.";
|
| 271 |
-
pl.style.cssText = "font:11px ui-monospace,monospace;padding:5px 11px;border-radius:7px;" +
|
| 272 |
-
"border:1px solid #3af4c8;background:#08140f;color:#3af4c8;cursor:pointer;width:fit-content;margin-top:4px";
|
| 273 |
-
pl.addEventListener("click", () => {
|
| 274 |
-
_plain = !_plain;
|
| 275 |
-
pl.style.background = _plain ? "#0f2a20" : "#08140f";
|
| 276 |
-
_applyPlain();
|
| 277 |
-
});
|
| 278 |
-
_overlay.appendChild(pl);
|
| 279 |
-
|
| 280 |
-
const pd = document.createElement("div");
|
| 281 |
-
pd.style.cssText = "font-size:10.5px;color:#c9d6df;line-height:1.55;border:1px dashed #26333f;" +
|
| 282 |
-
"border-radius:7px;padding:7px 9px;display:none;margin-top:4px";
|
| 283 |
-
_plainEl = pd;
|
| 284 |
-
_overlay.appendChild(pd);
|
| 285 |
-
|
| 286 |
-
(_ctx.container || document.body).appendChild(_overlay);
|
| 287 |
}
|
| 288 |
|
| 289 |
-
function
|
| 290 |
-
|
| 291 |
-
if (!pd) return;
|
| 292 |
-
pd.style.display = _plain ? "block" : "none";
|
| 293 |
-
if (!_plain) return;
|
| 294 |
-
pd.innerHTML =
|
| 295 |
"<b>What this means:</b> This is a single command view that pulls together five separate " +
|
| 296 |
"live feeds at once — <b>governance</b> (which formulas are locked-proven, the Λ safety " +
|
| 297 |
"aggregator, and the CHAPAQ verdict), <b>energy</b> (grid price, renewable share, and any " +
|
|
@@ -301,7 +280,7 @@ function _applyPlain() {
|
|
| 301 |
"means a real sensor/probe delta, <b>MODELED</b>/<b>SAMPLE</b> mean a simulation or a stand-in, " +
|
| 302 |
"and anything not live is shown as <b>NO-LIVE-DATA</b> rather than a made-up number. The " +
|
| 303 |
"locked-8 count is always exactly 8 and Λ is a <b>conjecture</b> clamped below 1.0 — nothing " +
|
| 304 |
-
"here is inflated or fabricated.";
|
| 305 |
}
|
| 306 |
|
| 307 |
function _setRow(key, text, label) {
|
|
@@ -516,7 +495,7 @@ function mount(ctx) {
|
|
| 516 |
function unmount() {
|
| 517 |
for (const h of _handles) { try { h && h.stop && h.stop(); } catch (_) {} }
|
| 518 |
_handles.length = 0;
|
| 519 |
-
try { if (
|
| 520 |
try {
|
| 521 |
if (_root) {
|
| 522 |
_root.traverse((o) => {
|
|
@@ -530,7 +509,7 @@ function unmount() {
|
|
| 530 |
}
|
| 531 |
} catch (_) {}
|
| 532 |
try { if (_stage) _stage.setBloom(false); } catch (_) {}
|
| 533 |
-
_root = null; _overlay = null; _scene = null; _frameFn = null; _hud = {};
|
| 534 |
}
|
| 535 |
|
| 536 |
export default { id: ID, title: TITLE, endpoints: [EP_KPI, EP_ENERGY, EP_FABRIC, EP_PNT, EP_LOOP], mount, unmount };
|
|
|
|
| 26 |
//
|
| 27 |
// CONTRACT: default-export { id, title, endpoints[], mount(ctx), unmount() }.
|
| 28 |
|
| 29 |
+
import { createShowcase } from "./_showcase.js";
|
| 30 |
+
|
| 31 |
const ID = "estate";
|
| 32 |
const TITLE = "Estate Hologram";
|
| 33 |
|
|
|
|
| 46 |
|
| 47 |
let _stage = null, _THREE = null, _ctx = null;
|
| 48 |
let _root = null, _overlay = null, _frameFn = null;
|
| 49 |
+
let _show = null; // shared collapsible showcase chrome
|
| 50 |
let _hud = {}; // live HUD chip/value rows
|
|
|
|
| 51 |
let _scene = null; // built scene-object refs the frame loop animates
|
| 52 |
const _anim = {}; // eased animation targets
|
| 53 |
const _handles = []; // every poll handle (stopped on unmount)
|
|
|
|
| 208 |
// ----------------------------------------------------------------------------
|
| 209 |
function buildHud() {
|
| 210 |
const lab = _ctx.label;
|
| 211 |
+
|
| 212 |
+
// one shared LIVE badge follows the PRIMARY (kpi-board) poll
|
| 213 |
+
const badge = _ctx.live.createBadge();
|
| 214 |
+
_hud.badge = badge;
|
| 215 |
+
|
| 216 |
+
// Shared collapsible showcase supplies the compact chrome: title + LIVE badge +
|
| 217 |
+
// legend (all four doctrine states used across the five surfaces) + the moved
|
| 218 |
+
// descriptive note + the "what this means" plain-language toggle. The KPI rows fold
|
| 219 |
+
// into the (collapsed) body below so the 3D estate stays the star.
|
| 220 |
+
_show = createShowcase(_ctx, {
|
| 221 |
+
id: ID, title: TITLE, accent: "#5b8dee", badge,
|
| 222 |
+
legend: ["LIVE", "MEASURED", "MODELED", "SAMPLE", "STRUCTURAL-ONLY"],
|
| 223 |
+
description:
|
| 224 |
+
"Unified overview: governance arc (kpi-board) + energy ring + fabric hex + PNT " +
|
| 225 |
+
"horizon + anatomy beat glance. Every value wired live; NO-LIVE-DATA shown grayed, " +
|
| 226 |
+
"never fabricated. Λ = Conjecture 1, clamped < 1.0.",
|
| 227 |
+
plain: { html: _plainHtml },
|
| 228 |
+
});
|
| 229 |
+
|
| 230 |
+
// rows fold into a plain (position:static) container inside the showcase body.
|
| 231 |
_overlay = document.createElement("div");
|
| 232 |
_overlay.className = "szl3d-estate-hud";
|
| 233 |
Object.assign(_overlay.style, {
|
|
|
|
| 234 |
display: "flex", flexDirection: "column", gap: "6px",
|
| 235 |
+
font: "12px ui-monospace,SFMono-Regular,Menlo,monospace", color: "#cfe0ea",
|
|
|
|
|
|
|
| 236 |
});
|
| 237 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 238 |
function row(key, name) {
|
| 239 |
const wrap = document.createElement("div");
|
| 240 |
wrap.style.cssText = "display:flex;align-items:center;gap:8px;justify-content:space-between";
|
|
|
|
| 266 |
row("credits", "reservoir work_credits"); // anatomy
|
| 267 |
row("ayni", "Ayni balance"); // anatomy
|
| 268 |
|
| 269 |
+
_show.body.appendChild(_overlay);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 270 |
}
|
| 271 |
|
| 272 |
+
function _plainHtml() {
|
| 273 |
+
return (
|
|
|
|
|
|
|
|
|
|
|
|
|
| 274 |
"<b>What this means:</b> This is a single command view that pulls together five separate " +
|
| 275 |
"live feeds at once — <b>governance</b> (which formulas are locked-proven, the Λ safety " +
|
| 276 |
"aggregator, and the CHAPAQ verdict), <b>energy</b> (grid price, renewable share, and any " +
|
|
|
|
| 280 |
"means a real sensor/probe delta, <b>MODELED</b>/<b>SAMPLE</b> mean a simulation or a stand-in, " +
|
| 281 |
"and anything not live is shown as <b>NO-LIVE-DATA</b> rather than a made-up number. The " +
|
| 282 |
"locked-8 count is always exactly 8 and Λ is a <b>conjecture</b> clamped below 1.0 — nothing " +
|
| 283 |
+
"here is inflated or fabricated.");
|
| 284 |
}
|
| 285 |
|
| 286 |
function _setRow(key, text, label) {
|
|
|
|
| 495 |
function unmount() {
|
| 496 |
for (const h of _handles) { try { h && h.stop && h.stop(); } catch (_) {} }
|
| 497 |
_handles.length = 0;
|
| 498 |
+
try { if (_show) _show.destroy(); } catch (_) {}
|
| 499 |
try {
|
| 500 |
if (_root) {
|
| 501 |
_root.traverse((o) => {
|
|
|
|
| 509 |
}
|
| 510 |
} catch (_) {}
|
| 511 |
try { if (_stage) _stage.setBloom(false); } catch (_) {}
|
| 512 |
+
_root = null; _overlay = null; _show = null; _scene = null; _frameFn = null; _hud = {}; _stage = null; _THREE = null; _ctx = null;
|
| 513 |
}
|
| 514 |
|
| 515 |
export default { id: ID, title: TITLE, endpoints: [EP_KPI, EP_ENERGY, EP_FABRIC, EP_PNT, EP_LOOP], mount, unmount };
|
static/3d/surfaces/fabric.js
CHANGED
|
@@ -28,6 +28,8 @@
|
|
| 28 |
// not a measured bandwidth — we do NOT claim measured NVLink bytes/sec. The reach
|
| 29 |
// counts ARE measured (live probe), labeled accordingly in the HUD.
|
| 30 |
|
|
|
|
|
|
|
| 31 |
const ID = "fabric";
|
| 32 |
const TITLE = "Compute Fabric";
|
| 33 |
const ENDPOINT = "/api/a11oy/v1/compute-pool-hardened";
|
|
@@ -46,7 +48,7 @@ const C = {
|
|
| 46 |
};
|
| 47 |
|
| 48 |
let _ctx = null, _stage = null, _THREE = null;
|
| 49 |
-
let _handle = null, _overlay = null, _panel = null, _detailChip = null;
|
| 50 |
let _root = null; // group holding the whole mesh (rotates slowly)
|
| 51 |
let _nodeMeshes = []; // [{ data, group, core, ring, glow, orbit[], labelSprite, basePos }]
|
| 52 |
let _edges = []; // [{ line, a, b, hot }]
|
|
@@ -114,17 +116,10 @@ function _nodeColor(node) {
|
|
| 114 |
// HUD overlay (left): title, LIVE badge, fabric-health ring readout, counts,
|
| 115 |
// honesty legend. Right panel: node-detail (click a node).
|
| 116 |
// ----------------------------------------------------------------------------
|
| 117 |
-
function _styleOverlay(el) {
|
| 118 |
-
Object.assign(el.style, {
|
| 119 |
-
position: "absolute", left: "14px", top: "14px", zIndex: "5",
|
| 120 |
-
display: "flex", flexDirection: "column", gap: "8px",
|
| 121 |
-
maxWidth: "min(92%,360px)", pointerEvents: "none",
|
| 122 |
-
});
|
| 123 |
-
}
|
| 124 |
function _row(label, valId) {
|
| 125 |
const r = document.createElement("div");
|
| 126 |
r.style.cssText = "display:flex;justify-content:space-between;gap:14px;" +
|
| 127 |
-
"font:11px ui-monospace,SFMono-Regular,Menlo,monospace;color:" + C.para
|
| 128 |
const k = document.createElement("span"); k.textContent = label;
|
| 129 |
const v = document.createElement("span"); v.id = valId;
|
| 130 |
v.style.cssText = "color:" + C.text + ";font-weight:600;letter-spacing:.3px";
|
|
@@ -135,22 +130,29 @@ function _row(label, valId) {
|
|
| 135 |
}
|
| 136 |
|
| 137 |
function _buildOverlay() {
|
| 138 |
-
const
|
| 139 |
-
ov.className = "szl3d-fabric-overlay";
|
| 140 |
-
_styleOverlay(ov);
|
| 141 |
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
ov.
|
|
|
|
|
|
|
|
|
|
| 150 |
|
| 151 |
const card = document.createElement("div");
|
| 152 |
card.style.cssText = "background:#0b121b;border:1px solid #1b2734;border-radius:9px;" +
|
| 153 |
-
"padding:9px 11px;display:flex;flexDirection:column;gap:5px
|
| 154 |
card.appendChild(_row("fabric health", "v_health"));
|
| 155 |
card.appendChild(_row("nodes reachable", "v_reach"));
|
| 156 |
card.appendChild(_row("GPU nodes live", "v_gpu"));
|
|
@@ -159,45 +161,12 @@ function _buildOverlay() {
|
|
| 159 |
card.appendChild(_row("reach probe", "v_label"));
|
| 160 |
ov.appendChild(card);
|
| 161 |
|
| 162 |
-
|
| 163 |
-
note.style.cssText = "font:9.5px ui-monospace,monospace;color:#6c7a86;line-height:1.5;pointerEvents:none";
|
| 164 |
-
note.textContent = "reachable = REAL TCP probe this sweep · sovereign = owned-hardware " +
|
| 165 |
-
"property, never inferred · topology is STRUCTURAL-ONLY (no measured NVLink bytes).";
|
| 166 |
-
ov.appendChild(note);
|
| 167 |
-
|
| 168 |
-
const legend = _ctx.label.legend();
|
| 169 |
-
legend.style.opacity = "0.85";
|
| 170 |
-
legend.style.pointerEvents = "none";
|
| 171 |
-
ov.appendChild(legend);
|
| 172 |
-
|
| 173 |
-
// "what this means" plain-language toggle (matches the research surfaces).
|
| 174 |
-
const pl = document.createElement("button");
|
| 175 |
-
pl.textContent = "◑ what this means";
|
| 176 |
-
pl.title = "Toggle plain-language explanation for investors & consumers.";
|
| 177 |
-
pl.style.cssText = "font:11px ui-monospace,monospace;padding:5px 11px;border-radius:7px;" +
|
| 178 |
-
"border:1px solid #3af4c8;background:#08140f;color:#3af4c8;cursor:pointer;width:fit-content;pointer-events:auto";
|
| 179 |
-
pl.addEventListener("click", () => {
|
| 180 |
-
_plain = !_plain;
|
| 181 |
-
pl.style.background = _plain ? "#0f2a20" : "#08140f";
|
| 182 |
-
_applyPlain();
|
| 183 |
-
});
|
| 184 |
-
ov.appendChild(pl);
|
| 185 |
-
|
| 186 |
-
const pd = document.createElement("div");
|
| 187 |
-
pd.style.cssText = "font-size:10.5px;color:#c9d6df;line-height:1.55;border:1px dashed #26333f;" +
|
| 188 |
-
"border-radius:7px;padding:7px 9px;display:none;pointer-events:none";
|
| 189 |
-
_plainEl = pd;
|
| 190 |
-
ov.appendChild(pd);
|
| 191 |
-
|
| 192 |
return { ov, badge };
|
| 193 |
}
|
| 194 |
|
| 195 |
-
function
|
| 196 |
-
|
| 197 |
-
if (!pd) return;
|
| 198 |
-
pd.style.display = _plain ? "block" : "none";
|
| 199 |
-
if (!_plain) return;
|
| 200 |
-
pd.innerHTML =
|
| 201 |
"<b>What this means:</b> This is a live map of the actual machines that make up the " +
|
| 202 |
"compute pool — each glowing node is one server. Every few seconds the app runs a " +
|
| 203 |
"real network probe (a <b>TCP reachability check</b>) against each node and colours it by " +
|
|
@@ -207,7 +176,7 @@ function _applyPlain() {
|
|
| 207 |
"result, not a cached guess. The links between nodes show the pool’s <b>structure only</b>; " +
|
| 208 |
"we do <b>not</b> claim to measure the bandwidth flowing over them. The ‘secondary lung’ row " +
|
| 209 |
"reports whether a designated failover node is currently reachable, so you can see at a glance " +
|
| 210 |
-
"if the backup capacity is online.";
|
| 211 |
}
|
| 212 |
|
| 213 |
function _buildPanel() {
|
|
@@ -695,8 +664,7 @@ function mount(ctx) {
|
|
| 695 |
_t = 0; _selected = null; _lastJson = null; _hud = {};
|
| 696 |
|
| 697 |
const built = _buildOverlay();
|
| 698 |
-
_overlay = built.ov;
|
| 699 |
-
(ctx.container || document.body).appendChild(_overlay);
|
| 700 |
|
| 701 |
_panel = _buildPanel();
|
| 702 |
(ctx.container || document.body).appendChild(_panel);
|
|
@@ -737,10 +705,10 @@ function unmount() {
|
|
| 737 |
_domEl._szlFabricDown = null;
|
| 738 |
}
|
| 739 |
} catch (_) {}
|
|
|
|
| 740 |
try { _clearMesh(); } catch (_) {}
|
| 741 |
-
try { if (_overlay && _overlay.parentNode) _overlay.parentNode.removeChild(_overlay); } catch (_) {}
|
| 742 |
try { if (_panel && _panel.parentNode) _panel.parentNode.removeChild(_panel); } catch (_) {}
|
| 743 |
-
_handle = null; _overlay = null; _panel = null; _detailChip = null;
|
| 744 |
_nodeMeshes = []; _edges = []; _root = null; _hubMesh = null;
|
| 745 |
_healthRing = null; _healthFill = null; _frameCb = null; _ray = null;
|
| 746 |
_pointer = null; _onClick = null; _onMove = null; _domEl = null;
|
|
|
|
| 28 |
// not a measured bandwidth — we do NOT claim measured NVLink bytes/sec. The reach
|
| 29 |
// counts ARE measured (live probe), labeled accordingly in the HUD.
|
| 30 |
|
| 31 |
+
import { createShowcase } from "./_showcase.js";
|
| 32 |
+
|
| 33 |
const ID = "fabric";
|
| 34 |
const TITLE = "Compute Fabric";
|
| 35 |
const ENDPOINT = "/api/a11oy/v1/compute-pool-hardened";
|
|
|
|
| 48 |
};
|
| 49 |
|
| 50 |
let _ctx = null, _stage = null, _THREE = null;
|
| 51 |
+
let _handle = null, _overlay = null, _panel = null, _detailChip = null, _show = null;
|
| 52 |
let _root = null; // group holding the whole mesh (rotates slowly)
|
| 53 |
let _nodeMeshes = []; // [{ data, group, core, ring, glow, orbit[], labelSprite, basePos }]
|
| 54 |
let _edges = []; // [{ line, a, b, hot }]
|
|
|
|
| 116 |
// HUD overlay (left): title, LIVE badge, fabric-health ring readout, counts,
|
| 117 |
// honesty legend. Right panel: node-detail (click a node).
|
| 118 |
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
function _row(label, valId) {
|
| 120 |
const r = document.createElement("div");
|
| 121 |
r.style.cssText = "display:flex;justify-content:space-between;gap:14px;" +
|
| 122 |
+
"font:11px ui-monospace,SFMono-Regular,Menlo,monospace;color:" + C.para;
|
| 123 |
const k = document.createElement("span"); k.textContent = label;
|
| 124 |
const v = document.createElement("span"); v.id = valId;
|
| 125 |
v.style.cssText = "color:" + C.text + ";font-weight:600;letter-spacing:.3px";
|
|
|
|
| 130 |
}
|
| 131 |
|
| 132 |
function _buildOverlay() {
|
| 133 |
+
const badge = _ctx.live.createBadge();
|
|
|
|
|
|
|
| 134 |
|
| 135 |
+
// Shared collapsible showcase supplies the compact chrome: title + LIVE badge +
|
| 136 |
+
// legend + the moved descriptive note + the "what this means" plain-language toggle.
|
| 137 |
+
// The counts rows fold into the (collapsed) body so the 3D node mesh stays the star.
|
| 138 |
+
_show = createShowcase(_ctx, {
|
| 139 |
+
id: ID, title: TITLE, accent: "#5b8dee", badge,
|
| 140 |
+
legend: ["LIVE", "MEASURED", "STRUCTURAL-ONLY"],
|
| 141 |
+
description: "reachable = REAL TCP probe this sweep · sovereign = owned-hardware " +
|
| 142 |
+
"property, never inferred · topology is STRUCTURAL-ONLY (no measured NVLink bytes).",
|
| 143 |
+
plain: { html: _plainHtml },
|
| 144 |
+
});
|
| 145 |
|
| 146 |
+
// rows fold into a plain (position:static) container inside the showcase body.
|
| 147 |
+
const ov = document.createElement("div");
|
| 148 |
+
ov.className = "szl3d-fabric-overlay";
|
| 149 |
+
Object.assign(ov.style, {
|
| 150 |
+
display: "flex", flexDirection: "column", gap: "8px",
|
| 151 |
+
});
|
| 152 |
|
| 153 |
const card = document.createElement("div");
|
| 154 |
card.style.cssText = "background:#0b121b;border:1px solid #1b2734;border-radius:9px;" +
|
| 155 |
+
"padding:9px 11px;display:flex;flexDirection:column;gap:5px";
|
| 156 |
card.appendChild(_row("fabric health", "v_health"));
|
| 157 |
card.appendChild(_row("nodes reachable", "v_reach"));
|
| 158 |
card.appendChild(_row("GPU nodes live", "v_gpu"));
|
|
|
|
| 161 |
card.appendChild(_row("reach probe", "v_label"));
|
| 162 |
ov.appendChild(card);
|
| 163 |
|
| 164 |
+
_show.body.appendChild(ov);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
return { ov, badge };
|
| 166 |
}
|
| 167 |
|
| 168 |
+
function _plainHtml() {
|
| 169 |
+
return (
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
"<b>What this means:</b> This is a live map of the actual machines that make up the " +
|
| 171 |
"compute pool — each glowing node is one server. Every few seconds the app runs a " +
|
| 172 |
"real network probe (a <b>TCP reachability check</b>) against each node and colours it by " +
|
|
|
|
| 176 |
"result, not a cached guess. The links between nodes show the pool’s <b>structure only</b>; " +
|
| 177 |
"we do <b>not</b> claim to measure the bandwidth flowing over them. The ‘secondary lung’ row " +
|
| 178 |
"reports whether a designated failover node is currently reachable, so you can see at a glance " +
|
| 179 |
+
"if the backup capacity is online.");
|
| 180 |
}
|
| 181 |
|
| 182 |
function _buildPanel() {
|
|
|
|
| 664 |
_t = 0; _selected = null; _lastJson = null; _hud = {};
|
| 665 |
|
| 666 |
const built = _buildOverlay();
|
| 667 |
+
_overlay = built.ov; // lives inside _show.body (appended by _buildOverlay)
|
|
|
|
| 668 |
|
| 669 |
_panel = _buildPanel();
|
| 670 |
(ctx.container || document.body).appendChild(_panel);
|
|
|
|
| 705 |
_domEl._szlFabricDown = null;
|
| 706 |
}
|
| 707 |
} catch (_) {}
|
| 708 |
+
try { if (_show) _show.destroy(); } catch (_) {}
|
| 709 |
try { _clearMesh(); } catch (_) {}
|
|
|
|
| 710 |
try { if (_panel && _panel.parentNode) _panel.parentNode.removeChild(_panel); } catch (_) {}
|
| 711 |
+
_handle = null; _overlay = null; _show = null; _panel = null; _detailChip = null;
|
| 712 |
_nodeMeshes = []; _edges = []; _root = null; _hubMesh = null;
|
| 713 |
_healthRing = null; _healthFill = null; _frameCb = null; _ray = null;
|
| 714 |
_pointer = null; _onClick = null; _onMove = null; _domEl = null;
|
static/3d/surfaces/flowmatch.js
CHANGED
|
@@ -43,6 +43,8 @@
|
|
| 43 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 44 |
// Nothing here is in the locked-8. Λ stays Conjecture 1. Trust never 100%.
|
| 45 |
|
|
|
|
|
|
|
| 46 |
const ID = "flowmatch";
|
| 47 |
const TITLE = "Rectified Flow · Flow-Matching ODE Sampler (live)";
|
| 48 |
|
|
@@ -61,9 +63,8 @@ const C_GRID = 0x1b3a44; // floor / link colour
|
|
| 61 |
// path layout geometry
|
| 62 |
const PATH_SCALE = 1.6; // world-units per unit of raw x/y/z coordinate
|
| 63 |
|
| 64 |
-
let _stage = null, _THREE = null, _ctx = null, _group = null,
|
| 65 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
| 66 |
-
let _plain = false;
|
| 67 |
|
| 68 |
// geometry handles
|
| 69 |
let _pathLine = null; // THREE.Line — Euler-integrated trajectory
|
|
@@ -275,110 +276,39 @@ function _onFrame() {
|
|
| 275 |
// overlay
|
| 276 |
// =============================================================================
|
| 277 |
function _buildOverlay() {
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
_overlay.appendChild(h);
|
| 292 |
-
|
| 293 |
-
const sub = document.createElement("div");
|
| 294 |
-
sub.style.cssText = "color:#9fb1bf;font-size:11px;line-height:1.55";
|
| 295 |
-
sub.innerHTML =
|
| 296 |
-
'A <b>rectified-flow ODE sampler</b>: integrate dx/dt = v(x,t) = x1 \u2212 x0 (a ' +
|
| 297 |
-
'<b>straight-line velocity field</b>) from noise x0 to a target x1 with Euler steps. ' +
|
| 298 |
-
'Honesty label <b>MODELED</b> (analytic toy case; NOT a trained flow/diffusion model; ' +
|
| 299 |
-
'never claimed as FLUX or SD3). 0 runtime CDN.';
|
| 300 |
-
_overlay.appendChild(sub);
|
| 301 |
-
|
| 302 |
-
const brow = document.createElement("div");
|
| 303 |
-
brow.style.cssText = "display:flex;gap:8px;align-items:center;flex-wrap:wrap";
|
| 304 |
-
if (_badge && _badge.el) brow.appendChild(_badge.el);
|
| 305 |
-
_overlay.appendChild(brow);
|
| 306 |
-
|
| 307 |
-
const card = document.createElement("div");
|
| 308 |
-
card.style.cssText = "background:#0a1117;border:1px solid #1d2a36;border-radius:9px;padding:9px 10px;display:flex;flex-direction:column;gap:6px";
|
| 309 |
-
|
| 310 |
-
const chead = document.createElement("div");
|
| 311 |
-
chead.style.cssText = "display:flex;align-items:center;gap:8px;flex-wrap:wrap";
|
| 312 |
-
const dot = document.createElement("span");
|
| 313 |
-
dot.style.cssText = "width:9px;height:9px;border-radius:50%;background:#5b8dee;box-shadow:0 0 7px #5b8dee";
|
| 314 |
-
const nm = document.createElement("b");
|
| 315 |
-
nm.style.cssText = "font-size:12px;color:#5b8dee;letter-spacing:.3px";
|
| 316 |
-
nm.textContent = "flow-matching";
|
| 317 |
-
chead.appendChild(dot); chead.appendChild(nm);
|
| 318 |
-
card.appendChild(chead);
|
| 319 |
-
|
| 320 |
-
const grid = document.createElement("div");
|
| 321 |
-
grid.style.cssText = "display:grid;grid-template-columns:1fr;gap:4px";
|
| 322 |
-
|
| 323 |
-
function kpiRow(id, label) {
|
| 324 |
-
const r = document.createElement("div");
|
| 325 |
-
r.style.cssText = "display:flex;justify-content:space-between;gap:10px;font-size:11px";
|
| 326 |
-
const l = document.createElement("span"); l.style.cssText = "color:#9fb1bf"; l.textContent = label;
|
| 327 |
-
const v = document.createElement("b");
|
| 328 |
-
v.id = id;
|
| 329 |
-
v.style.cssText = "font-variant-numeric:tabular-nums;color:#eef3f6;text-align:right;max-width:58%";
|
| 330 |
-
v.textContent = "\u2014";
|
| 331 |
-
_el[id] = v;
|
| 332 |
-
r.appendChild(l); r.appendChild(v); return r;
|
| 333 |
-
}
|
| 334 |
-
|
| 335 |
-
grid.appendChild(kpiRow("fm-dims", "dims"));
|
| 336 |
-
grid.appendChild(kpiRow("fm-steps", "steps (Euler)"));
|
| 337 |
-
grid.appendChild(kpiRow("fm-err", "final_error \u2014 MODELED"));
|
| 338 |
-
grid.appendChild(kpiRow("fm-straight","straightness_score"));
|
| 339 |
-
grid.appendChild(kpiRow("fm-conv", "steps_to_converge"));
|
| 340 |
-
grid.appendChild(kpiRow("fm-few", "few-step error"));
|
| 341 |
-
grid.appendChild(kpiRow("fm-many", "many-step error"));
|
| 342 |
-
grid.appendChild(kpiRow("fm-label", "honesty label"));
|
| 343 |
-
card.appendChild(grid);
|
| 344 |
-
|
| 345 |
-
const fn = document.createElement("div");
|
| 346 |
-
fn.style.cssText = "font-size:9.5px;color:#6b7a86;line-height:1.5";
|
| 347 |
-
fn.textContent = "Lipman et al. arXiv:2210.02747 (Flow Matching) \u00b7 Liu et al. arXiv:2209.03003 (Rectified Flow) \u00b7 FLUX github.com/black-forest-labs/flux (cited only). MODELED \u00b7 not claimed-as.";
|
| 348 |
-
card.appendChild(fn);
|
| 349 |
-
_overlay.appendChild(card);
|
| 350 |
-
|
| 351 |
-
const pl = document.createElement("button");
|
| 352 |
-
pl.textContent = "\u25d1 what this means";
|
| 353 |
-
pl.title = "Toggle plain-language explanation for investors & consumers.";
|
| 354 |
-
pl.style.cssText = "font:11px ui-monospace,monospace;padding:5px 11px;border-radius:7px;border:1px solid #3af4c8;background:#08140f;color:#3af4c8;cursor:pointer;width:fit-content";
|
| 355 |
-
pl.addEventListener("click", () => {
|
| 356 |
-
_plain = !_plain;
|
| 357 |
-
pl.style.background = _plain ? "#0f2a20" : "#08140f";
|
| 358 |
-
_applyPlain();
|
| 359 |
});
|
| 360 |
-
_overlay.appendChild(pl);
|
| 361 |
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
_el["
|
| 366 |
-
|
|
|
|
|
|
|
|
|
|
| 367 |
|
| 368 |
-
(ctx.container || document.body).appendChild(_overlay);
|
| 369 |
_paintOverlay();
|
| 370 |
}
|
| 371 |
|
| 372 |
-
function
|
| 373 |
-
const pd = _el["plain"];
|
| 374 |
-
if (!pd) return;
|
| 375 |
-
pd.style.display = _plain ? "block" : "none";
|
| 376 |
-
if (!_plain) return;
|
| 377 |
const steps = S.steps != null ? String(S.steps) : "loading\u2026";
|
| 378 |
const few = S.fewSteps != null ? String(S.fewSteps) : "1";
|
| 379 |
const many = S.manySteps != null ? String(S.manySteps) : "128";
|
| 380 |
const str = S.straightness != null ? (S.straightness * 100).toFixed(2) + "%" : "loading\u2026";
|
| 381 |
-
|
| 382 |
"<b>What this means:</b> Older generative-AI samplers (like standard diffusion) need " +
|
| 383 |
"<i>many small steps</i> to trace a curved path from random noise to a real output. " +
|
| 384 |
"<b>Rectified flow</b> instead learns (or here, defines) a <b>straight-line path</b> " +
|
|
@@ -387,7 +317,7 @@ function _applyPlain() {
|
|
| 387 |
"with barely any extra benefit. The path here is <b>" + str + " straight</b>. This is " +
|
| 388 |
"the same core idea behind fast production image generators like FLUX. This view is a " +
|
| 389 |
"<b>MODELED</b> analytic toy case (not a trained model, not FLUX itself), used at " +
|
| 390 |
-
"steps=" + steps + " to show the effect live.";
|
| 391 |
}
|
| 392 |
|
| 393 |
function _tok(s) {
|
|
@@ -414,7 +344,7 @@ function _paintOverlay() {
|
|
| 414 |
_set("fm-many", t || (S.manySteps != null ? `${sci(S.manyError, 2)} (n=${S.manySteps})` : "\u2014"));
|
| 415 |
// honesty label verbatim — never upgraded
|
| 416 |
_set("fm-label", t || (S.label || "MODELED"));
|
| 417 |
-
if (
|
| 418 |
}
|
| 419 |
|
| 420 |
// =============================================================================
|
|
@@ -422,7 +352,7 @@ function _paintOverlay() {
|
|
| 422 |
// =============================================================================
|
| 423 |
export function unmount() {
|
| 424 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 425 |
-
try { if (
|
| 426 |
try {
|
| 427 |
if (_group && _stage) {
|
| 428 |
_group.traverse((o) => {
|
|
@@ -435,9 +365,9 @@ export function unmount() {
|
|
| 435 |
_stage.scene.remove(_group);
|
| 436 |
}
|
| 437 |
} catch (_) {}
|
| 438 |
-
_group =
|
| 439 |
_pathLine = null; _pathDots = []; _x0Marker = null; _x1Marker = null; _converge = null; _floor = null;
|
| 440 |
-
_el = {}; _badge = null;
|
| 441 |
_stage = _THREE = _ctx = null;
|
| 442 |
S.label = S.dims = S.steps = S.x0 = S.x1 = S.trajectory = null;
|
| 443 |
S.finalError = S.straightness = S.stepsToConverge = null;
|
|
|
|
| 43 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 44 |
// Nothing here is in the locked-8. Λ stays Conjecture 1. Trust never 100%.
|
| 45 |
|
| 46 |
+
import { createShowcase } from "./_showcase.js";
|
| 47 |
+
|
| 48 |
const ID = "flowmatch";
|
| 49 |
const TITLE = "Rectified Flow · Flow-Matching ODE Sampler (live)";
|
| 50 |
|
|
|
|
| 63 |
// path layout geometry
|
| 64 |
const PATH_SCALE = 1.6; // world-units per unit of raw x/y/z coordinate
|
| 65 |
|
| 66 |
+
let _stage = null, _THREE = null, _ctx = null, _group = null, _show = null;
|
| 67 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
|
|
|
| 68 |
|
| 69 |
// geometry handles
|
| 70 |
let _pathLine = null; // THREE.Line — Euler-integrated trajectory
|
|
|
|
| 276 |
// overlay
|
| 277 |
// =============================================================================
|
| 278 |
function _buildOverlay() {
|
| 279 |
+
_show = createShowcase(_ctx, {
|
| 280 |
+
id: ID, title: TITLE, accent: "#5b8dee",
|
| 281 |
+
badge: _badge,
|
| 282 |
+
chips: [{ label: "MODELED", text: "flow-matching", name: "fm" }],
|
| 283 |
+
legend: ["MODELED"],
|
| 284 |
+
description:
|
| 285 |
+
'A <b>rectified-flow ODE sampler</b>: integrate dx/dt = v(x,t) = x1 \u2212 x0 (a ' +
|
| 286 |
+
'<b>straight-line velocity field</b>) from noise x0 to a target x1 with Euler steps. ' +
|
| 287 |
+
'Honesty label <b>MODELED</b> (analytic toy case; NOT a trained flow/diffusion model; ' +
|
| 288 |
+
'never claimed as FLUX or SD3). 0 runtime CDN.',
|
| 289 |
+
citations:
|
| 290 |
+
"Lipman et al. arXiv:2210.02747 (Flow Matching) \u00b7 Liu et al. arXiv:2209.03003 (Rectified Flow) \u00b7 FLUX github.com/black-forest-labs/flux (cited only). MODELED \u00b7 not claimed-as.",
|
| 291 |
+
plain: { html: _plainHtml },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 292 |
});
|
|
|
|
| 293 |
|
| 294 |
+
_el["fm-dims"] = _show.addField("dims");
|
| 295 |
+
_el["fm-steps"] = _show.addField("steps (Euler)");
|
| 296 |
+
_el["fm-err"] = _show.addField("final_error \u2014 MODELED");
|
| 297 |
+
_el["fm-straight"] = _show.addField("straightness_score");
|
| 298 |
+
_el["fm-conv"] = _show.addField("steps_to_converge");
|
| 299 |
+
_el["fm-few"] = _show.addField("few-step error");
|
| 300 |
+
_el["fm-many"] = _show.addField("many-step error");
|
| 301 |
+
_el["fm-label"] = _show.addField("honesty label");
|
| 302 |
|
|
|
|
| 303 |
_paintOverlay();
|
| 304 |
}
|
| 305 |
|
| 306 |
+
function _plainHtml() {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 307 |
const steps = S.steps != null ? String(S.steps) : "loading\u2026";
|
| 308 |
const few = S.fewSteps != null ? String(S.fewSteps) : "1";
|
| 309 |
const many = S.manySteps != null ? String(S.manySteps) : "128";
|
| 310 |
const str = S.straightness != null ? (S.straightness * 100).toFixed(2) + "%" : "loading\u2026";
|
| 311 |
+
return (
|
| 312 |
"<b>What this means:</b> Older generative-AI samplers (like standard diffusion) need " +
|
| 313 |
"<i>many small steps</i> to trace a curved path from random noise to a real output. " +
|
| 314 |
"<b>Rectified flow</b> instead learns (or here, defines) a <b>straight-line path</b> " +
|
|
|
|
| 317 |
"with barely any extra benefit. The path here is <b>" + str + " straight</b>. This is " +
|
| 318 |
"the same core idea behind fast production image generators like FLUX. This view is a " +
|
| 319 |
"<b>MODELED</b> analytic toy case (not a trained model, not FLUX itself), used at " +
|
| 320 |
+
"steps=" + steps + " to show the effect live.");
|
| 321 |
}
|
| 322 |
|
| 323 |
function _tok(s) {
|
|
|
|
| 344 |
_set("fm-many", t || (S.manySteps != null ? `${sci(S.manyError, 2)} (n=${S.manySteps})` : "\u2014"));
|
| 345 |
// honesty label verbatim — never upgraded
|
| 346 |
_set("fm-label", t || (S.label || "MODELED"));
|
| 347 |
+
if (_show) { _show.setChip("fm", S.label || "MODELED", { text: "flow-matching" }); _show.refreshPlain(); }
|
| 348 |
}
|
| 349 |
|
| 350 |
// =============================================================================
|
|
|
|
| 352 |
// =============================================================================
|
| 353 |
export function unmount() {
|
| 354 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 355 |
+
try { if (_show) _show.destroy(); } catch (_) {}
|
| 356 |
try {
|
| 357 |
if (_group && _stage) {
|
| 358 |
_group.traverse((o) => {
|
|
|
|
| 365 |
_stage.scene.remove(_group);
|
| 366 |
}
|
| 367 |
} catch (_) {}
|
| 368 |
+
_group = _show = null;
|
| 369 |
_pathLine = null; _pathDots = []; _x0Marker = null; _x1Marker = null; _converge = null; _floor = null;
|
| 370 |
+
_el = {}; _badge = null; _frameReg = false;
|
| 371 |
_stage = _THREE = _ctx = null;
|
| 372 |
S.label = S.dims = S.steps = S.x0 = S.x1 = S.trajectory = null;
|
| 373 |
S.finalError = S.straightness = S.stepsToConverge = null;
|
static/3d/surfaces/formalmath.js
CHANGED
|
@@ -40,6 +40,8 @@
|
|
| 40 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 41 |
// Nothing here is in the locked-8. Λ stays Conjecture 1. Trust never 100%.
|
| 42 |
|
|
|
|
|
|
|
| 43 |
const ID = "formalmath";
|
| 44 |
const TITLE = "Formal-Math Retrieval-Augmented Tactic Selection (live)";
|
| 45 |
|
|
@@ -62,9 +64,8 @@ const MAX_DEPTH = 6; // matches server _MAX_DEPTH
|
|
| 62 |
const MAX_TRACE = 64; // matches server search_trace cap
|
| 63 |
const BRANCH = 3; // matches server _BRANCH_FACTOR (layout hint only)
|
| 64 |
|
| 65 |
-
let _stage = null, _THREE = null, _ctx = null, _group = null,
|
| 66 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
| 67 |
-
let _plain = false;
|
| 68 |
|
| 69 |
// geometry handles
|
| 70 |
let _floor = null;
|
|
@@ -319,110 +320,39 @@ function _onFrame() {
|
|
| 319 |
// overlay
|
| 320 |
// =============================================================================
|
| 321 |
function _buildOverlay() {
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
const sub = document.createElement("div");
|
| 338 |
-
sub.style.cssText = "color:#9fb1bf;font-size:11px;line-height:1.55";
|
| 339 |
-
sub.innerHTML =
|
| 340 |
-
'Retrieves the most relevant <b>premises</b> for a goal by <b>cosine similarity</b> over ' +
|
| 341 |
-
'hand-rolled bag-of-tokens vectors (no embeddings), then runs a deterministic ' +
|
| 342 |
-
'<b>best-first search</b> over a synthetic tactic tree, biased by the retrieved premises ' +
|
| 343 |
-
'\u2014 the LeanDojo/ReProver premise-selection concept. Honesty label <b>MODELED</b> ' +
|
| 344 |
-
'(NOT connected to Lean 4 or Mathlib). 0 runtime CDN.';
|
| 345 |
-
_overlay.appendChild(sub);
|
| 346 |
-
|
| 347 |
-
const brow = document.createElement("div");
|
| 348 |
-
brow.style.cssText = "display:flex;gap:8px;align-items:center;flex-wrap:wrap";
|
| 349 |
-
if (_badge && _badge.el) brow.appendChild(_badge.el);
|
| 350 |
-
_overlay.appendChild(brow);
|
| 351 |
-
|
| 352 |
-
const card = document.createElement("div");
|
| 353 |
-
card.style.cssText = "background:#0a1117;border:1px solid #1d2a36;border-radius:9px;padding:9px 10px;display:flex;flex-direction:column;gap:6px";
|
| 354 |
-
|
| 355 |
-
const chead = document.createElement("div");
|
| 356 |
-
chead.style.cssText = "display:flex;align-items:center;gap:8px;flex-wrap:wrap";
|
| 357 |
-
const dot = document.createElement("span");
|
| 358 |
-
dot.style.cssText = "width:9px;height:9px;border-radius:50%;background:#3af4c8;box-shadow:0 0 7px #3af4c8";
|
| 359 |
-
const nm = document.createElement("b");
|
| 360 |
-
nm.style.cssText = "font-size:12px;color:#3af4c8;letter-spacing:.3px";
|
| 361 |
-
nm.textContent = "formal-math retrieval + tactic search";
|
| 362 |
-
chead.appendChild(dot); chead.appendChild(nm);
|
| 363 |
-
card.appendChild(chead);
|
| 364 |
-
|
| 365 |
-
const grid = document.createElement("div");
|
| 366 |
-
grid.style.cssText = "display:grid;grid-template-columns:1fr;gap:4px";
|
| 367 |
-
|
| 368 |
-
function kpiRow(id, label) {
|
| 369 |
-
const r = document.createElement("div");
|
| 370 |
-
r.style.cssText = "display:flex;justify-content:space-between;gap:10px;font-size:11px";
|
| 371 |
-
const l = document.createElement("span"); l.style.cssText = "color:#9fb1bf"; l.textContent = label;
|
| 372 |
-
const v = document.createElement("b");
|
| 373 |
-
v.id = id;
|
| 374 |
-
v.style.cssText = "font-variant-numeric:tabular-nums;color:#eef3f6;text-align:right;max-width:58%";
|
| 375 |
-
v.textContent = "\u2014";
|
| 376 |
-
_el[id] = v;
|
| 377 |
-
r.appendChild(l); r.appendChild(v); return r;
|
| 378 |
-
}
|
| 379 |
-
|
| 380 |
-
grid.appendChild(kpiRow("fm-goal", "goal"));
|
| 381 |
-
grid.appendChild(kpiRow("fm-corpus", "corpus_size"));
|
| 382 |
-
grid.appendChild(kpiRow("fm-k", "k (top-k retrieved)"));
|
| 383 |
-
grid.appendChild(kpiRow("fm-top", "top premise \u2014 MODELED"));
|
| 384 |
-
grid.appendChild(kpiRow("fm-sim", "top similarity"));
|
| 385 |
-
grid.appendChild(kpiRow("fm-depth", "proof-tree depth"));
|
| 386 |
-
grid.appendChild(kpiRow("fm-nodes", "nodes expanded"));
|
| 387 |
-
grid.appendChild(kpiRow("fm-label", "honesty label"));
|
| 388 |
-
card.appendChild(grid);
|
| 389 |
-
|
| 390 |
-
const fn = document.createElement("div");
|
| 391 |
-
fn.style.cssText = "font-size:9.5px;color:#6b7a86;line-height:1.5";
|
| 392 |
-
fn.textContent = "LeanDojo github.com/lean-dojo/LeanDojo \u00b7 ReProver github.com/lean-dojo/ReProver \u00b7 DeepSeek-Prover-V2 arXiv:2504.21801. MODELED \u00b7 not claimed-as.";
|
| 393 |
-
card.appendChild(fn);
|
| 394 |
-
_overlay.appendChild(card);
|
| 395 |
-
|
| 396 |
-
const pl = document.createElement("button");
|
| 397 |
-
pl.textContent = "\u25d1 what this means";
|
| 398 |
-
pl.title = "Toggle plain-language explanation for investors & consumers.";
|
| 399 |
-
pl.style.cssText = "font:11px ui-monospace,monospace;padding:5px 11px;border-radius:7px;border:1px solid #3af4c8;background:#08140f;color:#3af4c8;cursor:pointer;width:fit-content";
|
| 400 |
-
pl.addEventListener("click", () => {
|
| 401 |
-
_plain = !_plain;
|
| 402 |
-
pl.style.background = _plain ? "#0f2a20" : "#08140f";
|
| 403 |
-
_applyPlain();
|
| 404 |
});
|
| 405 |
-
_overlay.appendChild(pl);
|
| 406 |
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
_el["
|
| 411 |
-
|
|
|
|
|
|
|
|
|
|
| 412 |
|
| 413 |
-
(ctx.container || document.body).appendChild(_overlay);
|
| 414 |
_paintOverlay();
|
| 415 |
}
|
| 416 |
|
| 417 |
-
function
|
| 418 |
-
const pd = _el["plain"];
|
| 419 |
-
if (!pd) return;
|
| 420 |
-
pd.style.display = _plain ? "block" : "none";
|
| 421 |
-
if (!_plain) return;
|
| 422 |
const top = (S.topPremises && S.topPremises[0]) ? S.topPremises[0].name : "loading\u2026";
|
| 423 |
const simPct = (S.topPremises && S.topPremises[0]) ? (S.topPremises[0].similarity * 100).toFixed(1) + "%" : "loading\u2026";
|
| 424 |
const depth = S.treeDepth != null ? String(S.treeDepth) : "loading\u2026";
|
| 425 |
-
|
| 426 |
"<b>What this means:</b> Proving a math theorem in a system like Lean often needs the " +
|
| 427 |
"<i>right supporting fact</i> (a \u201cpremise\u201d) from a huge library. Instead of " +
|
| 428 |
"searching blindly, this organ scores every candidate premise by how many words it shares " +
|
|
@@ -431,7 +361,7 @@ function _applyPlain() {
|
|
| 431 |
"first \u2014 reaching a simulated depth of <b>" + depth + "</b> steps. Plain: find the most " +
|
| 432 |
"relevant facts first, then search smart instead of exhaustively. This is a <b>MODELED</b> " +
|
| 433 |
"toy simulation of the LeanDojo/ReProver idea \u2014 it is not connected to real Lean 4 or " +
|
| 434 |
-
"Mathlib, and is not DeepSeek-Prover or ReProver output.";
|
| 435 |
}
|
| 436 |
|
| 437 |
function _tok(s) {
|
|
@@ -458,7 +388,7 @@ function _paintOverlay() {
|
|
| 458 |
_set("fm-nodes", t || (S.nodesExpand != null ? String(S.nodesExpand) : "\u2014"));
|
| 459 |
// honesty label verbatim — never upgraded
|
| 460 |
_set("fm-label", t || (S.label || "MODELED"));
|
| 461 |
-
if (
|
| 462 |
}
|
| 463 |
|
| 464 |
// =============================================================================
|
|
@@ -466,7 +396,7 @@ function _paintOverlay() {
|
|
| 466 |
// =============================================================================
|
| 467 |
export function unmount() {
|
| 468 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 469 |
-
try { if (
|
| 470 |
try {
|
| 471 |
if (_group && _stage) {
|
| 472 |
_group.traverse((o) => {
|
|
@@ -479,9 +409,9 @@ export function unmount() {
|
|
| 479 |
_stage.scene.remove(_group);
|
| 480 |
}
|
| 481 |
} catch (_) {}
|
| 482 |
-
_group =
|
| 483 |
_floor = null; _spine = null; _nodeMesh = []; _edgeLines = []; _unexplLines = []; _marker = null;
|
| 484 |
-
_el = {}; _badge = null;
|
| 485 |
_stage = _THREE = _ctx = null;
|
| 486 |
S.label = S.goal = S.corpusSize = S.k = S.topPremises = S.simScores = null;
|
| 487 |
S.treeDepth = S.nodesExpand = S.trace = null;
|
|
|
|
| 40 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 41 |
// Nothing here is in the locked-8. Λ stays Conjecture 1. Trust never 100%.
|
| 42 |
|
| 43 |
+
import { createShowcase } from "./_showcase.js";
|
| 44 |
+
|
| 45 |
const ID = "formalmath";
|
| 46 |
const TITLE = "Formal-Math Retrieval-Augmented Tactic Selection (live)";
|
| 47 |
|
|
|
|
| 64 |
const MAX_TRACE = 64; // matches server search_trace cap
|
| 65 |
const BRANCH = 3; // matches server _BRANCH_FACTOR (layout hint only)
|
| 66 |
|
| 67 |
+
let _stage = null, _THREE = null, _ctx = null, _group = null, _show = null;
|
| 68 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
|
|
|
| 69 |
|
| 70 |
// geometry handles
|
| 71 |
let _floor = null;
|
|
|
|
| 320 |
// overlay
|
| 321 |
// =============================================================================
|
| 322 |
function _buildOverlay() {
|
| 323 |
+
_show = createShowcase(_ctx, {
|
| 324 |
+
id: ID, title: TITLE, accent: "#5b8dee",
|
| 325 |
+
badge: _badge,
|
| 326 |
+
chips: [{ label: "MODELED", text: "formal-math retrieval + tactic search", name: "hl" }],
|
| 327 |
+
legend: ["MODELED"],
|
| 328 |
+
description:
|
| 329 |
+
'Retrieves the most relevant <b>premises</b> for a goal by <b>cosine similarity</b> over ' +
|
| 330 |
+
'hand-rolled bag-of-tokens vectors (no embeddings), then runs a deterministic ' +
|
| 331 |
+
'<b>best-first search</b> over a synthetic tactic tree, biased by the retrieved premises ' +
|
| 332 |
+
'\u2014 the LeanDojo/ReProver premise-selection concept. Honesty label <b>MODELED</b> ' +
|
| 333 |
+
'(NOT connected to Lean 4 or Mathlib). 0 runtime CDN.',
|
| 334 |
+
citations:
|
| 335 |
+
"LeanDojo github.com/lean-dojo/LeanDojo \u00b7 ReProver github.com/lean-dojo/ReProver \u00b7 DeepSeek-Prover-V2 arXiv:2504.21801. MODELED \u00b7 not claimed-as.",
|
| 336 |
+
plain: { html: _plainHtml },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 337 |
});
|
|
|
|
| 338 |
|
| 339 |
+
_el["fm-goal"] = _show.addField("goal");
|
| 340 |
+
_el["fm-corpus"] = _show.addField("corpus_size");
|
| 341 |
+
_el["fm-k"] = _show.addField("k (top-k retrieved)");
|
| 342 |
+
_el["fm-top"] = _show.addField("top premise \u2014 MODELED");
|
| 343 |
+
_el["fm-sim"] = _show.addField("top similarity");
|
| 344 |
+
_el["fm-depth"] = _show.addField("proof-tree depth");
|
| 345 |
+
_el["fm-nodes"] = _show.addField("nodes expanded");
|
| 346 |
+
_el["fm-label"] = _show.addField("honesty label");
|
| 347 |
|
|
|
|
| 348 |
_paintOverlay();
|
| 349 |
}
|
| 350 |
|
| 351 |
+
function _plainHtml() {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 352 |
const top = (S.topPremises && S.topPremises[0]) ? S.topPremises[0].name : "loading\u2026";
|
| 353 |
const simPct = (S.topPremises && S.topPremises[0]) ? (S.topPremises[0].similarity * 100).toFixed(1) + "%" : "loading\u2026";
|
| 354 |
const depth = S.treeDepth != null ? String(S.treeDepth) : "loading\u2026";
|
| 355 |
+
return (
|
| 356 |
"<b>What this means:</b> Proving a math theorem in a system like Lean often needs the " +
|
| 357 |
"<i>right supporting fact</i> (a \u201cpremise\u201d) from a huge library. Instead of " +
|
| 358 |
"searching blindly, this organ scores every candidate premise by how many words it shares " +
|
|
|
|
| 361 |
"first \u2014 reaching a simulated depth of <b>" + depth + "</b> steps. Plain: find the most " +
|
| 362 |
"relevant facts first, then search smart instead of exhaustively. This is a <b>MODELED</b> " +
|
| 363 |
"toy simulation of the LeanDojo/ReProver idea \u2014 it is not connected to real Lean 4 or " +
|
| 364 |
+
"Mathlib, and is not DeepSeek-Prover or ReProver output.");
|
| 365 |
}
|
| 366 |
|
| 367 |
function _tok(s) {
|
|
|
|
| 388 |
_set("fm-nodes", t || (S.nodesExpand != null ? String(S.nodesExpand) : "\u2014"));
|
| 389 |
// honesty label verbatim — never upgraded
|
| 390 |
_set("fm-label", t || (S.label || "MODELED"));
|
| 391 |
+
if (_show) { _show.setChip("hl", S.label || "MODELED", { text: "formal-math retrieval + tactic search" }); _show.refreshPlain(); }
|
| 392 |
}
|
| 393 |
|
| 394 |
// =============================================================================
|
|
|
|
| 396 |
// =============================================================================
|
| 397 |
export function unmount() {
|
| 398 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 399 |
+
try { if (_show) _show.destroy(); } catch (_) {}
|
| 400 |
try {
|
| 401 |
if (_group && _stage) {
|
| 402 |
_group.traverse((o) => {
|
|
|
|
| 409 |
_stage.scene.remove(_group);
|
| 410 |
}
|
| 411 |
} catch (_) {}
|
| 412 |
+
_group = _show = null;
|
| 413 |
_floor = null; _spine = null; _nodeMesh = []; _edgeLines = []; _unexplLines = []; _marker = null;
|
| 414 |
+
_el = {}; _badge = null; _frameReg = false;
|
| 415 |
_stage = _THREE = _ctx = null;
|
| 416 |
S.label = S.goal = S.corpusSize = S.k = S.topPremises = S.simScores = null;
|
| 417 |
S.treeDepth = S.nodesExpand = S.trace = null;
|
static/3d/surfaces/frontier.js
CHANGED
|
@@ -37,6 +37,8 @@
|
|
| 37 |
// NOTHING here is in the locked-8. Λ = Conjecture 1. Trust < 100%. Endpoints that 404/error/
|
| 38 |
// degrade render honest NO-LIVE-DATA/DEGRADED and grey their geometry. 0 runtime CDN.
|
| 39 |
|
|
|
|
|
|
|
| 40 |
const ID = "frontier";
|
| 41 |
const TITLE = "Frontier · Experimental Tier (live)";
|
| 42 |
|
|
@@ -63,7 +65,7 @@ function ring(i, y) { const a = Math.PI / 2 - (i / N_ORG) * Math.PI * 2; return
|
|
| 63 |
const POS = { ent: ring(0, 3), neu: ring(1, 3), qb: ring(2, 3), en: ring(3, 3), scale: ring(4, 3), sc: ring(5, 3), conj: ring(6, 3), pubs: ring(7, 3), eco: ring(8, 3) };
|
| 64 |
const HUB = [0, 3, 0];
|
| 65 |
|
| 66 |
-
let _stage = null, _THREE = null, _ctx = null, _group = null, _overlay = null;
|
| 67 |
let _frameReg = false, _polls = [], _el = {}, _badges = {}, _webgpu = false, _computeReady = false;
|
| 68 |
let _ent = {}, _neu = {}, _qb = {}, _sc = {}, _en = {}, _scale = {}, _conj = {}, _pubs = {}, _eco = {};
|
| 69 |
let _splatlib = null, _lkg = null, _plain = false; // real-3DGS codec, Looking Glass runtime, plain-language mode
|
|
@@ -478,14 +480,26 @@ function _onFrame() {
|
|
| 478 |
function _buildOverlay() {
|
| 479 |
const ctx = _ctx;
|
| 480 |
["ent", "neu", "qbcoh", "qbcomp", "sc", "en", "scale", "conj", "pubs", "eco"].forEach((k) => { _badges[k] = ctx.live.createBadge(); });
|
| 481 |
-
_overlay = document.createElement("div");
|
| 482 |
-
Object.assign(_overlay.style, { position: "absolute", left: "14px", top: "14px", zIndex: "6", display: "flex", flexDirection: "column", gap: "8px", maxWidth: "min(94%,450px)", maxHeight: "calc(100vh - 130px)", overflowY: "auto", font: "12px ui-sans-serif,system-ui,Segoe UI,Roboto,Arial", color: "#eef3f6", paddingRight: "6px" });
|
| 483 |
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 489 |
|
| 490 |
const ctl = document.createElement("div"); ctl.style.cssText = "display:flex;gap:8px;align-items:center;flex-wrap:wrap";
|
| 491 |
_el.rchip = document.createElement("span"); _el.rchip.style.cssText = "font:10px ui-monospace,monospace;padding:3px 8px;border-radius:6px;border:1px solid #1d2a36;color:" + (_webgpu ? "#6dd47e" : "#6fb1ff"); _el.rchip.textContent = _webgpu ? "splat: WebGPU compute" : "splat: WebGL2"; ctl.appendChild(_el.rchip);
|
|
@@ -512,11 +526,9 @@ function _buildOverlay() {
|
|
| 512 |
_overlay.appendChild(_card("publications", "#9fd0ff", _badges.pubs, [["pubs-locked", "locked-proven"], ["pubs-lambda", "\u039b status"], ["pubs-kernel", "experimental kernel"]], "SZL corpus: 41 Zenodo DOIs, thesis v1\u2192v25 (Ouroboros \u2192 Lutar Invariant \u2192 GPD), ORCID 0009-0001-0110-4173. Locked-proven read live; \u039b = Conjecture 1 (unconditional machine-checked FALSE)."));
|
| 513 |
_overlay.appendChild(_card("ecosystem", "#3af4c8", _badges.eco, [["eco-count", "governed capabilities"], ["eco-proven", "locked-proven"], ["eco-mix", "honesty mix"]], "The investor/consumer headline: the live governed-capability genome (/genome). 5-tier honesty mix read VERBATIM \u2014 what is proven vs evidence-backed vs conjecture. The honest mix IS the diligence signal."));
|
| 514 |
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
_overlay.appendChild(src);
|
| 519 |
-
(ctx.container || document.body).appendChild(_overlay);
|
| 520 |
_paintEnt(); _paintNeu(); _paintQb(); _paintSc(); _paintEn(); _paintScale(); _paintConj(); _paintPubs(); _paintEco();
|
| 521 |
}
|
| 522 |
|
|
@@ -623,11 +635,11 @@ function _paintEco() { const t = _tok(S.eco.state); _set("eco-count", t || (S.ec
|
|
| 623 |
// =========================================================================================
|
| 624 |
function unmount() {
|
| 625 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 626 |
-
try { if (
|
| 627 |
try { if (_group && _stage) { _group.traverse((o) => { if (o.geometry && o.geometry.dispose) o.geometry.dispose(); if (o.material) { const m = Array.isArray(o.material) ? o.material : [o.material]; m.forEach((x) => { if (x.map && x.map.dispose) x.map.dispose(); if (x.dispose) x.dispose(); }); } }); _stage.scene.remove(_group); } } catch (_) {}
|
| 628 |
_splatTex = null;
|
| 629 |
try { if (_qb.real && _qb.real.dispose) _qb.real.dispose(); } catch (_) {}
|
| 630 |
-
_group = _overlay = null; _ent = {}; _neu = {}; _qb = {}; _sc = {}; _en = {}; _scale = {}; _conj = {}; _pubs = {}; _eco = {}; _el = {}; _badges = {};
|
| 631 |
_splatlib = _lkg = _realBytes = null; _plain = false;
|
| 632 |
_computeNode = _cohBuf = _uTau = _uT = null; _computeReady = false;
|
| 633 |
S.ent = { entropy: null, concurrence: null, negativity: null, state: "init" };
|
|
|
|
| 37 |
// NOTHING here is in the locked-8. Λ = Conjecture 1. Trust < 100%. Endpoints that 404/error/
|
| 38 |
// degrade render honest NO-LIVE-DATA/DEGRADED and grey their geometry. 0 runtime CDN.
|
| 39 |
|
| 40 |
+
import { createShowcase } from "./_showcase.js";
|
| 41 |
+
|
| 42 |
const ID = "frontier";
|
| 43 |
const TITLE = "Frontier · Experimental Tier (live)";
|
| 44 |
|
|
|
|
| 65 |
const POS = { ent: ring(0, 3), neu: ring(1, 3), qb: ring(2, 3), en: ring(3, 3), scale: ring(4, 3), sc: ring(5, 3), conj: ring(6, 3), pubs: ring(7, 3), eco: ring(8, 3) };
|
| 66 |
const HUB = [0, 3, 0];
|
| 67 |
|
| 68 |
+
let _stage = null, _THREE = null, _ctx = null, _group = null, _overlay = null, _show = null;
|
| 69 |
let _frameReg = false, _polls = [], _el = {}, _badges = {}, _webgpu = false, _computeReady = false;
|
| 70 |
let _ent = {}, _neu = {}, _qb = {}, _sc = {}, _en = {}, _scale = {}, _conj = {}, _pubs = {}, _eco = {};
|
| 71 |
let _splatlib = null, _lkg = null, _plain = false; // real-3DGS codec, Looking Glass runtime, plain-language mode
|
|
|
|
| 480 |
function _buildOverlay() {
|
| 481 |
const ctx = _ctx;
|
| 482 |
["ent", "neu", "qbcoh", "qbcomp", "sc", "en", "scale", "conj", "pubs", "eco"].forEach((k) => { _badges[k] = ctx.live.createBadge(); });
|
|
|
|
|
|
|
| 483 |
|
| 484 |
+
// Shared collapsible showcase chrome FIRST: compact title bar + honesty legend live in
|
| 485 |
+
// the always-visible chrome. This surface has MANY per-organ badges, so we omit a single
|
| 486 |
+
// `badge` and instead relocate the whole badge/card cluster into the (collapsed) body,
|
| 487 |
+
// keeping the 3D lattice the star. Long descriptive text -> description; the "adopted &
|
| 488 |
+
// cited" footnote -> citations (both verbatim).
|
| 489 |
+
_show = createShowcase(ctx, {
|
| 490 |
+
id: ID, title: TITLE, accent: "#5b8dee",
|
| 491 |
+
legend: ["RIGOROUS", "VERIFIED", "PUBLISHED", "OPEN", "CONJECTURE", "ROADMAP"],
|
| 492 |
+
description:
|
| 493 |
+
'The experimental tier as one holographic lattice \u2014 <b>nine frontier organs</b> on a ring, each lit by a <b>live</b> a11oy endpoint. ' +
|
| 494 |
+
'Quantum-bio renders as a <b>Gaussian-splat volumetric field</b> (WebGPU compute when enabled). Every label is read <b>verbatim</b> from the JSON. NOT in the locked-8 \u00b7 \u039b = Conjecture 1 \u00b7 trust < 100%.',
|
| 495 |
+
citations:
|
| 496 |
+
"Open techniques adopted & cited, NOT claimed-as (clean-room): QuTiP \u00b7 quimb \u00b7 RadicalPy \u00b7 quantum_HEOM \u00b7 Avalanche \u00b7 ncps/LTC \u00b7 Prime Intellect OpenDiLoCo \u00b7 NVIDIA nvtrust \u00b7 CodeCarbon \u00b7 GSF SCI \u00b7 three.js WebGPU \u00b7 GaussianSplats3D \u00b7 Looking Glass quilt. Papers: Kerbl 3DGS 2308.04079 \u00b7 Cirac-Verstraete 2011.12127 \u00b7 Dohare-Sutton (Nature 2024) \u00b7 Hore 2508.21350 \u00b7 Streaming DiLoCo 2501.18512. EXPERIMENTAL tier; not in the locked-8.",
|
| 497 |
+
});
|
| 498 |
+
|
| 499 |
+
// rows/cards fold into the showcase body as a PLAIN static container (no absolute chrome,
|
| 500 |
+
// no own title, no standalone legend \u2014 the showcase provides those).
|
| 501 |
+
_overlay = document.createElement("div");
|
| 502 |
+
Object.assign(_overlay.style, { display: "flex", flexDirection: "column", gap: "8px", font: "12px ui-sans-serif,system-ui,Segoe UI,Roboto,Arial", color: "#eef3f6" });
|
| 503 |
|
| 504 |
const ctl = document.createElement("div"); ctl.style.cssText = "display:flex;gap:8px;align-items:center;flex-wrap:wrap";
|
| 505 |
_el.rchip = document.createElement("span"); _el.rchip.style.cssText = "font:10px ui-monospace,monospace;padding:3px 8px;border-radius:6px;border:1px solid #1d2a36;color:" + (_webgpu ? "#6dd47e" : "#6fb1ff"); _el.rchip.textContent = _webgpu ? "splat: WebGPU compute" : "splat: WebGL2"; ctl.appendChild(_el.rchip);
|
|
|
|
| 526 |
_overlay.appendChild(_card("publications", "#9fd0ff", _badges.pubs, [["pubs-locked", "locked-proven"], ["pubs-lambda", "\u039b status"], ["pubs-kernel", "experimental kernel"]], "SZL corpus: 41 Zenodo DOIs, thesis v1\u2192v25 (Ouroboros \u2192 Lutar Invariant \u2192 GPD), ORCID 0009-0001-0110-4173. Locked-proven read live; \u039b = Conjecture 1 (unconditional machine-checked FALSE)."));
|
| 527 |
_overlay.appendChild(_card("ecosystem", "#3af4c8", _badges.eco, [["eco-count", "governed capabilities"], ["eco-proven", "locked-proven"], ["eco-mix", "honesty mix"]], "The investor/consumer headline: the live governed-capability genome (/genome). 5-tier honesty mix read VERBATIM \u2014 what is proven vs evidence-backed vs conjecture. The honest mix IS the diligence signal."));
|
| 528 |
|
| 529 |
+
// fold the whole control + badge/card cluster into the collapsible showcase body
|
| 530 |
+
// (the showcase provides the title bar + honesty legend; footnote moved to citations).
|
| 531 |
+
_show.body.appendChild(_overlay);
|
|
|
|
|
|
|
| 532 |
_paintEnt(); _paintNeu(); _paintQb(); _paintSc(); _paintEn(); _paintScale(); _paintConj(); _paintPubs(); _paintEco();
|
| 533 |
}
|
| 534 |
|
|
|
|
| 635 |
// =========================================================================================
|
| 636 |
function unmount() {
|
| 637 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 638 |
+
try { if (_show) _show.destroy(); } catch (_) {}
|
| 639 |
try { if (_group && _stage) { _group.traverse((o) => { if (o.geometry && o.geometry.dispose) o.geometry.dispose(); if (o.material) { const m = Array.isArray(o.material) ? o.material : [o.material]; m.forEach((x) => { if (x.map && x.map.dispose) x.map.dispose(); if (x.dispose) x.dispose(); }); } }); _stage.scene.remove(_group); } } catch (_) {}
|
| 640 |
_splatTex = null;
|
| 641 |
try { if (_qb.real && _qb.real.dispose) _qb.real.dispose(); } catch (_) {}
|
| 642 |
+
_group = _overlay = _show = null; _ent = {}; _neu = {}; _qb = {}; _sc = {}; _en = {}; _scale = {}; _conj = {}; _pubs = {}; _eco = {}; _el = {}; _badges = {};
|
| 643 |
_splatlib = _lkg = _realBytes = null; _plain = false;
|
| 644 |
_computeNode = _cohBuf = _uTau = _uT = null; _computeReady = false;
|
| 645 |
S.ent = { entropy: null, concurrence: null, negativity: null, state: "init" };
|
static/3d/surfaces/genie.js
CHANGED
|
@@ -47,6 +47,8 @@
|
|
| 47 |
// 0 RUNTIME CDN. Vendored three.js r170 via page importmap.
|
| 48 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 49 |
|
|
|
|
|
|
|
| 50 |
const ID = "genie";
|
| 51 |
const TITLE = "Genie · Generative Latent-Action World (live)";
|
| 52 |
|
|
@@ -66,9 +68,8 @@ const MAX_GRID = 16; // visual cap on grid_size (endpoint clamps grid<=64; we
|
|
| 66 |
const CELL = 0.62; // world-unit spacing between generated cells
|
| 67 |
const STEP_MS = 650; // ms between generated-rollout steps (one latent action applied per tick)
|
| 68 |
|
| 69 |
-
let _stage = null, _THREE = null, _ctx = null, _group = null,
|
| 70 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
| 71 |
-
let _plain = false;
|
| 72 |
|
| 73 |
// geometry handles
|
| 74 |
let _cells = []; // Array<THREE.Mesh> — one per generated grid cell (row-major)
|
|
@@ -285,106 +286,35 @@ function _onFrame() {
|
|
| 285 |
// overlay
|
| 286 |
// =============================================================================
|
| 287 |
function _buildOverlay() {
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
const sub = document.createElement("div");
|
| 304 |
-
sub.style.cssText = "color:#9fb1bf;font-size:11px;line-height:1.55";
|
| 305 |
-
sub.innerHTML =
|
| 306 |
-
'A small <b>latent-action codebook</b> is clustered from state deltas, then applied ' +
|
| 307 |
-
'step-by-step to <b>GENERATE</b> a brand-new grid-world \u2014 the grid you see evolving ' +
|
| 308 |
-
'below \u2014 rather than predicting a pre-recorded path. Honesty label <b>MODELED</b> ' +
|
| 309 |
-
'(a toy simulation of the Genie-style computation shape \u2014 no trained dynamics model, ' +
|
| 310 |
-
'no video tokenizer, no borrowed weights). 0 runtime CDN.';
|
| 311 |
-
_overlay.appendChild(sub);
|
| 312 |
-
|
| 313 |
-
const brow = document.createElement("div");
|
| 314 |
-
brow.style.cssText = "display:flex;gap:8px;align-items:center;flex-wrap:wrap";
|
| 315 |
-
if (_badge && _badge.el) brow.appendChild(_badge.el);
|
| 316 |
-
_overlay.appendChild(brow);
|
| 317 |
-
|
| 318 |
-
const card = document.createElement("div");
|
| 319 |
-
card.style.cssText = "background:#0a1117;border:1px solid #1d2a36;border-radius:9px;padding:9px 10px;display:flex;flex-direction:column;gap:6px";
|
| 320 |
-
|
| 321 |
-
const chead = document.createElement("div");
|
| 322 |
-
chead.style.cssText = "display:flex;align-items:center;gap:8px;flex-wrap:wrap";
|
| 323 |
-
const dot = document.createElement("span");
|
| 324 |
-
dot.style.cssText = "width:9px;height:9px;border-radius:50%;background:#5b8dee;box-shadow:0 0 7px #5b8dee";
|
| 325 |
-
const nm = document.createElement("b");
|
| 326 |
-
nm.style.cssText = "font-size:12px;color:#5b8dee;letter-spacing:.3px";
|
| 327 |
-
nm.textContent = "genie";
|
| 328 |
-
chead.appendChild(dot); chead.appendChild(nm);
|
| 329 |
-
card.appendChild(chead);
|
| 330 |
-
|
| 331 |
-
const grid = document.createElement("div");
|
| 332 |
-
grid.style.cssText = "display:grid;grid-template-columns:1fr;gap:4px";
|
| 333 |
-
|
| 334 |
-
function kpiRow(id, label) {
|
| 335 |
-
const r = document.createElement("div");
|
| 336 |
-
r.style.cssText = "display:flex;justify-content:space-between;gap:10px;font-size:11px";
|
| 337 |
-
const l = document.createElement("span"); l.style.cssText = "color:#9fb1bf"; l.textContent = label;
|
| 338 |
-
const v = document.createElement("b");
|
| 339 |
-
v.id = id;
|
| 340 |
-
v.style.cssText = "font-variant-numeric:tabular-nums;color:#eef3f6;text-align:right;max-width:58%";
|
| 341 |
-
v.textContent = "\u2014";
|
| 342 |
-
_el[id] = v;
|
| 343 |
-
r.appendChild(l); r.appendChild(v); return r;
|
| 344 |
-
}
|
| 345 |
-
|
| 346 |
-
grid.appendChild(kpiRow("gn-grid", "grid_size \u00d7 n_latent_actions"));
|
| 347 |
-
grid.appendChild(kpiRow("gn-step", "step (action code applied)"));
|
| 348 |
-
grid.appendChild(kpiRow("gn-seq", "action-code sequence"));
|
| 349 |
-
grid.appendChild(kpiRow("gn-coh", "coherence score \u2014 MODELED"));
|
| 350 |
-
grid.appendChild(kpiRow("gn-label", "honesty label"));
|
| 351 |
-
card.appendChild(grid);
|
| 352 |
-
|
| 353 |
-
const fn = document.createElement("div");
|
| 354 |
-
fn.style.cssText = "font-size:9.5px;color:#6b7a86;line-height:1.5";
|
| 355 |
-
fn.textContent = "Bruce, Segar, Mnih et al. arXiv:2402.15391 (Genie) \u00b7 deepmind.google Genie 2 blog \u00b7 deepmind.google Genie 3 blog. MODELED \u00b7 not claimed-as \u00b7 not claimed at parity.";
|
| 356 |
-
card.appendChild(fn);
|
| 357 |
-
_overlay.appendChild(card);
|
| 358 |
-
|
| 359 |
-
const pl = document.createElement("button");
|
| 360 |
-
pl.textContent = "\u25d1 what this means";
|
| 361 |
-
pl.title = "Toggle plain-language explanation for investors & consumers.";
|
| 362 |
-
pl.style.cssText = "font:11px ui-monospace,monospace;padding:5px 11px;border-radius:7px;border:1px solid #3af4c8;background:#08140f;color:#3af4c8;cursor:pointer;width:fit-content";
|
| 363 |
-
pl.addEventListener("click", () => {
|
| 364 |
-
_plain = !_plain;
|
| 365 |
-
pl.style.background = _plain ? "#0f2a20" : "#08140f";
|
| 366 |
-
_applyPlain();
|
| 367 |
});
|
| 368 |
-
_overlay.appendChild(pl);
|
| 369 |
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
_el["
|
| 374 |
-
|
| 375 |
|
| 376 |
-
(ctx.container || document.body).appendChild(_overlay);
|
| 377 |
_paintOverlay();
|
| 378 |
}
|
| 379 |
|
| 380 |
-
function
|
| 381 |
-
const pd = _el["plain"];
|
| 382 |
-
if (!pd) return;
|
| 383 |
-
pd.style.display = _plain ? "block" : "none";
|
| 384 |
-
if (!_plain) return;
|
| 385 |
const coh = S.coherence != null ? (S.coherence * 100).toFixed(1) + "%" : "loading\u2026";
|
| 386 |
const na = S.nActions != null ? String(S.nActions) : "loading\u2026";
|
| 387 |
-
|
| 388 |
"<b>What this means:</b> Instead of just watching and predicting a pre-recorded clip, " +
|
| 389 |
"this organ <b>generates a brand-new interactive world</b> one step at a time \u2014 each " +
|
| 390 |
"step conditioned on one of <b>" + na + "</b> discrete \u201clatent actions\u201d, the same " +
|
|
@@ -394,7 +324,7 @@ function _applyPlain() {
|
|
| 394 |
"step-to-step. " +
|
| 395 |
"Plain: this is the shape of computation behind a playable AI-generated world \u2014 but " +
|
| 396 |
"this view is a <b>MODELED</b> toy simulation of the technique, not a readout from any " +
|
| 397 |
-
"trained Genie model or real video.";
|
| 398 |
}
|
| 399 |
|
| 400 |
function _tok(s) {
|
|
@@ -418,7 +348,7 @@ function _paintOverlay(latestDelta) {
|
|
| 418 |
_set("gn-coh", t || fx(S.coherence, 4));
|
| 419 |
// honesty label verbatim — never upgraded
|
| 420 |
_set("gn-label", t || (S.label || "MODELED"));
|
| 421 |
-
if (
|
| 422 |
}
|
| 423 |
|
| 424 |
// =============================================================================
|
|
@@ -427,7 +357,7 @@ function _paintOverlay(latestDelta) {
|
|
| 427 |
export function unmount() {
|
| 428 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 429 |
if (_stepTimer) { clearInterval(_stepTimer); _stepTimer = null; }
|
| 430 |
-
try { if (
|
| 431 |
try {
|
| 432 |
if (_group && _stage) {
|
| 433 |
_group.traverse((o) => {
|
|
@@ -440,9 +370,9 @@ export function unmount() {
|
|
| 440 |
_stage.scene.remove(_group);
|
| 441 |
}
|
| 442 |
} catch (_) {}
|
| 443 |
-
_group =
|
| 444 |
_cells = []; _halo = null; _floor = null;
|
| 445 |
-
_el = {}; _badge = null;
|
| 446 |
_stage = _THREE = _ctx = null;
|
| 447 |
S.label = S.gridSize = S.nActions = S.horizon = null;
|
| 448 |
S.actionCodes = S.codebook = S.states = S.coherence = null;
|
|
|
|
| 47 |
// 0 RUNTIME CDN. Vendored three.js r170 via page importmap.
|
| 48 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 49 |
|
| 50 |
+
import { createShowcase } from "./_showcase.js";
|
| 51 |
+
|
| 52 |
const ID = "genie";
|
| 53 |
const TITLE = "Genie · Generative Latent-Action World (live)";
|
| 54 |
|
|
|
|
| 68 |
const CELL = 0.62; // world-unit spacing between generated cells
|
| 69 |
const STEP_MS = 650; // ms between generated-rollout steps (one latent action applied per tick)
|
| 70 |
|
| 71 |
+
let _stage = null, _THREE = null, _ctx = null, _group = null, _show = null;
|
| 72 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
|
|
|
| 73 |
|
| 74 |
// geometry handles
|
| 75 |
let _cells = []; // Array<THREE.Mesh> — one per generated grid cell (row-major)
|
|
|
|
| 286 |
// overlay
|
| 287 |
// =============================================================================
|
| 288 |
function _buildOverlay() {
|
| 289 |
+
_show = createShowcase(_ctx, {
|
| 290 |
+
id: ID, title: TITLE, accent: "#5b8dee",
|
| 291 |
+
badge: _badge,
|
| 292 |
+
chips: [{ label: "MODELED", text: "genie", name: "hl" }],
|
| 293 |
+
legend: ["MODELED"],
|
| 294 |
+
description:
|
| 295 |
+
'A small <b>latent-action codebook</b> is clustered from state deltas, then applied ' +
|
| 296 |
+
'step-by-step to <b>GENERATE</b> a brand-new grid-world \u2014 the grid you see evolving ' +
|
| 297 |
+
'below \u2014 rather than predicting a pre-recorded path. Honesty label <b>MODELED</b> ' +
|
| 298 |
+
'(a toy simulation of the Genie-style computation shape \u2014 no trained dynamics model, ' +
|
| 299 |
+
'no video tokenizer, no borrowed weights). 0 runtime CDN.',
|
| 300 |
+
citations:
|
| 301 |
+
"Bruce, Segar, Mnih et al. arXiv:2402.15391 (Genie) \u00b7 deepmind.google Genie 2 blog \u00b7 deepmind.google Genie 3 blog. MODELED \u00b7 not claimed-as \u00b7 not claimed at parity.",
|
| 302 |
+
plain: { html: _plainHtml },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 303 |
});
|
|
|
|
| 304 |
|
| 305 |
+
_el["gn-grid"] = _show.addField("grid_size \u00d7 n_latent_actions");
|
| 306 |
+
_el["gn-step"] = _show.addField("step (action code applied)");
|
| 307 |
+
_el["gn-seq"] = _show.addField("action-code sequence");
|
| 308 |
+
_el["gn-coh"] = _show.addField("coherence score \u2014 MODELED");
|
| 309 |
+
_el["gn-label"] = _show.addField("honesty label");
|
| 310 |
|
|
|
|
| 311 |
_paintOverlay();
|
| 312 |
}
|
| 313 |
|
| 314 |
+
function _plainHtml() {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 315 |
const coh = S.coherence != null ? (S.coherence * 100).toFixed(1) + "%" : "loading\u2026";
|
| 316 |
const na = S.nActions != null ? String(S.nActions) : "loading\u2026";
|
| 317 |
+
return (
|
| 318 |
"<b>What this means:</b> Instead of just watching and predicting a pre-recorded clip, " +
|
| 319 |
"this organ <b>generates a brand-new interactive world</b> one step at a time \u2014 each " +
|
| 320 |
"step conditioned on one of <b>" + na + "</b> discrete \u201clatent actions\u201d, the same " +
|
|
|
|
| 324 |
"step-to-step. " +
|
| 325 |
"Plain: this is the shape of computation behind a playable AI-generated world \u2014 but " +
|
| 326 |
"this view is a <b>MODELED</b> toy simulation of the technique, not a readout from any " +
|
| 327 |
+
"trained Genie model or real video.");
|
| 328 |
}
|
| 329 |
|
| 330 |
function _tok(s) {
|
|
|
|
| 348 |
_set("gn-coh", t || fx(S.coherence, 4));
|
| 349 |
// honesty label verbatim — never upgraded
|
| 350 |
_set("gn-label", t || (S.label || "MODELED"));
|
| 351 |
+
if (_show) { _show.setChip("hl", S.label || "MODELED", { text: "genie" }); _show.refreshPlain(); }
|
| 352 |
}
|
| 353 |
|
| 354 |
// =============================================================================
|
|
|
|
| 357 |
export function unmount() {
|
| 358 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 359 |
if (_stepTimer) { clearInterval(_stepTimer); _stepTimer = null; }
|
| 360 |
+
try { if (_show) _show.destroy(); } catch (_) {}
|
| 361 |
try {
|
| 362 |
if (_group && _stage) {
|
| 363 |
_group.traverse((o) => {
|
|
|
|
| 370 |
_stage.scene.remove(_group);
|
| 371 |
}
|
| 372 |
} catch (_) {}
|
| 373 |
+
_group = _show = null;
|
| 374 |
_cells = []; _halo = null; _floor = null;
|
| 375 |
+
_el = {}; _badge = null; _frameReg = false;
|
| 376 |
_stage = _THREE = _ctx = null;
|
| 377 |
S.label = S.gridSize = S.nActions = S.horizon = null;
|
| 378 |
S.actionCodes = S.codebook = S.states = S.coherence = null;
|
static/3d/surfaces/gitthoughts.js
CHANGED
|
@@ -50,6 +50,8 @@
|
|
| 50 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 51 |
// Nothing here is in the locked-8. Λ stays Conjecture 1. Trust never 100%.
|
| 52 |
|
|
|
|
|
|
|
| 53 |
const ID = "gitthoughts";
|
| 54 |
const TITLE = "GitOfThoughts (Version-Controlled Reasoning)";
|
| 55 |
|
|
@@ -84,9 +86,8 @@ const CURVE_H = 3.2; // curve panel height (accuracy 0..1)
|
|
| 84 |
const BAR_W = 0.7; // diff/merge bar width
|
| 85 |
const BAR_YSC = 0.32; // world-units per commit in the bars
|
| 86 |
|
| 87 |
-
let _stage = null, _THREE = null, _ctx = null, _group = null,
|
| 88 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
| 89 |
-
let _plain = false;
|
| 90 |
|
| 91 |
// geometry handles
|
| 92 |
let _floor = null;
|
|
@@ -453,119 +454,48 @@ function _onFrame() {
|
|
| 453 |
// overlay
|
| 454 |
// =============================================================================
|
| 455 |
function _buildOverlay() {
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
font: "12px ui-sans-serif,system-ui,Segoe UI,Roboto,Arial",
|
| 463 |
-
color: "#eef3f6",
|
| 464 |
-
});
|
| 465 |
-
|
| 466 |
-
const h = document.createElement("div");
|
| 467 |
-
h.style.cssText = "font:600 13px ui-sans-serif,system-ui;letter-spacing:.4px";
|
| 468 |
-
h.textContent = TITLE;
|
| 469 |
-
_overlay.appendChild(h);
|
| 470 |
-
|
| 471 |
-
const sub = document.createElement("div");
|
| 472 |
-
sub.style.cssText = "color:#9fb1bf;font-size:11px;line-height:1.55";
|
| 473 |
-
sub.innerHTML =
|
| 474 |
'GitOfThoughts stores an agent\u2019s reasoning tree as a <b>git repository</b>: every scored thought is a ' +
|
| 475 |
'<b>commit</b> (sha256 over parent+content+score \u2014 a Merkle DAG), scores are <b>notes</b>, outcomes are ' +
|
| 476 |
'<b>tags</b>, and retrieval is a <b>git log</b> DAG walk. This organ models the substrate \u2014 <b>log, replay, ' +
|
| 477 |
'diff, merge</b> \u2014 and the paper\u2019s honest <b>copyability threshold</b>: memory only helps once the ' +
|
| 478 |
'retrieved case is a near-duplicate (cosine similarity above <b>~0.8</b>); below it there is <b>no gain</b> ' +
|
| 479 |
'(the model finds the answer, it does not transfer the method). Panels: commit tree, threshold curve, ' +
|
| 480 |
-
'diff/merge bars. Honesty label <b>MODELED</b> (data-structure + finding reproduction; runs no LLM). 0 runtime CDN.'
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
brow.style.cssText = "display:flex;gap:8px;align-items:center;flex-wrap:wrap";
|
| 485 |
-
if (_badge && _badge.el) brow.appendChild(_badge.el);
|
| 486 |
-
_overlay.appendChild(brow);
|
| 487 |
-
|
| 488 |
-
const card = document.createElement("div");
|
| 489 |
-
card.style.cssText = "background:#0a1117;border:1px solid #1d2a36;border-radius:9px;padding:9px 10px;display:flex;flex-direction:column;gap:6px";
|
| 490 |
-
|
| 491 |
-
const chead = document.createElement("div");
|
| 492 |
-
chead.style.cssText = "display:flex;align-items:center;gap:8px;flex-wrap:wrap";
|
| 493 |
-
const dot = document.createElement("span");
|
| 494 |
-
dot.style.cssText = "width:9px;height:9px;border-radius:50%;background:#3af4c8;box-shadow:0 0 7px #3af4c8";
|
| 495 |
-
const nm = document.createElement("b");
|
| 496 |
-
nm.style.cssText = "font-size:12px;color:#3af4c8;letter-spacing:.3px";
|
| 497 |
-
nm.textContent = "gitofthoughts version-controlled reasoning";
|
| 498 |
-
chead.appendChild(dot); chead.appendChild(nm);
|
| 499 |
-
card.appendChild(chead);
|
| 500 |
-
|
| 501 |
-
const grid = document.createElement("div");
|
| 502 |
-
grid.style.cssText = "display:grid;grid-template-columns:1fr;gap:4px";
|
| 503 |
-
|
| 504 |
-
function kpiRow(id, label) {
|
| 505 |
-
const r = document.createElement("div");
|
| 506 |
-
r.style.cssText = "display:flex;justify-content:space-between;gap:10px;font-size:11px";
|
| 507 |
-
const l = document.createElement("span"); l.style.cssText = "color:#9fb1bf"; l.textContent = label;
|
| 508 |
-
const v = document.createElement("b");
|
| 509 |
-
v.id = id;
|
| 510 |
-
v.style.cssText = "font-variant-numeric:tabular-nums;color:#eef3f6;text-align:right;max-width:56%";
|
| 511 |
-
v.textContent = "\u2014";
|
| 512 |
-
_el[id] = v;
|
| 513 |
-
r.appendChild(l); r.appendChild(v); return r;
|
| 514 |
-
}
|
| 515 |
-
|
| 516 |
-
grid.appendChild(kpiRow("gt-tree", "reasoning tree (depth \u00d7 branch)"));
|
| 517 |
-
grid.appendChild(kpiRow("gt-commits", "commits (thoughts)"));
|
| 518 |
-
grid.appendChild(kpiRow("gt-leaves", "terminal thoughts (tagged)"));
|
| 519 |
-
grid.appendChild(kpiRow("gt-head", "HEAD sha (highest-scoring leaf)"));
|
| 520 |
-
grid.appendChild(kpiRow("gt-log", "git log length (HEAD\u2192root)"));
|
| 521 |
-
grid.appendChild(kpiRow("gt-replay", "replay verified (shas re-derived)"));
|
| 522 |
-
grid.appendChild(kpiRow("gt-diff", "diff (onlyA / shared / onlyB)"));
|
| 523 |
-
grid.appendChild(kpiRow("gt-merge", "merge (commits / conflicts)"));
|
| 524 |
-
grid.appendChild(kpiRow("gt-tags", "outcomes (solved / partial / dead)"));
|
| 525 |
-
grid.appendChild(kpiRow("gt-thr", "copyability threshold (cosine)"));
|
| 526 |
-
grid.appendChild(kpiRow("gt-jump", "accuracy jump across threshold"));
|
| 527 |
-
grid.appendChild(kpiRow("gt-below", "gain BELOW threshold (MEASURED)"));
|
| 528 |
-
grid.appendChild(kpiRow("gt-above", "gain ABOVE threshold (MEASURED)"));
|
| 529 |
-
grid.appendChild(kpiRow("gt-label", "honesty label"));
|
| 530 |
-
card.appendChild(grid);
|
| 531 |
-
|
| 532 |
-
const fn = document.createElement("div");
|
| 533 |
-
fn.style.cssText = "font-size:9.5px;color:#6b7a86;line-height:1.5";
|
| 534 |
-
fn.textContent = "GitOfThoughts \u2014 Shekar, Abhishek H S, Krishnan, arXiv:2606.14470 (arxiv.org/abs/2606.14470) \u00b7 git object model, Pro Git. MODELED \u00b7 data-structure + copyability-threshold reproduction; runs no LLM; memory does NOT improve novel-problem accuracy (reproduced honestly).";
|
| 535 |
-
card.appendChild(fn);
|
| 536 |
-
_overlay.appendChild(card);
|
| 537 |
-
|
| 538 |
-
const pl = document.createElement("button");
|
| 539 |
-
pl.textContent = "\u25d1 what this means";
|
| 540 |
-
pl.title = "Toggle plain-language explanation for investors & consumers.";
|
| 541 |
-
pl.style.cssText = "font:11px ui-monospace,monospace;padding:5px 11px;border-radius:7px;border:1px solid #3af4c8;background:#08140f;color:#3af4c8;cursor:pointer;width:fit-content";
|
| 542 |
-
pl.addEventListener("click", () => {
|
| 543 |
-
_plain = !_plain;
|
| 544 |
-
pl.style.background = _plain ? "#0f2a20" : "#08140f";
|
| 545 |
-
_applyPlain();
|
| 546 |
});
|
| 547 |
-
_overlay.appendChild(pl);
|
| 548 |
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
_el["
|
| 553 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 554 |
|
| 555 |
-
(ctx.container || document.body).appendChild(_overlay);
|
| 556 |
_paintOverlay();
|
| 557 |
}
|
| 558 |
|
| 559 |
-
function
|
| 560 |
-
const pd = _el["plain"];
|
| 561 |
-
if (!pd) return;
|
| 562 |
-
pd.style.display = _plain ? "block" : "none";
|
| 563 |
-
if (!_plain) return;
|
| 564 |
const thr = S.threshold != null ? S.threshold.toFixed(2) : "~0.80";
|
| 565 |
const jump = S.jumpSize != null ? (S.jumpSize * 100).toFixed(0) + " pts" : "loading\u2026";
|
| 566 |
const below = S.gainBelow != null ? (S.gainBelow * 100).toFixed(1) + "%" : "loading\u2026";
|
| 567 |
const comm = S.commitCount != null ? String(S.commitCount) : "loading\u2026";
|
| 568 |
-
|
| 569 |
"<b>What this means:</b> When an AI reasons, its train of thought vanishes the moment it finishes \u2014 you " +
|
| 570 |
"cannot audit it, replay it, or combine two agents\u2019 histories. GitOfThoughts fixes that by saving every " +
|
| 571 |
"thought as a <b>git commit</b>, exactly like version-controlling code: each thought gets a fingerprint " +
|
|
@@ -577,7 +507,7 @@ function _applyPlain() {
|
|
| 577 |
"method. Below that line, the gain is essentially zero (<b>" + below + "</b> here). This view reproduces both the " +
|
| 578 |
"data structure AND that honesty: the accuracy curve is flat until it <b>jumps by ~" + jump + "</b> right at the " +
|
| 579 |
"threshold. This is a <b>MODELED</b> demo \u2014 it runs no real AI and claims no accuracy improvement. The value of " +
|
| 580 |
-
"git-as-memory is <b>auditability and mergeability</b>, not smarter answers.";
|
| 581 |
}
|
| 582 |
|
| 583 |
function _tok(s) {
|
|
@@ -609,7 +539,7 @@ function _paintOverlay() {
|
|
| 609 |
_set("gt-above", t || pct(S.gainAbove, 1));
|
| 610 |
// honesty label verbatim — never upgraded
|
| 611 |
_set("gt-label", t || (S.label || "MODELED"));
|
| 612 |
-
if (
|
| 613 |
}
|
| 614 |
|
| 615 |
function fx0(v) { return typeof v === "number" ? String(v) : "\u2014"; }
|
|
@@ -619,7 +549,7 @@ function fx0(v) { return typeof v === "number" ? String(v) : "\u2014"; }
|
|
| 619 |
// =============================================================================
|
| 620 |
export function unmount() {
|
| 621 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 622 |
-
try { if (
|
| 623 |
try {
|
| 624 |
if (_group && _stage) {
|
| 625 |
_group.traverse((o) => {
|
|
@@ -632,12 +562,12 @@ export function unmount() {
|
|
| 632 |
_stage.scene.remove(_group);
|
| 633 |
}
|
| 634 |
} catch (_) {}
|
| 635 |
-
_group =
|
| 636 |
_floor = null;
|
| 637 |
_treeGroup = null;
|
| 638 |
_curveGroup = null;
|
| 639 |
_barGroup = null;
|
| 640 |
-
_el = {}; _badge = null;
|
| 641 |
_stage = _THREE = _ctx = null;
|
| 642 |
S.label = S.depth = S.branch = S.commitCount = S.leafCount = null;
|
| 643 |
S.headSha = S.rootSha = null;
|
|
|
|
| 50 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 51 |
// Nothing here is in the locked-8. Λ stays Conjecture 1. Trust never 100%.
|
| 52 |
|
| 53 |
+
import { createShowcase } from "./_showcase.js";
|
| 54 |
+
|
| 55 |
const ID = "gitthoughts";
|
| 56 |
const TITLE = "GitOfThoughts (Version-Controlled Reasoning)";
|
| 57 |
|
|
|
|
| 86 |
const BAR_W = 0.7; // diff/merge bar width
|
| 87 |
const BAR_YSC = 0.32; // world-units per commit in the bars
|
| 88 |
|
| 89 |
+
let _stage = null, _THREE = null, _ctx = null, _group = null, _show = null;
|
| 90 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
|
|
|
| 91 |
|
| 92 |
// geometry handles
|
| 93 |
let _floor = null;
|
|
|
|
| 454 |
// overlay
|
| 455 |
// =============================================================================
|
| 456 |
function _buildOverlay() {
|
| 457 |
+
_show = createShowcase(_ctx, {
|
| 458 |
+
id: ID, title: TITLE, accent: "#5b8dee",
|
| 459 |
+
badge: _badge,
|
| 460 |
+
chips: [{ label: "MODELED", text: "version-controlled reasoning", name: "hl" }],
|
| 461 |
+
legend: ["MEASURED", "MODELED"],
|
| 462 |
+
description:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 463 |
'GitOfThoughts stores an agent\u2019s reasoning tree as a <b>git repository</b>: every scored thought is a ' +
|
| 464 |
'<b>commit</b> (sha256 over parent+content+score \u2014 a Merkle DAG), scores are <b>notes</b>, outcomes are ' +
|
| 465 |
'<b>tags</b>, and retrieval is a <b>git log</b> DAG walk. This organ models the substrate \u2014 <b>log, replay, ' +
|
| 466 |
'diff, merge</b> \u2014 and the paper\u2019s honest <b>copyability threshold</b>: memory only helps once the ' +
|
| 467 |
'retrieved case is a near-duplicate (cosine similarity above <b>~0.8</b>); below it there is <b>no gain</b> ' +
|
| 468 |
'(the model finds the answer, it does not transfer the method). Panels: commit tree, threshold curve, ' +
|
| 469 |
+
'diff/merge bars. Honesty label <b>MODELED</b> (data-structure + finding reproduction; runs no LLM). 0 runtime CDN.',
|
| 470 |
+
citations:
|
| 471 |
+
"GitOfThoughts \u2014 Shekar, Abhishek H S, Krishnan, arXiv:2606.14470 (arxiv.org/abs/2606.14470) \u00b7 git object model, Pro Git. MODELED \u00b7 data-structure + copyability-threshold reproduction; runs no LLM; memory does NOT improve novel-problem accuracy (reproduced honestly).",
|
| 472 |
+
plain: { html: _plainHtml },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 473 |
});
|
|
|
|
| 474 |
|
| 475 |
+
_el["gt-tree"] = _show.addField("reasoning tree (depth \u00d7 branch)");
|
| 476 |
+
_el["gt-commits"] = _show.addField("commits (thoughts)");
|
| 477 |
+
_el["gt-leaves"] = _show.addField("terminal thoughts (tagged)");
|
| 478 |
+
_el["gt-head"] = _show.addField("HEAD sha (highest-scoring leaf)");
|
| 479 |
+
_el["gt-log"] = _show.addField("git log length (HEAD\u2192root)");
|
| 480 |
+
_el["gt-replay"] = _show.addField("replay verified (shas re-derived)");
|
| 481 |
+
_el["gt-diff"] = _show.addField("diff (onlyA / shared / onlyB)");
|
| 482 |
+
_el["gt-merge"] = _show.addField("merge (commits / conflicts)");
|
| 483 |
+
_el["gt-tags"] = _show.addField("outcomes (solved / partial / dead)");
|
| 484 |
+
_el["gt-thr"] = _show.addField("copyability threshold (cosine)");
|
| 485 |
+
_el["gt-jump"] = _show.addField("accuracy jump across threshold");
|
| 486 |
+
_el["gt-below"] = _show.addField("gain BELOW threshold (MEASURED)");
|
| 487 |
+
_el["gt-above"] = _show.addField("gain ABOVE threshold (MEASURED)");
|
| 488 |
+
_el["gt-label"] = _show.addField("honesty label");
|
| 489 |
|
|
|
|
| 490 |
_paintOverlay();
|
| 491 |
}
|
| 492 |
|
| 493 |
+
function _plainHtml() {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 494 |
const thr = S.threshold != null ? S.threshold.toFixed(2) : "~0.80";
|
| 495 |
const jump = S.jumpSize != null ? (S.jumpSize * 100).toFixed(0) + " pts" : "loading\u2026";
|
| 496 |
const below = S.gainBelow != null ? (S.gainBelow * 100).toFixed(1) + "%" : "loading\u2026";
|
| 497 |
const comm = S.commitCount != null ? String(S.commitCount) : "loading\u2026";
|
| 498 |
+
return (
|
| 499 |
"<b>What this means:</b> When an AI reasons, its train of thought vanishes the moment it finishes \u2014 you " +
|
| 500 |
"cannot audit it, replay it, or combine two agents\u2019 histories. GitOfThoughts fixes that by saving every " +
|
| 501 |
"thought as a <b>git commit</b>, exactly like version-controlling code: each thought gets a fingerprint " +
|
|
|
|
| 507 |
"method. Below that line, the gain is essentially zero (<b>" + below + "</b> here). This view reproduces both the " +
|
| 508 |
"data structure AND that honesty: the accuracy curve is flat until it <b>jumps by ~" + jump + "</b> right at the " +
|
| 509 |
"threshold. This is a <b>MODELED</b> demo \u2014 it runs no real AI and claims no accuracy improvement. The value of " +
|
| 510 |
+
"git-as-memory is <b>auditability and mergeability</b>, not smarter answers.");
|
| 511 |
}
|
| 512 |
|
| 513 |
function _tok(s) {
|
|
|
|
| 539 |
_set("gt-above", t || pct(S.gainAbove, 1));
|
| 540 |
// honesty label verbatim — never upgraded
|
| 541 |
_set("gt-label", t || (S.label || "MODELED"));
|
| 542 |
+
if (_show) { _show.setChip("hl", S.label || "MODELED", { text: "version-controlled reasoning" }); _show.refreshPlain(); }
|
| 543 |
}
|
| 544 |
|
| 545 |
function fx0(v) { return typeof v === "number" ? String(v) : "\u2014"; }
|
|
|
|
| 549 |
// =============================================================================
|
| 550 |
export function unmount() {
|
| 551 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 552 |
+
try { if (_show) _show.destroy(); } catch (_) {}
|
| 553 |
try {
|
| 554 |
if (_group && _stage) {
|
| 555 |
_group.traverse((o) => {
|
|
|
|
| 562 |
_stage.scene.remove(_group);
|
| 563 |
}
|
| 564 |
} catch (_) {}
|
| 565 |
+
_group = _show = null;
|
| 566 |
_floor = null;
|
| 567 |
_treeGroup = null;
|
| 568 |
_curveGroup = null;
|
| 569 |
_barGroup = null;
|
| 570 |
+
_el = {}; _badge = null; _frameReg = false;
|
| 571 |
_stage = _THREE = _ctx = null;
|
| 572 |
S.label = S.depth = S.branch = S.commitCount = S.leafCount = null;
|
| 573 |
S.headSha = S.rootSha = null;
|
static/3d/surfaces/goat.js
CHANGED
|
@@ -44,6 +44,8 @@
|
|
| 44 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 45 |
// Nothing here is in the locked-8. Λ stays Conjecture 1. Trust never 100%.
|
| 46 |
|
|
|
|
|
|
|
| 47 |
const ID = "goat";
|
| 48 |
const TITLE = "GOAT · Optimal-Transport Attention (live)";
|
| 49 |
|
|
@@ -68,9 +70,8 @@ const BAR_MAXH = 4.2; // max bar height for weight = 1.0
|
|
| 68 |
const CONV_LEN = 6.0; // world-length of the convergence trace along X
|
| 69 |
const MAX_CONV = 40; // cap on residual points rendered
|
| 70 |
|
| 71 |
-
let _stage = null, _THREE = null, _ctx = null, _group = null,
|
| 72 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
| 73 |
-
let _plain = false;
|
| 74 |
|
| 75 |
// geometry handles
|
| 76 |
let _floor = null;
|
|
@@ -344,110 +345,39 @@ function _onFrame() {
|
|
| 344 |
// overlay
|
| 345 |
// =============================================================================
|
| 346 |
function _buildOverlay() {
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
const sub = document.createElement("div");
|
| 363 |
-
sub.style.cssText = "color:#9fb1bf;font-size:11px;line-height:1.55";
|
| 364 |
-
sub.innerHTML =
|
| 365 |
-
'Plain <b>softmax</b> attention (left, lattice-blue) dumps runaway mass onto one token \u2014 the ' +
|
| 366 |
-
'<b>attention sink</b> (usually token 0). <b>GOAT</b> (right, proof-teal) reframes each attention row ' +
|
| 367 |
-
'as an <b>optimal-transport</b> problem: an entropic <b>Sinkhorn</b> plan with a <b>trainable key prior</b> ' +
|
| 368 |
-
'that pins the column mass, so the sink is structurally removed and mass spreads by relevance. ' +
|
| 369 |
-
'Honesty label <b>MODELED</b> (deterministic OT/Sinkhorn simulation; NOT a trained transformer). 0 runtime CDN.';
|
| 370 |
-
_overlay.appendChild(sub);
|
| 371 |
-
|
| 372 |
-
const brow = document.createElement("div");
|
| 373 |
-
brow.style.cssText = "display:flex;gap:8px;align-items:center;flex-wrap:wrap";
|
| 374 |
-
if (_badge && _badge.el) brow.appendChild(_badge.el);
|
| 375 |
-
_overlay.appendChild(brow);
|
| 376 |
-
|
| 377 |
-
const card = document.createElement("div");
|
| 378 |
-
card.style.cssText = "background:#0a1117;border:1px solid #1d2a36;border-radius:9px;padding:9px 10px;display:flex;flex-direction:column;gap:6px";
|
| 379 |
-
|
| 380 |
-
const chead = document.createElement("div");
|
| 381 |
-
chead.style.cssText = "display:flex;align-items:center;gap:8px;flex-wrap:wrap";
|
| 382 |
-
const dot = document.createElement("span");
|
| 383 |
-
dot.style.cssText = "width:9px;height:9px;border-radius:50%;background:#3af4c8;box-shadow:0 0 7px #3af4c8";
|
| 384 |
-
const nm = document.createElement("b");
|
| 385 |
-
nm.style.cssText = "font-size:12px;color:#3af4c8;letter-spacing:.3px";
|
| 386 |
-
nm.textContent = "optimal-transport attention";
|
| 387 |
-
chead.appendChild(dot); chead.appendChild(nm);
|
| 388 |
-
card.appendChild(chead);
|
| 389 |
-
|
| 390 |
-
const grid = document.createElement("div");
|
| 391 |
-
grid.style.cssText = "display:grid;grid-template-columns:1fr;gap:4px";
|
| 392 |
-
|
| 393 |
-
function kpiRow(id, label) {
|
| 394 |
-
const r = document.createElement("div");
|
| 395 |
-
r.style.cssText = "display:flex;justify-content:space-between;gap:10px;font-size:11px";
|
| 396 |
-
const l = document.createElement("span"); l.style.cssText = "color:#9fb1bf"; l.textContent = label;
|
| 397 |
-
const v = document.createElement("b");
|
| 398 |
-
v.id = id;
|
| 399 |
-
v.style.cssText = "font-variant-numeric:tabular-nums;color:#eef3f6;text-align:right;max-width:58%";
|
| 400 |
-
v.textContent = "\u2014";
|
| 401 |
-
_el[id] = v;
|
| 402 |
-
r.appendChild(l); r.appendChild(v); return r;
|
| 403 |
-
}
|
| 404 |
-
|
| 405 |
-
grid.appendChild(kpiRow("gt-dims", "queries \u00d7 keys (n_q \u00d7 n_k)"));
|
| 406 |
-
grid.appendChild(kpiRow("gt-reg", "Sinkhorn reg (temperature)"));
|
| 407 |
-
grid.appendChild(kpiRow("gt-prior", "key prior (trainable)"));
|
| 408 |
-
grid.appendChild(kpiRow("gt-sinks", "sink mass on token 0 \u2014 softmax"));
|
| 409 |
-
grid.appendChild(kpiRow("gt-sinkg", "sink mass on token 0 \u2014 GOAT"));
|
| 410 |
-
grid.appendChild(kpiRow("gt-sinkred", "sink removed by GOAT \u2014 MODELED"));
|
| 411 |
-
grid.appendChild(kpiRow("gt-conv", "Sinkhorn converged?"));
|
| 412 |
-
grid.appendChild(kpiRow("gt-label", "honesty label"));
|
| 413 |
-
card.appendChild(grid);
|
| 414 |
-
|
| 415 |
-
const fn = document.createElement("div");
|
| 416 |
-
fn.style.cssText = "font-size:9.5px;color:#6b7a86;line-height:1.5";
|
| 417 |
-
fn.textContent = "GOAT arXiv:2601.15380 (attention-as-OT) \u00b7 Sinkhorn: Cuturi arXiv:1306.0895 \u00b7 attention sinks: Xiao et al. arXiv:2309.17453. MODELED \u00b7 not claimed-as.";
|
| 418 |
-
card.appendChild(fn);
|
| 419 |
-
_overlay.appendChild(card);
|
| 420 |
-
|
| 421 |
-
const pl = document.createElement("button");
|
| 422 |
-
pl.textContent = "\u25d1 what this means";
|
| 423 |
-
pl.title = "Toggle plain-language explanation for investors & consumers.";
|
| 424 |
-
pl.style.cssText = "font:11px ui-monospace,monospace;padding:5px 11px;border-radius:7px;border:1px solid #3af4c8;background:#08140f;color:#3af4c8;cursor:pointer;width:fit-content";
|
| 425 |
-
pl.addEventListener("click", () => {
|
| 426 |
-
_plain = !_plain;
|
| 427 |
-
pl.style.background = _plain ? "#0f2a20" : "#08140f";
|
| 428 |
-
_applyPlain();
|
| 429 |
});
|
| 430 |
-
_overlay.appendChild(pl);
|
| 431 |
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
_el["
|
| 436 |
-
|
|
|
|
|
|
|
|
|
|
| 437 |
|
| 438 |
-
(ctx.container || document.body).appendChild(_overlay);
|
| 439 |
_paintOverlay();
|
| 440 |
}
|
| 441 |
|
| 442 |
-
function
|
| 443 |
-
const pd = _el["plain"];
|
| 444 |
-
if (!pd) return;
|
| 445 |
-
pd.style.display = _plain ? "block" : "none";
|
| 446 |
-
if (!_plain) return;
|
| 447 |
const ss = S.sinkSoft != null ? (S.sinkSoft * 100).toFixed(0) + "%" : "loading\u2026";
|
| 448 |
const sg = S.sinkGoat != null ? (S.sinkGoat * 100).toFixed(0) + "%" : "loading\u2026";
|
| 449 |
const red = S.sinkRed != null ? (S.sinkRed * 100).toFixed(0) + "%" : "loading\u2026";
|
| 450 |
-
|
| 451 |
"<b>What this means:</b> When a language model \u201cpays attention,\u201d it decides how much weight to put " +
|
| 452 |
"on each earlier word. Normal attention (<b>softmax</b>) has a bad habit: it parks a huge chunk of that " +
|
| 453 |
"weight on one throwaway token \u2014 usually the very first one \u2014 just to keep the rest of the row tidy. " +
|
|
@@ -456,7 +386,7 @@ function _applyPlain() {
|
|
| 456 |
"cargo\u201d and, crucially, a <b>learned rule</b> caps how much any single token is allowed to receive \u2014 so no " +
|
| 457 |
"token can hoard it. After GOAT, the sink token holds only about <b>" + sg + "</b>, a <b>" + red + " reduction</b>, " +
|
| 458 |
"and the freed-up attention flows to genuinely relevant words. This view is a <b>MODELED</b> deterministic " +
|
| 459 |
-
"simulation of the optimal-transport math (Sinkhorn), not a run of a real trained model.";
|
| 460 |
}
|
| 461 |
|
| 462 |
function _tok(s) {
|
|
@@ -482,7 +412,7 @@ function _paintOverlay() {
|
|
| 482 |
_set("gt-conv", t || (S.converged === true ? "yes (marginals matched)" : S.converged === false ? "not yet" : "\u2014"));
|
| 483 |
// honesty label verbatim — never upgraded
|
| 484 |
_set("gt-label", t || (S.label || "MODELED"));
|
| 485 |
-
if (
|
| 486 |
}
|
| 487 |
|
| 488 |
// =============================================================================
|
|
@@ -490,7 +420,7 @@ function _paintOverlay() {
|
|
| 490 |
// =============================================================================
|
| 491 |
export function unmount() {
|
| 492 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 493 |
-
try { if (
|
| 494 |
try {
|
| 495 |
if (_group && _stage) {
|
| 496 |
_group.traverse((o) => {
|
|
@@ -503,10 +433,10 @@ export function unmount() {
|
|
| 503 |
_stage.scene.remove(_group);
|
| 504 |
}
|
| 505 |
} catch (_) {}
|
| 506 |
-
_group =
|
| 507 |
_floor = null; _softBars = []; _goatBars = [];
|
| 508 |
_convLine = null; _convDots = []; _sinkRingS = null; _sinkRingG = null;
|
| 509 |
-
_el = {}; _badge = null;
|
| 510 |
_stage = _THREE = _ctx = null;
|
| 511 |
S.label = S.nQ = S.nK = S.iters = S.reg = S.prior = null;
|
| 512 |
S.sinkSoft = S.sinkGoat = S.sinkRed = S.residuals = S.attnSoft = S.attnGoat = S.converged = null;
|
|
|
|
| 44 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 45 |
// Nothing here is in the locked-8. Λ stays Conjecture 1. Trust never 100%.
|
| 46 |
|
| 47 |
+
import { createShowcase } from "./_showcase.js";
|
| 48 |
+
|
| 49 |
const ID = "goat";
|
| 50 |
const TITLE = "GOAT · Optimal-Transport Attention (live)";
|
| 51 |
|
|
|
|
| 70 |
const CONV_LEN = 6.0; // world-length of the convergence trace along X
|
| 71 |
const MAX_CONV = 40; // cap on residual points rendered
|
| 72 |
|
| 73 |
+
let _stage = null, _THREE = null, _ctx = null, _group = null, _show = null;
|
| 74 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
|
|
|
| 75 |
|
| 76 |
// geometry handles
|
| 77 |
let _floor = null;
|
|
|
|
| 345 |
// overlay
|
| 346 |
// =============================================================================
|
| 347 |
function _buildOverlay() {
|
| 348 |
+
_show = createShowcase(_ctx, {
|
| 349 |
+
id: ID, title: TITLE, accent: "#5b8dee",
|
| 350 |
+
badge: _badge,
|
| 351 |
+
chips: [{ label: "MODELED", text: "optimal-transport attention", name: "hl" }],
|
| 352 |
+
legend: ["MODELED"],
|
| 353 |
+
description:
|
| 354 |
+
'Plain <b>softmax</b> attention (left, lattice-blue) dumps runaway mass onto one token \u2014 the ' +
|
| 355 |
+
'<b>attention sink</b> (usually token 0). <b>GOAT</b> (right, proof-teal) reframes each attention row ' +
|
| 356 |
+
'as an <b>optimal-transport</b> problem: an entropic <b>Sinkhorn</b> plan with a <b>trainable key prior</b> ' +
|
| 357 |
+
'that pins the column mass, so the sink is structurally removed and mass spreads by relevance. ' +
|
| 358 |
+
'Honesty label <b>MODELED</b> (deterministic OT/Sinkhorn simulation; NOT a trained transformer). 0 runtime CDN.',
|
| 359 |
+
citations:
|
| 360 |
+
"GOAT arXiv:2601.15380 (attention-as-OT) \u00b7 Sinkhorn: Cuturi arXiv:1306.0895 \u00b7 attention sinks: Xiao et al. arXiv:2309.17453. MODELED \u00b7 not claimed-as.",
|
| 361 |
+
plain: { html: _plainHtml },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 362 |
});
|
|
|
|
| 363 |
|
| 364 |
+
_el["gt-dims"] = _show.addField("queries \u00d7 keys (n_q \u00d7 n_k)");
|
| 365 |
+
_el["gt-reg"] = _show.addField("Sinkhorn reg (temperature)");
|
| 366 |
+
_el["gt-prior"] = _show.addField("key prior (trainable)");
|
| 367 |
+
_el["gt-sinks"] = _show.addField("sink mass on token 0 \u2014 softmax");
|
| 368 |
+
_el["gt-sinkg"] = _show.addField("sink mass on token 0 \u2014 GOAT");
|
| 369 |
+
_el["gt-sinkred"] = _show.addField("sink removed by GOAT \u2014 MODELED");
|
| 370 |
+
_el["gt-conv"] = _show.addField("Sinkhorn converged?");
|
| 371 |
+
_el["gt-label"] = _show.addField("honesty label");
|
| 372 |
|
|
|
|
| 373 |
_paintOverlay();
|
| 374 |
}
|
| 375 |
|
| 376 |
+
function _plainHtml() {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 377 |
const ss = S.sinkSoft != null ? (S.sinkSoft * 100).toFixed(0) + "%" : "loading\u2026";
|
| 378 |
const sg = S.sinkGoat != null ? (S.sinkGoat * 100).toFixed(0) + "%" : "loading\u2026";
|
| 379 |
const red = S.sinkRed != null ? (S.sinkRed * 100).toFixed(0) + "%" : "loading\u2026";
|
| 380 |
+
return (
|
| 381 |
"<b>What this means:</b> When a language model \u201cpays attention,\u201d it decides how much weight to put " +
|
| 382 |
"on each earlier word. Normal attention (<b>softmax</b>) has a bad habit: it parks a huge chunk of that " +
|
| 383 |
"weight on one throwaway token \u2014 usually the very first one \u2014 just to keep the rest of the row tidy. " +
|
|
|
|
| 386 |
"cargo\u201d and, crucially, a <b>learned rule</b> caps how much any single token is allowed to receive \u2014 so no " +
|
| 387 |
"token can hoard it. After GOAT, the sink token holds only about <b>" + sg + "</b>, a <b>" + red + " reduction</b>, " +
|
| 388 |
"and the freed-up attention flows to genuinely relevant words. This view is a <b>MODELED</b> deterministic " +
|
| 389 |
+
"simulation of the optimal-transport math (Sinkhorn), not a run of a real trained model.");
|
| 390 |
}
|
| 391 |
|
| 392 |
function _tok(s) {
|
|
|
|
| 412 |
_set("gt-conv", t || (S.converged === true ? "yes (marginals matched)" : S.converged === false ? "not yet" : "\u2014"));
|
| 413 |
// honesty label verbatim — never upgraded
|
| 414 |
_set("gt-label", t || (S.label || "MODELED"));
|
| 415 |
+
if (_show) { _show.setChip("hl", S.label || "MODELED", { text: "optimal-transport attention" }); _show.refreshPlain(); }
|
| 416 |
}
|
| 417 |
|
| 418 |
// =============================================================================
|
|
|
|
| 420 |
// =============================================================================
|
| 421 |
export function unmount() {
|
| 422 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 423 |
+
try { if (_show) _show.destroy(); } catch (_) {}
|
| 424 |
try {
|
| 425 |
if (_group && _stage) {
|
| 426 |
_group.traverse((o) => {
|
|
|
|
| 433 |
_stage.scene.remove(_group);
|
| 434 |
}
|
| 435 |
} catch (_) {}
|
| 436 |
+
_group = _show = null;
|
| 437 |
_floor = null; _softBars = []; _goatBars = [];
|
| 438 |
_convLine = null; _convDots = []; _sinkRingS = null; _sinkRingG = null;
|
| 439 |
+
_el = {}; _badge = null; _frameReg = false;
|
| 440 |
_stage = _THREE = _ctx = null;
|
| 441 |
S.label = S.nQ = S.nK = S.iters = S.reg = S.prior = null;
|
| 442 |
S.sinkSoft = S.sinkGoat = S.sinkRed = S.residuals = S.attnSoft = S.attnGoat = S.converged = null;
|
static/3d/surfaces/governance.js
CHANGED
|
@@ -45,6 +45,8 @@
|
|
| 45 |
//
|
| 46 |
// CONTRACT: default-export { id, title, endpoints[], mount(ctx), unmount() }.
|
| 47 |
|
|
|
|
|
|
|
| 48 |
const ID = "governance";
|
| 49 |
const TITLE = "AI Governance · Assurance";
|
| 50 |
|
|
@@ -79,6 +81,7 @@ let _handles = []; // poll handles to stop on unmount
|
|
| 79 |
let _overlay = null, _graphPanel = null, _graph = null, _hud = {};
|
| 80 |
let _frameCb = null, _fgScript = null;
|
| 81 |
let _plain = false, _plainEl = null; // "what this means" plain-language toggle
|
|
|
|
| 82 |
const _state = {}; // last meta per endpoint (for HUD)
|
| 83 |
|
| 84 |
// ---------------------------------------------------------------------------
|
|
@@ -535,14 +538,19 @@ function _updateSbomFromArtifact(json) {
|
|
| 535 |
// OVERLAY HUD — badges per route + legend + teaching callout + SBOM panel
|
| 536 |
// ===========================================================================
|
| 537 |
function _buildOverlay(ctx) {
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 542 |
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
_overlay
|
| 546 |
|
| 547 |
// per-route live badges: LIVE routes first (drive the tab), then the PENDING ones.
|
| 548 |
const badgeWrap = el("div", "display:flex;flex-direction:column;gap:5px;pointer-events:auto");
|
|
@@ -576,10 +584,6 @@ function _buildOverlay(ctx) {
|
|
| 576 |
_hud.honest = el("div", "font:10px ui-monospace,Menlo,monospace;color:#7d8a96;line-height:1.5;pointer-events:auto", "build: awaiting /honest…");
|
| 577 |
_overlay.appendChild(_hud.honest);
|
| 578 |
|
| 579 |
-
// honesty legend (doctrine chips)
|
| 580 |
-
const legend = _label.legend(); legend.style.opacity = "0.9"; legend.style.pointerEvents = "auto";
|
| 581 |
-
_overlay.appendChild(legend);
|
| 582 |
-
|
| 583 |
// teaching callout (doctrine): signature ≠ safety
|
| 584 |
const teach = el("div",
|
| 585 |
"pointer-events:auto;margin-top:2px;padding:8px 10px;border:1px solid #3a2330;border-radius:8px;" +
|
|
@@ -619,8 +623,10 @@ function _buildOverlay(ctx) {
|
|
| 619 |
_hud.sbom = el("div", "position:absolute;left:8px;bottom:6px;z-index:2;font:9.5px ui-monospace,monospace;color:#7d8a96", "STRUCTURAL-ONLY · awaiting /assurance/artifact");
|
| 620 |
_graphPanel.appendChild(gh); _graphPanel.appendChild(_hud.sbom);
|
| 621 |
|
|
|
|
|
|
|
|
|
|
| 622 |
const host = ctx.container || document.body;
|
| 623 |
-
host.appendChild(_overlay);
|
| 624 |
host.appendChild(_graphPanel);
|
| 625 |
}
|
| 626 |
|
|
@@ -862,14 +868,17 @@ function _refreshStatus() {
|
|
| 862 |
function unmount() {
|
| 863 |
_handles.forEach((h) => { try { h.stop && h.stop(); } catch (_) {} });
|
| 864 |
_handles = [];
|
|
|
|
| 865 |
try { if (_frameCb && _stage && _stage.offFrame) _stage.offFrame(_frameCb); } catch (_) {}
|
| 866 |
_frameCb = null;
|
| 867 |
try { if (_graph && _graph._destructor) _graph._destructor(); } catch (_) {}
|
| 868 |
_graph = null;
|
| 869 |
try { if (_root && _stage) { disposeObj(_root); _stage.scene.remove(_root); } } catch (_) {}
|
| 870 |
_root = null;
|
| 871 |
-
|
| 872 |
-
|
|
|
|
|
|
|
| 873 |
_stage = null; _THREE = null; _label = null; _live = null;
|
| 874 |
for (const k in _state) delete _state[k];
|
| 875 |
}
|
|
|
|
| 45 |
//
|
| 46 |
// CONTRACT: default-export { id, title, endpoints[], mount(ctx), unmount() }.
|
| 47 |
|
| 48 |
+
import { createShowcase } from "./_showcase.js";
|
| 49 |
+
|
| 50 |
const ID = "governance";
|
| 51 |
const TITLE = "AI Governance · Assurance";
|
| 52 |
|
|
|
|
| 81 |
let _overlay = null, _graphPanel = null, _graph = null, _hud = {};
|
| 82 |
let _frameCb = null, _fgScript = null;
|
| 83 |
let _plain = false, _plainEl = null; // "what this means" plain-language toggle
|
| 84 |
+
let _show = null; // shared collapsible showcase chrome
|
| 85 |
const _state = {}; // last meta per endpoint (for HUD)
|
| 86 |
|
| 87 |
// ---------------------------------------------------------------------------
|
|
|
|
| 538 |
// OVERLAY HUD — badges per route + legend + teaching callout + SBOM panel
|
| 539 |
// ===========================================================================
|
| 540 |
function _buildOverlay(ctx) {
|
| 541 |
+
// Shared collapsible showcase chrome FIRST: compact title bar + honesty legend live in
|
| 542 |
+
// the always-visible chrome; the per-route badges + posture/gate/honest readouts + the
|
| 543 |
+
// teaching callout fold into the (collapsed) body so the 3D estate stays the star.
|
| 544 |
+
_show = createShowcase(ctx, {
|
| 545 |
+
id: ID, title: TITLE, accent: "#5b8dee",
|
| 546 |
+
legend: ["MEASURED", "MODELED", "HEURISTIC", "STRUCTURAL-ONLY"],
|
| 547 |
+
description:
|
| 548 |
+
"modeled on GUAC v1.0 · Sigstore/Rekor · SCITT — knowledge graph + Merkle hash-chain + crosswalk",
|
| 549 |
+
});
|
| 550 |
|
| 551 |
+
// rows fold into the showcase body as a PLAIN static container (no absolute chrome,
|
| 552 |
+
// no own title, no standalone legend — the showcase provides those).
|
| 553 |
+
_overlay = el("div", "display:flex;flex-direction:column;gap:9px");
|
| 554 |
|
| 555 |
// per-route live badges: LIVE routes first (drive the tab), then the PENDING ones.
|
| 556 |
const badgeWrap = el("div", "display:flex;flex-direction:column;gap:5px;pointer-events:auto");
|
|
|
|
| 584 |
_hud.honest = el("div", "font:10px ui-monospace,Menlo,monospace;color:#7d8a96;line-height:1.5;pointer-events:auto", "build: awaiting /honest…");
|
| 585 |
_overlay.appendChild(_hud.honest);
|
| 586 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 587 |
// teaching callout (doctrine): signature ≠ safety
|
| 588 |
const teach = el("div",
|
| 589 |
"pointer-events:auto;margin-top:2px;padding:8px 10px;border:1px solid #3a2330;border-radius:8px;" +
|
|
|
|
| 623 |
_hud.sbom = el("div", "position:absolute;left:8px;bottom:6px;z-index:2;font:9.5px ui-monospace,monospace;color:#7d8a96", "STRUCTURAL-ONLY · awaiting /assurance/artifact");
|
| 624 |
_graphPanel.appendChild(gh); _graphPanel.appendChild(_hud.sbom);
|
| 625 |
|
| 626 |
+
// fold the rows into the collapsible showcase body; the SBOM graph panel keeps its own
|
| 627 |
+
// absolute placement (it hosts the vendored ForceGraph3D canvas, which owns its GL context).
|
| 628 |
+
_show.body.appendChild(_overlay);
|
| 629 |
const host = ctx.container || document.body;
|
|
|
|
| 630 |
host.appendChild(_graphPanel);
|
| 631 |
}
|
| 632 |
|
|
|
|
| 868 |
function unmount() {
|
| 869 |
_handles.forEach((h) => { try { h.stop && h.stop(); } catch (_) {} });
|
| 870 |
_handles = [];
|
| 871 |
+
try { if (_show) _show.destroy(); } catch (_) {}
|
| 872 |
try { if (_frameCb && _stage && _stage.offFrame) _stage.offFrame(_frameCb); } catch (_) {}
|
| 873 |
_frameCb = null;
|
| 874 |
try { if (_graph && _graph._destructor) _graph._destructor(); } catch (_) {}
|
| 875 |
_graph = null;
|
| 876 |
try { if (_root && _stage) { disposeObj(_root); _stage.scene.remove(_root); } } catch (_) {}
|
| 877 |
_root = null;
|
| 878 |
+
// _overlay now lives inside the showcase (removed by _show.destroy()); only the SBOM
|
| 879 |
+
// graph panel is a standalone positioned node.
|
| 880 |
+
try { if (_graphPanel && _graphPanel.parentNode) _graphPanel.parentNode.removeChild(_graphPanel); } catch (_) {}
|
| 881 |
+
_show = null; _overlay = null; _graphPanel = null; _hud = {}; _plain = false; _plainEl = null;
|
| 882 |
_stage = null; _THREE = null; _label = null; _live = null;
|
| 883 |
for (const k in _state) delete _state[k];
|
| 884 |
}
|
static/3d/surfaces/graphmem.js
CHANGED
|
@@ -42,6 +42,8 @@
|
|
| 42 |
// 0 RUNTIME CDN. three.js via ctx.THREE (vendored r170 through the page importmap).
|
| 43 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 44 |
|
|
|
|
|
|
|
| 45 |
const ID = "graphmem";
|
| 46 |
const TITLE = "Multi-Graph Agentic Memory · MAGMA (live)";
|
| 47 |
|
|
@@ -63,9 +65,8 @@ const LAYER_EDGE_COL = { semantic: C_NODE, temporal: C_NODE, causal: C_TOP, enti
|
|
| 63 |
const N_SLOTS = 12; // memory items in the fixed synthetic corpus
|
| 64 |
const RADIUS = 6.5; // radius of the node ring within each layer plane
|
| 65 |
|
| 66 |
-
let _stage = null, _THREE = null, _ctx = null, _group = null,
|
| 67 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
| 68 |
-
let _plain = false;
|
| 69 |
|
| 70 |
// geometry handles
|
| 71 |
let _nodes = {}; // { layerName: Array<THREE.Mesh> } — node ring replicated per layer
|
|
@@ -309,111 +310,40 @@ function _onFrame() {
|
|
| 309 |
// overlay
|
| 310 |
// =============================================================================
|
| 311 |
function _buildOverlay() {
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
const sub = document.createElement("div");
|
| 328 |
-
sub.style.cssText = "color:#9fb1bf;font-size:11px;line-height:1.55";
|
| 329 |
-
sub.innerHTML =
|
| 330 |
-
'One synthetic memory corpus stored across <b>four typed graphs</b> \u2014 semantic, ' +
|
| 331 |
-
'temporal, causal, entity \u2014 shown as four stacked layers. A query runs a fixed ' +
|
| 332 |
-
'<b>policy-guided traversal</b>; the teal <b>PATH</b> shows exactly which node it ' +
|
| 333 |
-
'reached via which graph, versus a monolithic flat-BFS baseline. Honesty label ' +
|
| 334 |
-
'<b>MODELED</b> (toy symbolic sim; clean-room-inspired by MAGMA \u2014 not a ' +
|
| 335 |
-
'reproduction). 0 runtime CDN.';
|
| 336 |
-
_overlay.appendChild(sub);
|
| 337 |
-
|
| 338 |
-
const brow = document.createElement("div");
|
| 339 |
-
brow.style.cssText = "display:flex;gap:8px;align-items:center;flex-wrap:wrap";
|
| 340 |
-
if (_badge && _badge.el) brow.appendChild(_badge.el);
|
| 341 |
-
_overlay.appendChild(brow);
|
| 342 |
-
|
| 343 |
-
const card = document.createElement("div");
|
| 344 |
-
card.style.cssText = "background:#0a1117;border:1px solid #1d2a36;border-radius:9px;padding:9px 10px;display:flex;flex-direction:column;gap:6px";
|
| 345 |
-
|
| 346 |
-
const chead = document.createElement("div");
|
| 347 |
-
chead.style.cssText = "display:flex;align-items:center;gap:8px;flex-wrap:wrap";
|
| 348 |
-
const dot = document.createElement("span");
|
| 349 |
-
dot.style.cssText = "width:9px;height:9px;border-radius:50%;background:#5b8dee;box-shadow:0 0 7px #5b8dee";
|
| 350 |
-
const nm = document.createElement("b");
|
| 351 |
-
nm.style.cssText = "font-size:12px;color:#5b8dee;letter-spacing:.3px";
|
| 352 |
-
nm.textContent = "graphmem";
|
| 353 |
-
chead.appendChild(dot); chead.appendChild(nm);
|
| 354 |
-
card.appendChild(chead);
|
| 355 |
-
|
| 356 |
-
const grid = document.createElement("div");
|
| 357 |
-
grid.style.cssText = "display:grid;grid-template-columns:1fr;gap:4px";
|
| 358 |
-
|
| 359 |
-
function kpiRow(id, label) {
|
| 360 |
-
const r = document.createElement("div");
|
| 361 |
-
r.style.cssText = "display:flex;justify-content:space-between;gap:10px;font-size:11px";
|
| 362 |
-
const l = document.createElement("span"); l.style.cssText = "color:#9fb1bf"; l.textContent = label;
|
| 363 |
-
const v = document.createElement("b");
|
| 364 |
-
v.id = id;
|
| 365 |
-
v.style.cssText = "font-variant-numeric:tabular-nums;color:#eef3f6;text-align:right;max-width:60%";
|
| 366 |
-
v.textContent = "\u2014";
|
| 367 |
-
_el[id] = v;
|
| 368 |
-
r.appendChild(l); r.appendChild(v); return r;
|
| 369 |
-
}
|
| 370 |
-
|
| 371 |
-
grid.appendChild(kpiRow("gm-query", "query type"));
|
| 372 |
-
grid.appendChild(kpiRow("gm-typed", "typed traversal (retrieved \u2192 F1)"));
|
| 373 |
-
grid.appendChild(kpiRow("gm-flat", "flat baseline (retrieved \u2192 F1)"));
|
| 374 |
-
grid.appendChild(kpiRow("gm-gain", "F1 gain (typed \u2212 flat)"));
|
| 375 |
-
grid.appendChild(kpiRow("gm-hops", "traversal PATH hops"));
|
| 376 |
-
grid.appendChild(kpiRow("gm-label", "honesty label"));
|
| 377 |
-
card.appendChild(grid);
|
| 378 |
-
|
| 379 |
-
const fn = document.createElement("div");
|
| 380 |
-
fn.style.cssText = "font-size:9.5px;color:#6b7a86;line-height:1.5";
|
| 381 |
-
fn.textContent = "MAGMA arxiv.org/abs/2601.03236 (Jiang, Li, Li, Li) \u00b7 Multi-Agent Memory arxiv.org/abs/2603.10062 (Yu et al.). MODELED \u00b7 not claimed-as.";
|
| 382 |
-
card.appendChild(fn);
|
| 383 |
-
_overlay.appendChild(card);
|
| 384 |
-
|
| 385 |
-
const pl = document.createElement("button");
|
| 386 |
-
pl.textContent = "\u25d1 what this means";
|
| 387 |
-
pl.title = "Toggle plain-language explanation for investors & consumers.";
|
| 388 |
-
pl.style.cssText = "font:11px ui-monospace,monospace;padding:5px 11px;border-radius:7px;border:1px solid #3af4c8;background:#08140f;color:#3af4c8;cursor:pointer;width:fit-content";
|
| 389 |
-
pl.addEventListener("click", () => {
|
| 390 |
-
_plain = !_plain;
|
| 391 |
-
pl.style.background = _plain ? "#0f2a20" : "#08140f";
|
| 392 |
-
_applyPlain();
|
| 393 |
});
|
| 394 |
-
_overlay.appendChild(pl);
|
| 395 |
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
_el["
|
| 400 |
-
|
|
|
|
| 401 |
|
| 402 |
-
(ctx.container || document.body).appendChild(_overlay);
|
| 403 |
_paintOverlay();
|
| 404 |
}
|
| 405 |
|
| 406 |
-
function
|
| 407 |
-
const pd = _el["plain"];
|
| 408 |
-
if (!pd) return;
|
| 409 |
-
pd.style.display = _plain ? "block" : "none";
|
| 410 |
-
if (!_plain) return;
|
| 411 |
const qt = S.queryText || S.queryType || "loading\u2026";
|
| 412 |
const ts = (S.scores && S.scores.typed_traversal) ? S.scores.typed_traversal : null;
|
| 413 |
const bs = (S.scores && S.scores.flat_baseline) ? S.scores.flat_baseline : null;
|
| 414 |
const tf = ts ? fx(ts.f1, 3) : "\u2026";
|
| 415 |
const bf = bs ? fx(bs.f1, 3) : "\u2026";
|
| 416 |
-
|
| 417 |
"<b>What this means:</b> Most AI memory today is one big \u201csimilarity\u201d pile: ask " +
|
| 418 |
"a question and it hands back whatever looks vaguely related, with no way to say <i>how</i> " +
|
| 419 |
"it\u2019s related. This organ demonstrates a <b>different design</b>: the same memories are " +
|
|
@@ -428,7 +358,7 @@ function _applyPlain() {
|
|
| 428 |
"machine, not a learned agent; \u201crelevance\u201d is scored against a hand-labeled gold set. It " +
|
| 429 |
"shows the ordering/explainability advantage of typed traversal on constructed queries; it " +
|
| 430 |
"does <b>not</b> reproduce MAGMA\u2019s LoCoMo/LongMemEval results and makes no claim about real " +
|
| 431 |
-
"long-horizon agent performance.";
|
| 432 |
}
|
| 433 |
|
| 434 |
function _tok(s) {
|
|
@@ -456,7 +386,7 @@ function _paintOverlay() {
|
|
| 456 |
_set("gm-hops", t || (S.path ? String(S.path.length) : "\u2014"));
|
| 457 |
// honesty label verbatim — never upgraded
|
| 458 |
_set("gm-label", t || (S.label || "MODELED"));
|
| 459 |
-
if (
|
| 460 |
}
|
| 461 |
|
| 462 |
// =============================================================================
|
|
@@ -464,7 +394,7 @@ function _paintOverlay() {
|
|
| 464 |
// =============================================================================
|
| 465 |
export function unmount() {
|
| 466 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 467 |
-
try { if (
|
| 468 |
try {
|
| 469 |
if (_group && _stage) {
|
| 470 |
_group.traverse((o) => {
|
|
@@ -477,9 +407,9 @@ export function unmount() {
|
|
| 477 |
_stage.scene.remove(_group);
|
| 478 |
}
|
| 479 |
} catch (_) {}
|
| 480 |
-
_group =
|
| 481 |
_nodes = {}; _edgeLines = {}; _pathLines = null; _startMarker = {};
|
| 482 |
-
_el = {}; _badge = null;
|
| 483 |
_stage = _THREE = _ctx = null;
|
| 484 |
S.label = S.corpus = S.graphs = S.path = S.retrieved = S.baseRetr = null;
|
| 485 |
S.queryType = S.queryText = S.scores = null;
|
|
|
|
| 42 |
// 0 RUNTIME CDN. three.js via ctx.THREE (vendored r170 through the page importmap).
|
| 43 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 44 |
|
| 45 |
+
import { createShowcase } from "./_showcase.js";
|
| 46 |
+
|
| 47 |
const ID = "graphmem";
|
| 48 |
const TITLE = "Multi-Graph Agentic Memory · MAGMA (live)";
|
| 49 |
|
|
|
|
| 65 |
const N_SLOTS = 12; // memory items in the fixed synthetic corpus
|
| 66 |
const RADIUS = 6.5; // radius of the node ring within each layer plane
|
| 67 |
|
| 68 |
+
let _stage = null, _THREE = null, _ctx = null, _group = null, _show = null;
|
| 69 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
|
|
|
| 70 |
|
| 71 |
// geometry handles
|
| 72 |
let _nodes = {}; // { layerName: Array<THREE.Mesh> } — node ring replicated per layer
|
|
|
|
| 310 |
// overlay
|
| 311 |
// =============================================================================
|
| 312 |
function _buildOverlay() {
|
| 313 |
+
_show = createShowcase(_ctx, {
|
| 314 |
+
id: ID, title: TITLE, accent: "#5b8dee",
|
| 315 |
+
badge: _badge,
|
| 316 |
+
chips: [{ label: "MODELED", text: "graphmem", name: "hl" }],
|
| 317 |
+
legend: ["MODELED"],
|
| 318 |
+
description:
|
| 319 |
+
'One synthetic memory corpus stored across <b>four typed graphs</b> \u2014 semantic, ' +
|
| 320 |
+
'temporal, causal, entity \u2014 shown as four stacked layers. A query runs a fixed ' +
|
| 321 |
+
'<b>policy-guided traversal</b>; the teal <b>PATH</b> shows exactly which node it ' +
|
| 322 |
+
'reached via which graph, versus a monolithic flat-BFS baseline. Honesty label ' +
|
| 323 |
+
'<b>MODELED</b> (toy symbolic sim; clean-room-inspired by MAGMA \u2014 not a ' +
|
| 324 |
+
'reproduction). 0 runtime CDN.',
|
| 325 |
+
citations:
|
| 326 |
+
"MAGMA arxiv.org/abs/2601.03236 (Jiang, Li, Li, Li) \u00b7 Multi-Agent Memory arxiv.org/abs/2603.10062 (Yu et al.). MODELED \u00b7 not claimed-as.",
|
| 327 |
+
plain: { html: _plainHtml },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 328 |
});
|
|
|
|
| 329 |
|
| 330 |
+
_el["gm-query"] = _show.addField("query type");
|
| 331 |
+
_el["gm-typed"] = _show.addField("typed traversal (retrieved \u2192 F1)");
|
| 332 |
+
_el["gm-flat"] = _show.addField("flat baseline (retrieved \u2192 F1)");
|
| 333 |
+
_el["gm-gain"] = _show.addField("F1 gain (typed \u2212 flat)");
|
| 334 |
+
_el["gm-hops"] = _show.addField("traversal PATH hops");
|
| 335 |
+
_el["gm-label"] = _show.addField("honesty label");
|
| 336 |
|
|
|
|
| 337 |
_paintOverlay();
|
| 338 |
}
|
| 339 |
|
| 340 |
+
function _plainHtml() {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 341 |
const qt = S.queryText || S.queryType || "loading\u2026";
|
| 342 |
const ts = (S.scores && S.scores.typed_traversal) ? S.scores.typed_traversal : null;
|
| 343 |
const bs = (S.scores && S.scores.flat_baseline) ? S.scores.flat_baseline : null;
|
| 344 |
const tf = ts ? fx(ts.f1, 3) : "\u2026";
|
| 345 |
const bf = bs ? fx(bs.f1, 3) : "\u2026";
|
| 346 |
+
return (
|
| 347 |
"<b>What this means:</b> Most AI memory today is one big \u201csimilarity\u201d pile: ask " +
|
| 348 |
"a question and it hands back whatever looks vaguely related, with no way to say <i>how</i> " +
|
| 349 |
"it\u2019s related. This organ demonstrates a <b>different design</b>: the same memories are " +
|
|
|
|
| 358 |
"machine, not a learned agent; \u201crelevance\u201d is scored against a hand-labeled gold set. It " +
|
| 359 |
"shows the ordering/explainability advantage of typed traversal on constructed queries; it " +
|
| 360 |
"does <b>not</b> reproduce MAGMA\u2019s LoCoMo/LongMemEval results and makes no claim about real " +
|
| 361 |
+
"long-horizon agent performance.");
|
| 362 |
}
|
| 363 |
|
| 364 |
function _tok(s) {
|
|
|
|
| 386 |
_set("gm-hops", t || (S.path ? String(S.path.length) : "\u2014"));
|
| 387 |
// honesty label verbatim — never upgraded
|
| 388 |
_set("gm-label", t || (S.label || "MODELED"));
|
| 389 |
+
if (_show) { _show.setChip("hl", S.label || "MODELED", { text: "graphmem" }); _show.refreshPlain(); }
|
| 390 |
}
|
| 391 |
|
| 392 |
// =============================================================================
|
|
|
|
| 394 |
// =============================================================================
|
| 395 |
export function unmount() {
|
| 396 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 397 |
+
try { if (_show) _show.destroy(); } catch (_) {}
|
| 398 |
try {
|
| 399 |
if (_group && _stage) {
|
| 400 |
_group.traverse((o) => {
|
|
|
|
| 407 |
_stage.scene.remove(_group);
|
| 408 |
}
|
| 409 |
} catch (_) {}
|
| 410 |
+
_group = _show = null;
|
| 411 |
_nodes = {}; _edgeLines = {}; _pathLines = null; _startMarker = {};
|
| 412 |
+
_el = {}; _badge = null; _frameReg = false;
|
| 413 |
_stage = _THREE = _ctx = null;
|
| 414 |
S.label = S.corpus = S.graphs = S.path = S.retrieved = S.baseRetr = null;
|
| 415 |
S.queryType = S.queryText = S.scores = null;
|
static/3d/surfaces/grpo.js
CHANGED
|
@@ -42,6 +42,8 @@
|
|
| 42 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 43 |
// Nothing here is in the locked-8. Λ stays Conjecture 1. Trust never 100%.
|
| 44 |
|
|
|
|
|
|
|
| 45 |
const ID = "grpo";
|
| 46 |
const TITLE = "GRPO Reward Dynamics · Group-Relative Advantage (live)";
|
| 47 |
|
|
@@ -71,9 +73,8 @@ const MAX_STEPS = 14; // number of recent steps rendered along the axis
|
|
| 71 |
const MAX_SAMPLES = 16; // cap on group_size rendered per step (perf)
|
| 72 |
const ADV_SCALE = 1.6; // world-units of height per unit of |advantage|
|
| 73 |
|
| 74 |
-
let _stage = null, _THREE = null, _ctx = null, _group = null,
|
| 75 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
| 76 |
-
let _plain = false;
|
| 77 |
|
| 78 |
// geometry handles
|
| 79 |
let _floor = null;
|
|
@@ -332,112 +333,41 @@ function _onFrame() {
|
|
| 332 |
// overlay
|
| 333 |
// =============================================================================
|
| 334 |
function _buildOverlay() {
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
const sub = document.createElement("div");
|
| 351 |
-
sub.style.cssText = "color:#9fb1bf;font-size:11px;line-height:1.55";
|
| 352 |
-
sub.innerHTML =
|
| 353 |
-
'GRPO samples a <b>group</b> of completions per step and normalizes each reward against ' +
|
| 354 |
-
'the group\'s own mean/std \u2014 <b>no critic network</b> needed. The policy is updated via a ' +
|
| 355 |
-
'PPO-clip surrogate (\u03b5=0.2) on that group-relative advantage, plus a KL penalty vs a fixed ' +
|
| 356 |
-
'reference policy. Honesty label <b>MODELED</b> (deterministic group-advantage + PPO-clip + KL ' +
|
| 357 |
-
'arithmetic; NOT a trained policy). 0 runtime CDN.';
|
| 358 |
-
_overlay.appendChild(sub);
|
| 359 |
-
|
| 360 |
-
const brow = document.createElement("div");
|
| 361 |
-
brow.style.cssText = "display:flex;gap:8px;align-items:center;flex-wrap:wrap";
|
| 362 |
-
if (_badge && _badge.el) brow.appendChild(_badge.el);
|
| 363 |
-
_overlay.appendChild(brow);
|
| 364 |
-
|
| 365 |
-
const card = document.createElement("div");
|
| 366 |
-
card.style.cssText = "background:#0a1117;border:1px solid #1d2a36;border-radius:9px;padding:9px 10px;display:flex;flex-direction:column;gap:6px";
|
| 367 |
-
|
| 368 |
-
const chead = document.createElement("div");
|
| 369 |
-
chead.style.cssText = "display:flex;align-items:center;gap:8px;flex-wrap:wrap";
|
| 370 |
-
const dot = document.createElement("span");
|
| 371 |
-
dot.style.cssText = "width:9px;height:9px;border-radius:50%;background:#3af4c8;box-shadow:0 0 7px #3af4c8";
|
| 372 |
-
const nm = document.createElement("b");
|
| 373 |
-
nm.style.cssText = "font-size:12px;color:#3af4c8;letter-spacing:.3px";
|
| 374 |
-
nm.textContent = "GRPO reward dynamics";
|
| 375 |
-
chead.appendChild(dot); chead.appendChild(nm);
|
| 376 |
-
card.appendChild(chead);
|
| 377 |
-
|
| 378 |
-
const grid = document.createElement("div");
|
| 379 |
-
grid.style.cssText = "display:grid;grid-template-columns:1fr;gap:4px";
|
| 380 |
-
|
| 381 |
-
function kpiRow(id, label) {
|
| 382 |
-
const r = document.createElement("div");
|
| 383 |
-
r.style.cssText = "display:flex;justify-content:space-between;gap:10px;font-size:11px";
|
| 384 |
-
const l = document.createElement("span"); l.style.cssText = "color:#9fb1bf"; l.textContent = label;
|
| 385 |
-
const v = document.createElement("b");
|
| 386 |
-
v.id = id;
|
| 387 |
-
v.style.cssText = "font-variant-numeric:tabular-nums;color:#eef3f6;text-align:right;max-width:58%";
|
| 388 |
-
v.textContent = "\u2014";
|
| 389 |
-
_el[id] = v;
|
| 390 |
-
r.appendChild(l); r.appendChild(v); return r;
|
| 391 |
-
}
|
| 392 |
-
|
| 393 |
-
grid.appendChild(kpiRow("gr-groupsize", "group_size (G samples/step)"));
|
| 394 |
-
grid.appendChild(kpiRow("gr-steps", "steps simulated"));
|
| 395 |
-
grid.appendChild(kpiRow("gr-klbeta", "kl_beta (KL-penalty coeff.)"));
|
| 396 |
-
grid.appendChild(kpiRow("gr-clipeps", "clip_eps (PPO-clip \u03b5)"));
|
| 397 |
-
grid.appendChild(kpiRow("gr-reward", "mean_reward \u2014 MODELED"));
|
| 398 |
-
grid.appendChild(kpiRow("gr-adv", "mean_advantage \u2014 MODELED"));
|
| 399 |
-
grid.appendChild(kpiRow("gr-kl", "kl_divergence (k3) \u2014 MODELED"));
|
| 400 |
-
grid.appendChild(kpiRow("gr-clipfrac", "clip_fraction \u2014 MODELED"));
|
| 401 |
-
grid.appendChild(kpiRow("gr-score", "final_policy_score \u2014 MODELED"));
|
| 402 |
-
grid.appendChild(kpiRow("gr-label", "honesty label"));
|
| 403 |
-
card.appendChild(grid);
|
| 404 |
-
|
| 405 |
-
const fn = document.createElement("div");
|
| 406 |
-
fn.style.cssText = "font-size:9.5px;color:#6b7a86;line-height:1.5";
|
| 407 |
-
fn.textContent = "Shao et al. (DeepSeekMath GRPO) arXiv:2402.03300 \u00b7 DeepSeek-R1 arXiv:2501.12948. MODELED \u00b7 not claimed-as.";
|
| 408 |
-
card.appendChild(fn);
|
| 409 |
-
_overlay.appendChild(card);
|
| 410 |
-
|
| 411 |
-
const pl = document.createElement("button");
|
| 412 |
-
pl.textContent = "\u25d1 what this means";
|
| 413 |
-
pl.title = "Toggle plain-language explanation for investors & consumers.";
|
| 414 |
-
pl.style.cssText = "font:11px ui-monospace,monospace;padding:5px 11px;border-radius:7px;border:1px solid #3af4c8;background:#08140f;color:#3af4c8;cursor:pointer;width:fit-content";
|
| 415 |
-
pl.addEventListener("click", () => {
|
| 416 |
-
_plain = !_plain;
|
| 417 |
-
pl.style.background = _plain ? "#0f2a20" : "#08140f";
|
| 418 |
-
_applyPlain();
|
| 419 |
});
|
| 420 |
-
_overlay.appendChild(pl);
|
| 421 |
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
_el["
|
| 426 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 427 |
|
| 428 |
-
(ctx.container || document.body).appendChild(_overlay);
|
| 429 |
_paintOverlay();
|
| 430 |
}
|
| 431 |
|
| 432 |
-
function
|
| 433 |
-
const pd = _el["plain"];
|
| 434 |
-
if (!pd) return;
|
| 435 |
-
pd.style.display = _plain ? "block" : "none";
|
| 436 |
-
if (!_plain) return;
|
| 437 |
const g = S.groupSize != null ? String(S.groupSize) : "loading\u2026";
|
| 438 |
const reward = S.meanReward != null ? (S.meanReward * 100).toFixed(1) + "%" : "loading\u2026";
|
| 439 |
const score = S.policyScore != null ? (S.policyScore * 100).toFixed(1) + "%" : "loading\u2026";
|
| 440 |
-
|
| 441 |
"<b>What this means:</b> Instead of training a second, separate \u201ccritic\u201d network to judge how " +
|
| 442 |
"good an answer is (as classic PPO does), GRPO just generates <b>" + g + " candidate answers</b> to the " +
|
| 443 |
"same question and compares them <i>to each other</i> \u2014 the group's own average becomes the yardstick. " +
|
|
@@ -446,7 +376,7 @@ function _applyPlain() {
|
|
| 446 |
"from where it started. Over simulated training, the average reward per group reaches about <b>" + reward + "</b> " +
|
| 447 |
"and a convergence proxy (<b>policy_score</b>) climbs to about <b>" + score + "</b>. This view is a <b>MODELED</b> " +
|
| 448 |
"closed-form simulation of the group-advantage/PPO-clip/KL arithmetic from the DeepSeekMath paper, not a run of " +
|
| 449 |
-
"DeepSeek-R1 or DeepSeekMath training.";
|
| 450 |
}
|
| 451 |
|
| 452 |
function _tok(s) {
|
|
@@ -474,7 +404,7 @@ function _paintOverlay() {
|
|
| 474 |
_set("gr-score", t || pct(S.policyScore, 2));
|
| 475 |
// honesty label verbatim — never upgraded
|
| 476 |
_set("gr-label", t || (S.label || "MODELED"));
|
| 477 |
-
if (
|
| 478 |
}
|
| 479 |
|
| 480 |
// =============================================================================
|
|
@@ -482,7 +412,7 @@ function _paintOverlay() {
|
|
| 482 |
// =============================================================================
|
| 483 |
export function unmount() {
|
| 484 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 485 |
-
try { if (
|
| 486 |
try {
|
| 487 |
if (_group && _stage) {
|
| 488 |
_group.traverse((o) => {
|
|
@@ -495,9 +425,9 @@ export function unmount() {
|
|
| 495 |
_stage.scene.remove(_group);
|
| 496 |
}
|
| 497 |
} catch (_) {}
|
| 498 |
-
_group =
|
| 499 |
_floor = null; _plane = null; _spine = null; _sampleMesh = []; _tethers = []; _marker = null;
|
| 500 |
-
_el = {}; _badge = null;
|
| 501 |
_stage = _THREE = _ctx = null;
|
| 502 |
S.label = S.groupSize = S.steps = S.klBeta = S.clipEps = null;
|
| 503 |
S.meanReward = S.meanAdv = S.klDiv = S.clipFrac = S.policyScore = null;
|
|
|
|
| 42 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 43 |
// Nothing here is in the locked-8. Λ stays Conjecture 1. Trust never 100%.
|
| 44 |
|
| 45 |
+
import { createShowcase } from "./_showcase.js";
|
| 46 |
+
|
| 47 |
const ID = "grpo";
|
| 48 |
const TITLE = "GRPO Reward Dynamics · Group-Relative Advantage (live)";
|
| 49 |
|
|
|
|
| 73 |
const MAX_SAMPLES = 16; // cap on group_size rendered per step (perf)
|
| 74 |
const ADV_SCALE = 1.6; // world-units of height per unit of |advantage|
|
| 75 |
|
| 76 |
+
let _stage = null, _THREE = null, _ctx = null, _group = null, _show = null;
|
| 77 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
|
|
|
| 78 |
|
| 79 |
// geometry handles
|
| 80 |
let _floor = null;
|
|
|
|
| 333 |
// overlay
|
| 334 |
// =============================================================================
|
| 335 |
function _buildOverlay() {
|
| 336 |
+
_show = createShowcase(_ctx, {
|
| 337 |
+
id: ID, title: TITLE, accent: "#5b8dee",
|
| 338 |
+
badge: _badge,
|
| 339 |
+
chips: [{ label: "MODELED", text: "reward dynamics", name: "hl" }],
|
| 340 |
+
legend: ["MODELED", "SAMPLE"],
|
| 341 |
+
description:
|
| 342 |
+
'GRPO samples a <b>group</b> of completions per step and normalizes each reward against ' +
|
| 343 |
+
'the group\'s own mean/std \u2014 <b>no critic network</b> needed. The policy is updated via a ' +
|
| 344 |
+
'PPO-clip surrogate (\u03b5=0.2) on that group-relative advantage, plus a KL penalty vs a fixed ' +
|
| 345 |
+
'reference policy. Honesty label <b>MODELED</b> (deterministic group-advantage + PPO-clip + KL ' +
|
| 346 |
+
'arithmetic; NOT a trained policy). 0 runtime CDN.',
|
| 347 |
+
citations:
|
| 348 |
+
"Shao et al. (DeepSeekMath GRPO) arXiv:2402.03300 \u00b7 DeepSeek-R1 arXiv:2501.12948. MODELED \u00b7 not claimed-as.",
|
| 349 |
+
plain: { html: _plainHtml },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 350 |
});
|
|
|
|
| 351 |
|
| 352 |
+
_el["gr-groupsize"] = _show.addField("group_size (G samples/step)");
|
| 353 |
+
_el["gr-steps"] = _show.addField("steps simulated");
|
| 354 |
+
_el["gr-klbeta"] = _show.addField("kl_beta (KL-penalty coeff.)");
|
| 355 |
+
_el["gr-clipeps"] = _show.addField("clip_eps (PPO-clip \u03b5)");
|
| 356 |
+
_el["gr-reward"] = _show.addField("mean_reward \u2014 MODELED");
|
| 357 |
+
_el["gr-adv"] = _show.addField("mean_advantage \u2014 MODELED");
|
| 358 |
+
_el["gr-kl"] = _show.addField("kl_divergence (k3) \u2014 MODELED");
|
| 359 |
+
_el["gr-clipfrac"] = _show.addField("clip_fraction \u2014 MODELED");
|
| 360 |
+
_el["gr-score"] = _show.addField("final_policy_score \u2014 MODELED");
|
| 361 |
+
_el["gr-label"] = _show.addField("honesty label");
|
| 362 |
|
|
|
|
| 363 |
_paintOverlay();
|
| 364 |
}
|
| 365 |
|
| 366 |
+
function _plainHtml() {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 367 |
const g = S.groupSize != null ? String(S.groupSize) : "loading\u2026";
|
| 368 |
const reward = S.meanReward != null ? (S.meanReward * 100).toFixed(1) + "%" : "loading\u2026";
|
| 369 |
const score = S.policyScore != null ? (S.policyScore * 100).toFixed(1) + "%" : "loading\u2026";
|
| 370 |
+
return (
|
| 371 |
"<b>What this means:</b> Instead of training a second, separate \u201ccritic\u201d network to judge how " +
|
| 372 |
"good an answer is (as classic PPO does), GRPO just generates <b>" + g + " candidate answers</b> to the " +
|
| 373 |
"same question and compares them <i>to each other</i> \u2014 the group's own average becomes the yardstick. " +
|
|
|
|
| 376 |
"from where it started. Over simulated training, the average reward per group reaches about <b>" + reward + "</b> " +
|
| 377 |
"and a convergence proxy (<b>policy_score</b>) climbs to about <b>" + score + "</b>. This view is a <b>MODELED</b> " +
|
| 378 |
"closed-form simulation of the group-advantage/PPO-clip/KL arithmetic from the DeepSeekMath paper, not a run of " +
|
| 379 |
+
"DeepSeek-R1 or DeepSeekMath training.");
|
| 380 |
}
|
| 381 |
|
| 382 |
function _tok(s) {
|
|
|
|
| 404 |
_set("gr-score", t || pct(S.policyScore, 2));
|
| 405 |
// honesty label verbatim — never upgraded
|
| 406 |
_set("gr-label", t || (S.label || "MODELED"));
|
| 407 |
+
if (_show) { _show.setChip("hl", S.label || "MODELED", { text: "reward dynamics" }); _show.refreshPlain(); }
|
| 408 |
}
|
| 409 |
|
| 410 |
// =============================================================================
|
|
|
|
| 412 |
// =============================================================================
|
| 413 |
export function unmount() {
|
| 414 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 415 |
+
try { if (_show) _show.destroy(); } catch (_) {}
|
| 416 |
try {
|
| 417 |
if (_group && _stage) {
|
| 418 |
_group.traverse((o) => {
|
|
|
|
| 425 |
_stage.scene.remove(_group);
|
| 426 |
}
|
| 427 |
} catch (_) {}
|
| 428 |
+
_group = _show = null;
|
| 429 |
_floor = null; _plane = null; _spine = null; _sampleMesh = []; _tethers = []; _marker = null;
|
| 430 |
+
_el = {}; _badge = null; _frameReg = false;
|
| 431 |
_stage = _THREE = _ctx = null;
|
| 432 |
S.label = S.groupSize = S.steps = S.klBeta = S.clipEps = null;
|
| 433 |
S.meanReward = S.meanAdv = S.klDiv = S.clipFrac = S.policyScore = null;
|
static/3d/surfaces/herotq.js
CHANGED
|
@@ -51,6 +51,8 @@
|
|
| 51 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 52 |
// Nothing here is in the locked-8. Λ stays Conjecture 1. Trust never 100%.
|
| 53 |
|
|
|
|
|
|
|
| 54 |
const ID = "herotq";
|
| 55 |
const TITLE = "HeRo-Q Hessian-Conditioned Quantization";
|
| 56 |
|
|
@@ -76,9 +78,8 @@ const W_DX = 0.22; // world-units per weight coordinate
|
|
| 76 |
const W_YSC = 2.2; // world-units per unit weight value
|
| 77 |
const BAR_W = 0.7; // metric bar width
|
| 78 |
|
| 79 |
-
let _stage = null, _THREE = null, _ctx = null, _group = null,
|
| 80 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
| 81 |
-
let _plain = false;
|
| 82 |
|
| 83 |
// geometry handles
|
| 84 |
let _floor = null;
|
|
@@ -371,25 +372,13 @@ function _onFrame() {
|
|
| 371 |
// overlay
|
| 372 |
// =============================================================================
|
| 373 |
function _buildOverlay() {
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
color: "#eef3f6",
|
| 382 |
-
});
|
| 383 |
-
|
| 384 |
-
const h = document.createElement("div");
|
| 385 |
-
h.style.cssText = "font:600 13px ui-sans-serif,system-ui;letter-spacing:.4px";
|
| 386 |
-
h.textContent = TITLE;
|
| 387 |
-
_overlay.appendChild(h);
|
| 388 |
-
|
| 389 |
-
const sub = document.createElement("div");
|
| 390 |
-
sub.style.cssText = "color:#9fb1bf;font-size:11px;line-height:1.55";
|
| 391 |
-
sub.innerHTML =
|
| 392 |
-
'HeRo-Q (\u201cHessian Robust Quantization\u201d) fixes the <b>\u201clow error, high loss\u201d</b> paradox in ' +
|
| 393 |
'low-bit quantization: naive rounding minimizes weight ERROR, but the loss actually depends on the ' +
|
| 394 |
'<b>Hessian</b> \u2014 a few <b>high-curvature directions</b> (large eigenvalues) are extremely ' +
|
| 395 |
'perturbation-sensitive. HeRo-Q applies a <b>rotation-compression</b> transform in the Hessian ' +
|
|
@@ -397,94 +386,35 @@ function _buildOverlay() {
|
|
| 397 |
'<b>reduces the largest Hessian eigenvalue</b> before quantizing. Panels: Hessian spectrum ' +
|
| 398 |
'(before vs after), weight reconstruction (raw / naive / HeRo-Q), metric bars (quant MSE & ' +
|
| 399 |
'curvature-weighted loss ½\u00b7\u0394w\u1d40H\u0394w). Honesty label <b>MODELED</b> (deterministic mechanism ' +
|
| 400 |
-
'reproduction on a toy matrix; quantizes nothing real). 0 runtime CDN.'
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
brow.style.cssText = "display:flex;gap:8px;align-items:center;flex-wrap:wrap";
|
| 405 |
-
if (_badge && _badge.el) brow.appendChild(_badge.el);
|
| 406 |
-
_overlay.appendChild(brow);
|
| 407 |
-
|
| 408 |
-
const card = document.createElement("div");
|
| 409 |
-
card.style.cssText = "background:#0a1117;border:1px solid #1d2a36;border-radius:9px;padding:9px 10px;display:flex;flex-direction:column;gap:6px";
|
| 410 |
-
|
| 411 |
-
const chead = document.createElement("div");
|
| 412 |
-
chead.style.cssText = "display:flex;align-items:center;gap:8px;flex-wrap:wrap";
|
| 413 |
-
const dot = document.createElement("span");
|
| 414 |
-
dot.style.cssText = "width:9px;height:9px;border-radius:50%;background:#3af4c8;box-shadow:0 0 7px #3af4c8";
|
| 415 |
-
const nm = document.createElement("b");
|
| 416 |
-
nm.style.cssText = "font-size:12px;color:#3af4c8;letter-spacing:.3px";
|
| 417 |
-
nm.textContent = "hero-q hessian-conditioned quantization";
|
| 418 |
-
chead.appendChild(dot); chead.appendChild(nm);
|
| 419 |
-
card.appendChild(chead);
|
| 420 |
-
|
| 421 |
-
const grid = document.createElement("div");
|
| 422 |
-
grid.style.cssText = "display:grid;grid-template-columns:1fr;gap:4px";
|
| 423 |
-
|
| 424 |
-
function kpiRow(id, label) {
|
| 425 |
-
const r = document.createElement("div");
|
| 426 |
-
r.style.cssText = "display:flex;justify-content:space-between;gap:10px;font-size:11px";
|
| 427 |
-
const l = document.createElement("span"); l.style.cssText = "color:#9fb1bf"; l.textContent = label;
|
| 428 |
-
const v = document.createElement("b");
|
| 429 |
-
v.id = id;
|
| 430 |
-
v.style.cssText = "font-variant-numeric:tabular-nums;color:#eef3f6;text-align:right;max-width:56%";
|
| 431 |
-
v.textContent = "\u2014";
|
| 432 |
-
_el[id] = v;
|
| 433 |
-
r.appendChild(l); r.appendChild(v); return r;
|
| 434 |
-
}
|
| 435 |
-
|
| 436 |
-
grid.appendChild(kpiRow("hq-size", "weight / Hessian size"));
|
| 437 |
-
grid.appendChild(kpiRow("hq-bits", "quantization bits (levels)"));
|
| 438 |
-
grid.appendChild(kpiRow("hq-eigb", "max Hessian \u03bb \u2014 BEFORE"));
|
| 439 |
-
grid.appendChild(kpiRow("hq-eiga", "max Hessian \u03bb \u2014 AFTER"));
|
| 440 |
-
grid.appendChild(kpiRow("hq-eigr", "eigenvalue reduction"));
|
| 441 |
-
grid.appendChild(kpiRow("hq-cond", "condition \u03ba (before \u2192 after)"));
|
| 442 |
-
grid.appendChild(kpiRow("hq-msen", "quant MSE \u2014 naive"));
|
| 443 |
-
grid.appendChild(kpiRow("hq-mseh", "quant MSE \u2014 HeRo-Q"));
|
| 444 |
-
grid.appendChild(kpiRow("hq-lossn", "loss-proxy \u00bd\u0394w\u1d40H\u0394w \u2014 naive"));
|
| 445 |
-
grid.appendChild(kpiRow("hq-lossh", "loss-proxy \u00bd\u0394w\u1d40H\u0394w \u2014 HeRo-Q"));
|
| 446 |
-
grid.appendChild(kpiRow("hq-lossr", "loss reduction"));
|
| 447 |
-
grid.appendChild(kpiRow("hq-para", "\u201clow error, high loss\u201d (naive)"));
|
| 448 |
-
grid.appendChild(kpiRow("hq-label", "honesty label"));
|
| 449 |
-
card.appendChild(grid);
|
| 450 |
-
|
| 451 |
-
const fn = document.createElement("div");
|
| 452 |
-
fn.style.cssText = "font-size:9.5px;color:#6b7a86;line-height:1.5";
|
| 453 |
-
fn.textContent = "HeRo-Q \u2014 Zhang, Jinhao et al. \u201cHeRo-Q: A General Framework for Stable Low Bit Quantization via Hessian Conditioning\u201d arXiv:2601.21626. MODELED \u00b7 Hessian-conditioning demo on a toy matrix, not a trained model. Does NOT reproduce the GSM8K/Llama3-8B numbers.";
|
| 454 |
-
card.appendChild(fn);
|
| 455 |
-
_overlay.appendChild(card);
|
| 456 |
-
|
| 457 |
-
const pl = document.createElement("button");
|
| 458 |
-
pl.textContent = "\u25d1 what this means";
|
| 459 |
-
pl.title = "Toggle plain-language explanation for investors & consumers.";
|
| 460 |
-
pl.style.cssText = "font:11px ui-monospace,monospace;padding:5px 11px;border-radius:7px;border:1px solid #3af4c8;background:#08140f;color:#3af4c8;cursor:pointer;width:fit-content";
|
| 461 |
-
pl.addEventListener("click", () => {
|
| 462 |
-
_plain = !_plain;
|
| 463 |
-
pl.style.background = _plain ? "#0f2a20" : "#08140f";
|
| 464 |
-
_applyPlain();
|
| 465 |
});
|
| 466 |
-
_overlay.appendChild(pl);
|
| 467 |
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
_el["
|
| 472 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 473 |
|
| 474 |
-
(ctx.container || document.body).appendChild(_overlay);
|
| 475 |
_paintOverlay();
|
| 476 |
}
|
| 477 |
|
| 478 |
-
function
|
| 479 |
-
const pd = _el["plain"];
|
| 480 |
-
if (!pd) return;
|
| 481 |
-
pd.style.display = _plain ? "block" : "none";
|
| 482 |
-
if (!_plain) return;
|
| 483 |
const eb = S.maxBefore != null ? S.maxBefore.toFixed(1) : "loading\u2026";
|
| 484 |
const ea = S.maxAfter != null ? S.maxAfter.toFixed(2) : "loading\u2026";
|
| 485 |
const er = S.eigRed != null ? S.eigRed.toFixed(1) + "\u00d7" : "loading\u2026";
|
| 486 |
const lr = S.lossRed != null ? S.lossRed.toFixed(1) + "\u00d7" : "loading\u2026";
|
| 487 |
-
|
| 488 |
"<b>What this means:</b> To make a big model small and fast, we store its numbers with very few " +
|
| 489 |
"bits \u2014 like rounding prices to the nearest dollar. Plain rounding keeps the <b>numbers</b> close, " +
|
| 490 |
"but the model can still get much <b>worse</b>, because a few \u201cstiff\u201d directions matter far more " +
|
|
@@ -497,7 +427,7 @@ function _applyPlain() {
|
|
| 497 |
"<b>MODELED</b> deterministic reproduction of that turn-and-rescale MECHANISM on a small synthetic " +
|
| 498 |
"matrix \u2014 it <b>quantizes no real model</b> and runs no benchmark. The paper\u2019s headline " +
|
| 499 |
"\u201c70.15% GSM8K on Llama3-8B at 3-bit\u201d is a <b>claim about a real model</b> the estate does not " +
|
| 500 |
-
"independently verify.";
|
| 501 |
}
|
| 502 |
|
| 503 |
function _tok(s) {
|
|
@@ -527,7 +457,7 @@ function _paintOverlay() {
|
|
| 527 |
_set("hq-para", t || (S.paradox != null ? (S.paradox ? "PRESENT \u2192 fixed" : "\u2014") : "\u2014"));
|
| 528 |
// honesty label verbatim — never upgraded
|
| 529 |
_set("hq-label", t || (S.label || "MODELED"));
|
| 530 |
-
if (
|
| 531 |
}
|
| 532 |
|
| 533 |
// =============================================================================
|
|
@@ -535,7 +465,7 @@ function _paintOverlay() {
|
|
| 535 |
// =============================================================================
|
| 536 |
export function unmount() {
|
| 537 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 538 |
-
try { if (
|
| 539 |
try {
|
| 540 |
if (_group && _stage) {
|
| 541 |
_group.traverse((o) => {
|
|
@@ -548,12 +478,12 @@ export function unmount() {
|
|
| 548 |
_stage.scene.remove(_group);
|
| 549 |
}
|
| 550 |
} catch (_) {}
|
| 551 |
-
_group =
|
| 552 |
_floor = null;
|
| 553 |
_specGroup = null; _specBefore = []; _specAfter = [];
|
| 554 |
_wGroup = null;
|
| 555 |
_barGroup = null; _barMseN = _barMseH = _barLossN = _barLossH = null;
|
| 556 |
-
_el = {}; _badge = null;
|
| 557 |
_stage = _THREE = _ctx = null;
|
| 558 |
S.label = S.size = S.bits = S.levels = null;
|
| 559 |
S.eigs = null;
|
|
|
|
| 51 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 52 |
// Nothing here is in the locked-8. Λ stays Conjecture 1. Trust never 100%.
|
| 53 |
|
| 54 |
+
import { createShowcase } from "./_showcase.js";
|
| 55 |
+
|
| 56 |
const ID = "herotq";
|
| 57 |
const TITLE = "HeRo-Q Hessian-Conditioned Quantization";
|
| 58 |
|
|
|
|
| 78 |
const W_YSC = 2.2; // world-units per unit weight value
|
| 79 |
const BAR_W = 0.7; // metric bar width
|
| 80 |
|
| 81 |
+
let _stage = null, _THREE = null, _ctx = null, _group = null, _show = null;
|
| 82 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
|
|
|
| 83 |
|
| 84 |
// geometry handles
|
| 85 |
let _floor = null;
|
|
|
|
| 372 |
// overlay
|
| 373 |
// =============================================================================
|
| 374 |
function _buildOverlay() {
|
| 375 |
+
_show = createShowcase(_ctx, {
|
| 376 |
+
id: ID, title: TITLE, accent: "#5b8dee",
|
| 377 |
+
badge: _badge,
|
| 378 |
+
chips: [{ label: "MODELED", text: "hessian-conditioned quant", name: "hl" }],
|
| 379 |
+
legend: ["MEASURED", "MODELED"],
|
| 380 |
+
description:
|
| 381 |
+
'HeRo-Q (\u201cHessian Robust Quantization\u201d) fixes the <b>\u201clow error, high loss\u201d</b> paradox in ' +
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 382 |
'low-bit quantization: naive rounding minimizes weight ERROR, but the loss actually depends on the ' +
|
| 383 |
'<b>Hessian</b> \u2014 a few <b>high-curvature directions</b> (large eigenvalues) are extremely ' +
|
| 384 |
'perturbation-sensitive. HeRo-Q applies a <b>rotation-compression</b> transform in the Hessian ' +
|
|
|
|
| 386 |
'<b>reduces the largest Hessian eigenvalue</b> before quantizing. Panels: Hessian spectrum ' +
|
| 387 |
'(before vs after), weight reconstruction (raw / naive / HeRo-Q), metric bars (quant MSE & ' +
|
| 388 |
'curvature-weighted loss ½\u00b7\u0394w\u1d40H\u0394w). Honesty label <b>MODELED</b> (deterministic mechanism ' +
|
| 389 |
+
'reproduction on a toy matrix; quantizes nothing real). 0 runtime CDN.',
|
| 390 |
+
citations:
|
| 391 |
+
"HeRo-Q \u2014 Zhang, Jinhao et al. \u201cHeRo-Q: A General Framework for Stable Low Bit Quantization via Hessian Conditioning\u201d arXiv:2601.21626. MODELED \u00b7 Hessian-conditioning demo on a toy matrix, not a trained model. Does NOT reproduce the GSM8K/Llama3-8B numbers.",
|
| 392 |
+
plain: { html: _plainHtml },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 393 |
});
|
|
|
|
| 394 |
|
| 395 |
+
_el["hq-size"] = _show.addField("weight / Hessian size");
|
| 396 |
+
_el["hq-bits"] = _show.addField("quantization bits (levels)");
|
| 397 |
+
_el["hq-eigb"] = _show.addField("max Hessian \u03bb \u2014 BEFORE");
|
| 398 |
+
_el["hq-eiga"] = _show.addField("max Hessian \u03bb \u2014 AFTER");
|
| 399 |
+
_el["hq-eigr"] = _show.addField("eigenvalue reduction");
|
| 400 |
+
_el["hq-cond"] = _show.addField("condition \u03ba (before \u2192 after)");
|
| 401 |
+
_el["hq-msen"] = _show.addField("quant MSE \u2014 naive");
|
| 402 |
+
_el["hq-mseh"] = _show.addField("quant MSE \u2014 HeRo-Q");
|
| 403 |
+
_el["hq-lossn"] = _show.addField("loss-proxy \u00bd\u0394w\u1d40H\u0394w \u2014 naive");
|
| 404 |
+
_el["hq-lossh"] = _show.addField("loss-proxy \u00bd\u0394w\u1d40H\u0394w \u2014 HeRo-Q");
|
| 405 |
+
_el["hq-lossr"] = _show.addField("loss reduction");
|
| 406 |
+
_el["hq-para"] = _show.addField("\u201clow error, high loss\u201d (naive)");
|
| 407 |
+
_el["hq-label"] = _show.addField("honesty label");
|
| 408 |
|
|
|
|
| 409 |
_paintOverlay();
|
| 410 |
}
|
| 411 |
|
| 412 |
+
function _plainHtml() {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 413 |
const eb = S.maxBefore != null ? S.maxBefore.toFixed(1) : "loading\u2026";
|
| 414 |
const ea = S.maxAfter != null ? S.maxAfter.toFixed(2) : "loading\u2026";
|
| 415 |
const er = S.eigRed != null ? S.eigRed.toFixed(1) + "\u00d7" : "loading\u2026";
|
| 416 |
const lr = S.lossRed != null ? S.lossRed.toFixed(1) + "\u00d7" : "loading\u2026";
|
| 417 |
+
return (
|
| 418 |
"<b>What this means:</b> To make a big model small and fast, we store its numbers with very few " +
|
| 419 |
"bits \u2014 like rounding prices to the nearest dollar. Plain rounding keeps the <b>numbers</b> close, " +
|
| 420 |
"but the model can still get much <b>worse</b>, because a few \u201cstiff\u201d directions matter far more " +
|
|
|
|
| 427 |
"<b>MODELED</b> deterministic reproduction of that turn-and-rescale MECHANISM on a small synthetic " +
|
| 428 |
"matrix \u2014 it <b>quantizes no real model</b> and runs no benchmark. The paper\u2019s headline " +
|
| 429 |
"\u201c70.15% GSM8K on Llama3-8B at 3-bit\u201d is a <b>claim about a real model</b> the estate does not " +
|
| 430 |
+
"independently verify.");
|
| 431 |
}
|
| 432 |
|
| 433 |
function _tok(s) {
|
|
|
|
| 457 |
_set("hq-para", t || (S.paradox != null ? (S.paradox ? "PRESENT \u2192 fixed" : "\u2014") : "\u2014"));
|
| 458 |
// honesty label verbatim — never upgraded
|
| 459 |
_set("hq-label", t || (S.label || "MODELED"));
|
| 460 |
+
if (_show) { _show.setChip("hl", S.label || "MODELED", { text: "hessian-conditioned quant" }); _show.refreshPlain(); }
|
| 461 |
}
|
| 462 |
|
| 463 |
// =============================================================================
|
|
|
|
| 465 |
// =============================================================================
|
| 466 |
export function unmount() {
|
| 467 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 468 |
+
try { if (_show) _show.destroy(); } catch (_) {}
|
| 469 |
try {
|
| 470 |
if (_group && _stage) {
|
| 471 |
_group.traverse((o) => {
|
|
|
|
| 478 |
_stage.scene.remove(_group);
|
| 479 |
}
|
| 480 |
} catch (_) {}
|
| 481 |
+
_group = _show = null;
|
| 482 |
_floor = null;
|
| 483 |
_specGroup = null; _specBefore = []; _specAfter = [];
|
| 484 |
_wGroup = null;
|
| 485 |
_barGroup = null; _barMseN = _barMseH = _barLossN = _barLossH = null;
|
| 486 |
+
_el = {}; _badge = null; _frameReg = false;
|
| 487 |
_stage = _THREE = _ctx = null;
|
| 488 |
S.label = S.size = S.bits = S.levels = null;
|
| 489 |
S.eigs = null;
|
static/3d/surfaces/hrm.js
CHANGED
|
@@ -49,6 +49,8 @@
|
|
| 49 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still
|
| 50 |
// shown. Nothing here is in the locked-8. Λ stays Conjecture 1. Trust never 100%.
|
| 51 |
|
|
|
|
|
|
|
| 52 |
const ID = "hrm";
|
| 53 |
const TITLE = "Hierarchical Reasoning Model · H-slow / L-fast (live)";
|
| 54 |
|
|
@@ -69,9 +71,8 @@ const MAX_N = 9; // largest grid side we pre-allocate cells for
|
|
| 69 |
const CELL = 1.15; // world-units between grid cells
|
| 70 |
const MAX_CELLS = MAX_N * MAX_N;
|
| 71 |
|
| 72 |
-
let _stage = null, _THREE = null, _ctx = null, _group = null,
|
| 73 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
| 74 |
-
let _plain = false;
|
| 75 |
|
| 76 |
// geometry handles
|
| 77 |
let _floor = null;
|
|
@@ -300,31 +301,22 @@ function _onFrame() {
|
|
| 300 |
// overlay
|
| 301 |
// =============================================================================
|
| 302 |
function _buildOverlay() {
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 311 |
});
|
| 312 |
|
| 313 |
-
const h = document.createElement("div");
|
| 314 |
-
h.style.cssText = "font:600 13px ui-sans-serif,system-ui;letter-spacing:.4px";
|
| 315 |
-
h.textContent = TITLE;
|
| 316 |
-
_overlay.appendChild(h);
|
| 317 |
-
|
| 318 |
-
const sub = document.createElement("div");
|
| 319 |
-
sub.style.cssText = "color:#9fb1bf;font-size:11px;line-height:1.55";
|
| 320 |
-
sub.innerHTML =
|
| 321 |
-
'Two interdependent recurrent modules at different timescales solve a mini-Sudoku: a ' +
|
| 322 |
-
'<b>fast low-level executor (L)</b> propagates local cell constraints to convergence, and a ' +
|
| 323 |
-
'<b>slow high-level planner (H)</b> advances an abstract plan once per tick and nudges the ' +
|
| 324 |
-
'executor when it stalls. Cells glow <b>teal</b> as they solve. ' +
|
| 325 |
-
'Honesty label <b>MODELED</b> (deterministic control-loop simulation on a toy grid; NOT the HRM network). 0 runtime CDN.';
|
| 326 |
-
_overlay.appendChild(sub);
|
| 327 |
-
|
| 328 |
// explicit honesty-caveat banner (the ARC Prize finding) — always shown
|
| 329 |
const dist = document.createElement("div");
|
| 330 |
dist.style.cssText = "font-size:10.5px;color:#c9d6df;line-height:1.5;border:1px solid #26333f;border-radius:7px;padding:7px 9px;background:#0a1117";
|
|
@@ -336,90 +328,28 @@ function _buildOverlay() {
|
|
| 336 |
'drivers were an <b>outer refinement loop</b>, heavy <b>data augmentation</b>, and a per-task ' +
|
| 337 |
'<b>puzzle-embedding</b>. So this organ shows the H/L result <i>beside</i> a size-matched ' +
|
| 338 |
'<b>flat baseline</b> (violet bar) \u2014 they end up nearly equal. We do <i>not</i> overclaim the hierarchy.';
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
const dot = document.createElement("span");
|
| 352 |
-
dot.style.cssText = "width:9px;height:9px;border-radius:50%;background:#3af4c8;box-shadow:0 0 7px #3af4c8";
|
| 353 |
-
const nm = document.createElement("b");
|
| 354 |
-
nm.style.cssText = "font-size:12px;color:#3af4c8;letter-spacing:.3px";
|
| 355 |
-
nm.textContent = "hierarchical reasoning model";
|
| 356 |
-
chead.appendChild(dot); chead.appendChild(nm);
|
| 357 |
-
card.appendChild(chead);
|
| 358 |
-
|
| 359 |
-
const grid = document.createElement("div");
|
| 360 |
-
grid.style.cssText = "display:grid;grid-template-columns:1fr;gap:4px";
|
| 361 |
-
|
| 362 |
-
function kpiRow(id, label) {
|
| 363 |
-
const r = document.createElement("div");
|
| 364 |
-
r.style.cssText = "display:flex;justify-content:space-between;gap:10px;font-size:11px";
|
| 365 |
-
const l = document.createElement("span"); l.style.cssText = "color:#9fb1bf"; l.textContent = label;
|
| 366 |
-
const v = document.createElement("b");
|
| 367 |
-
v.id = id;
|
| 368 |
-
v.style.cssText = "font-variant-numeric:tabular-nums;color:#eef3f6;text-align:right;max-width:58%";
|
| 369 |
-
v.textContent = "\u2014";
|
| 370 |
-
_el[id] = v;
|
| 371 |
-
r.appendChild(l); r.appendChild(v); return r;
|
| 372 |
-
}
|
| 373 |
-
|
| 374 |
-
grid.appendChild(kpiRow("hrm-grid", "puzzle (mini-Sudoku n\u00d7n)"));
|
| 375 |
-
grid.appendChild(kpiRow("hrm-clues", "clues / empty at start"));
|
| 376 |
-
grid.appendChild(kpiRow("hrm-hsolved", "H/L hierarchical: solved?"));
|
| 377 |
-
grid.appendChild(kpiRow("hrm-hticks", "H-slow ticks used"));
|
| 378 |
-
grid.appendChild(kpiRow("hrm-hupdates", "H/L total updates \u2014 MODELED"));
|
| 379 |
-
grid.appendChild(kpiRow("hrm-fsolved", "flat baseline (size-matched): solved?"));
|
| 380 |
-
grid.appendChild(kpiRow("hrm-fupdates", "flat total updates \u2014 MODELED"));
|
| 381 |
-
grid.appendChild(kpiRow("hrm-ratio", "updates ratio (hier / flat)"));
|
| 382 |
-
grid.appendChild(kpiRow("hrm-verdict", "honest verdict"));
|
| 383 |
-
grid.appendChild(kpiRow("hrm-label", "honesty label"));
|
| 384 |
-
card.appendChild(grid);
|
| 385 |
-
|
| 386 |
-
const fn = document.createElement("div");
|
| 387 |
-
fn.style.cssText = "font-size:9.5px;color:#6b7a86;line-height:1.5";
|
| 388 |
-
fn.textContent = "Wang et al. arXiv:2506.21734 (HRM) \u00b7 github.com/sapientinc/HRM \u00b7 ARC Prize analysis arcprize.org/blog/hrm-analysis. MODELED \u00b7 not claimed-as.";
|
| 389 |
-
card.appendChild(fn);
|
| 390 |
-
_overlay.appendChild(card);
|
| 391 |
-
|
| 392 |
-
const pl = document.createElement("button");
|
| 393 |
-
pl.textContent = "\u25d1 what this means";
|
| 394 |
-
pl.title = "Toggle plain-language explanation for investors & consumers.";
|
| 395 |
-
pl.style.cssText = "font:11px ui-monospace,monospace;padding:5px 11px;border-radius:7px;border:1px solid #3af4c8;background:#08140f;color:#3af4c8;cursor:pointer;width:fit-content";
|
| 396 |
-
pl.addEventListener("click", () => {
|
| 397 |
-
_plain = !_plain;
|
| 398 |
-
pl.style.background = _plain ? "#0f2a20" : "#08140f";
|
| 399 |
-
_applyPlain();
|
| 400 |
-
});
|
| 401 |
-
_overlay.appendChild(pl);
|
| 402 |
-
|
| 403 |
-
const pd = document.createElement("div");
|
| 404 |
-
pd.id = "hrm-plain";
|
| 405 |
-
pd.style.cssText = "font-size:10.5px;color:#c9d6df;line-height:1.55;border:1px dashed #26333f;border-radius:7px;padding:7px 9px;display:none";
|
| 406 |
-
_el["plain"] = pd;
|
| 407 |
-
_overlay.appendChild(pd);
|
| 408 |
|
| 409 |
-
(ctx.container || document.body).appendChild(_overlay);
|
| 410 |
_paintOverlay();
|
| 411 |
}
|
| 412 |
|
| 413 |
-
function
|
| 414 |
-
const pd = _el["plain"];
|
| 415 |
-
if (!pd) return;
|
| 416 |
-
pd.style.display = _plain ? "block" : "none";
|
| 417 |
-
if (!_plain) return;
|
| 418 |
const nn = S.n != null ? (S.n + "\u00d7" + S.n) : "small";
|
| 419 |
const hSolved = S.hier && S.hier.solved ? "yes" : "not yet";
|
| 420 |
const ratio = S.edge && S.edge.updates_ratio != null ? S.edge.updates_ratio.toFixed(2) : "\u2248 1";
|
| 421 |
const verdict = S.edge && typeof S.edge.verdict === "string" ? S.edge.verdict : null;
|
| 422 |
-
|
| 423 |
"<b>What this means:</b> A hard puzzle (here a " + nn + " mini-Sudoku) is solved by two " +
|
| 424 |
"cooperating parts of one model running at different speeds: a <b>fast \u201cworker\u201d</b> that " +
|
| 425 |
"fills in whatever cells are locally forced, and a <b>slow \u201cplanner\u201d</b> that steps back " +
|
|
@@ -435,7 +365,7 @@ function _applyPlain() {
|
|
| 435 |
(verdict ? " \u2014 <i>" + verdict + "</i>" : "") + ". " +
|
| 436 |
"The hierarchy gives a <b>small, real</b> benefit, not the dominant one the paper implies. " +
|
| 437 |
"This whole view is a <b>MODELED</b> simulation of the control loop on a toy grid, not a run " +
|
| 438 |
-
"of the real 27M-parameter HRM network.";
|
| 439 |
}
|
| 440 |
|
| 441 |
function _tok(s) {
|
|
@@ -464,7 +394,7 @@ function _paintOverlay() {
|
|
| 464 |
: "\u2014"));
|
| 465 |
// honesty label verbatim — never upgraded
|
| 466 |
_set("hrm-label", t || (S.label || "MODELED"));
|
| 467 |
-
if (
|
| 468 |
}
|
| 469 |
|
| 470 |
// =============================================================================
|
|
@@ -472,7 +402,7 @@ function _paintOverlay() {
|
|
| 472 |
// =============================================================================
|
| 473 |
export function unmount() {
|
| 474 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 475 |
-
try { if (
|
| 476 |
try {
|
| 477 |
if (_group && _stage) {
|
| 478 |
_group.traverse((o) => {
|
|
@@ -485,9 +415,9 @@ export function unmount() {
|
|
| 485 |
_stage.scene.remove(_group);
|
| 486 |
}
|
| 487 |
} catch (_) {}
|
| 488 |
-
_group =
|
| 489 |
_floor = null; _cellMesh = []; _planBar = null; _flatBar = null; _marker = null;
|
| 490 |
-
_el = {}; _badge = null;
|
| 491 |
_stage = _THREE = _ctx = null;
|
| 492 |
S.label = S.n = S.hTicks = S.lSteps = S.clues = S.emptyStart = null;
|
| 493 |
S.hier = S.flat = S.edge = S.finalGrid = S.caveat = null;
|
|
|
|
| 49 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still
|
| 50 |
// shown. Nothing here is in the locked-8. Λ stays Conjecture 1. Trust never 100%.
|
| 51 |
|
| 52 |
+
import { createShowcase } from "./_showcase.js";
|
| 53 |
+
|
| 54 |
const ID = "hrm";
|
| 55 |
const TITLE = "Hierarchical Reasoning Model · H-slow / L-fast (live)";
|
| 56 |
|
|
|
|
| 71 |
const CELL = 1.15; // world-units between grid cells
|
| 72 |
const MAX_CELLS = MAX_N * MAX_N;
|
| 73 |
|
| 74 |
+
let _stage = null, _THREE = null, _ctx = null, _group = null, _show = null;
|
| 75 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
|
|
|
| 76 |
|
| 77 |
// geometry handles
|
| 78 |
let _floor = null;
|
|
|
|
| 301 |
// overlay
|
| 302 |
// =============================================================================
|
| 303 |
function _buildOverlay() {
|
| 304 |
+
_show = createShowcase(_ctx, {
|
| 305 |
+
id: ID, title: TITLE, accent: "#5b8dee",
|
| 306 |
+
badge: _badge,
|
| 307 |
+
chips: [{ label: "MODELED", text: "hierarchical reasoning model", name: "hl" }],
|
| 308 |
+
legend: ["MODELED"],
|
| 309 |
+
description:
|
| 310 |
+
'Two interdependent recurrent modules at different timescales solve a mini-Sudoku: a ' +
|
| 311 |
+
'<b>fast low-level executor (L)</b> propagates local cell constraints to convergence, and a ' +
|
| 312 |
+
'<b>slow high-level planner (H)</b> advances an abstract plan once per tick and nudges the ' +
|
| 313 |
+
'executor when it stalls. Cells glow <b>teal</b> as they solve. ' +
|
| 314 |
+
'Honesty label <b>MODELED</b> (deterministic control-loop simulation on a toy grid; NOT the HRM network). 0 runtime CDN.',
|
| 315 |
+
citations:
|
| 316 |
+
"Wang et al. arXiv:2506.21734 (HRM) · github.com/sapientinc/HRM · ARC Prize analysis arcprize.org/blog/hrm-analysis. MODELED · not claimed-as.",
|
| 317 |
+
plain: { html: _plainHtml },
|
| 318 |
});
|
| 319 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 320 |
// explicit honesty-caveat banner (the ARC Prize finding) — always shown
|
| 321 |
const dist = document.createElement("div");
|
| 322 |
dist.style.cssText = "font-size:10.5px;color:#c9d6df;line-height:1.5;border:1px solid #26333f;border-radius:7px;padding:7px 9px;background:#0a1117";
|
|
|
|
| 328 |
'drivers were an <b>outer refinement loop</b>, heavy <b>data augmentation</b>, and a per-task ' +
|
| 329 |
'<b>puzzle-embedding</b>. So this organ shows the H/L result <i>beside</i> a size-matched ' +
|
| 330 |
'<b>flat baseline</b> (violet bar) \u2014 they end up nearly equal. We do <i>not</i> overclaim the hierarchy.';
|
| 331 |
+
_show.appendBody(dist);
|
| 332 |
+
|
| 333 |
+
_el["hrm-grid"] = _show.addField("puzzle (mini-Sudoku n\u00d7n)");
|
| 334 |
+
_el["hrm-clues"] = _show.addField("clues / empty at start");
|
| 335 |
+
_el["hrm-hsolved"] = _show.addField("H/L hierarchical: solved?");
|
| 336 |
+
_el["hrm-hticks"] = _show.addField("H-slow ticks used");
|
| 337 |
+
_el["hrm-hupdates"] = _show.addField("H/L total updates \u2014 MODELED");
|
| 338 |
+
_el["hrm-fsolved"] = _show.addField("flat baseline (size-matched): solved?");
|
| 339 |
+
_el["hrm-fupdates"] = _show.addField("flat total updates \u2014 MODELED");
|
| 340 |
+
_el["hrm-ratio"] = _show.addField("updates ratio (hier / flat)");
|
| 341 |
+
_el["hrm-verdict"] = _show.addField("honest verdict");
|
| 342 |
+
_el["hrm-label"] = _show.addField("honesty label");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 343 |
|
|
|
|
| 344 |
_paintOverlay();
|
| 345 |
}
|
| 346 |
|
| 347 |
+
function _plainHtml() {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 348 |
const nn = S.n != null ? (S.n + "\u00d7" + S.n) : "small";
|
| 349 |
const hSolved = S.hier && S.hier.solved ? "yes" : "not yet";
|
| 350 |
const ratio = S.edge && S.edge.updates_ratio != null ? S.edge.updates_ratio.toFixed(2) : "\u2248 1";
|
| 351 |
const verdict = S.edge && typeof S.edge.verdict === "string" ? S.edge.verdict : null;
|
| 352 |
+
return (
|
| 353 |
"<b>What this means:</b> A hard puzzle (here a " + nn + " mini-Sudoku) is solved by two " +
|
| 354 |
"cooperating parts of one model running at different speeds: a <b>fast \u201cworker\u201d</b> that " +
|
| 355 |
"fills in whatever cells are locally forced, and a <b>slow \u201cplanner\u201d</b> that steps back " +
|
|
|
|
| 365 |
(verdict ? " \u2014 <i>" + verdict + "</i>" : "") + ". " +
|
| 366 |
"The hierarchy gives a <b>small, real</b> benefit, not the dominant one the paper implies. " +
|
| 367 |
"This whole view is a <b>MODELED</b> simulation of the control loop on a toy grid, not a run " +
|
| 368 |
+
"of the real 27M-parameter HRM network.");
|
| 369 |
}
|
| 370 |
|
| 371 |
function _tok(s) {
|
|
|
|
| 394 |
: "\u2014"));
|
| 395 |
// honesty label verbatim — never upgraded
|
| 396 |
_set("hrm-label", t || (S.label || "MODELED"));
|
| 397 |
+
if (_show) { _show.setChip("hl", S.label || "MODELED", { text: "hierarchical reasoning model" }); _show.refreshPlain(); }
|
| 398 |
}
|
| 399 |
|
| 400 |
// =============================================================================
|
|
|
|
| 402 |
// =============================================================================
|
| 403 |
export function unmount() {
|
| 404 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 405 |
+
try { if (_show) _show.destroy(); } catch (_) {}
|
| 406 |
try {
|
| 407 |
if (_group && _stage) {
|
| 408 |
_group.traverse((o) => {
|
|
|
|
| 415 |
_stage.scene.remove(_group);
|
| 416 |
}
|
| 417 |
} catch (_) {}
|
| 418 |
+
_group = _show = null;
|
| 419 |
_floor = null; _cellMesh = []; _planBar = null; _flatBar = null; _marker = null;
|
| 420 |
+
_el = {}; _badge = null; _frameReg = false;
|
| 421 |
_stage = _THREE = _ctx = null;
|
| 422 |
S.label = S.n = S.hTicks = S.lSteps = S.clues = S.emptyStart = null;
|
| 423 |
S.hier = S.flat = S.edge = S.finalGrid = S.caveat = null;
|
static/3d/surfaces/inplacettt.js
CHANGED
|
@@ -53,6 +53,8 @@
|
|
| 53 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 54 |
// Nothing here is in the locked-8. Λ stays Conjecture 1. Trust never 100%.
|
| 55 |
|
|
|
|
|
|
|
| 56 |
const ID = "inplacettt";
|
| 57 |
const TITLE = "In-Place Test-Time Training · W_down as Fast Weights (live)";
|
| 58 |
|
|
@@ -78,9 +80,8 @@ const MAX_CURVE = 96; // cap on loss-curve points rendered (== payload cap
|
|
| 78 |
const CURVE_SPAN = 12.0; // world-units the loss ribbons span along X
|
| 79 |
const CURVE_Y = 4.2; // baseline height of the loss ribbons
|
| 80 |
|
| 81 |
-
let _stage = null, _THREE = null, _ctx = null, _group = null,
|
| 82 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
| 83 |
-
let _plain = false;
|
| 84 |
|
| 85 |
// geometry handles
|
| 86 |
let _floor = null;
|
|
@@ -383,114 +384,43 @@ function _onFrame() {
|
|
| 383 |
// overlay
|
| 384 |
// =============================================================================
|
| 385 |
function _buildOverlay() {
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
const sub = document.createElement("div");
|
| 402 |
-
sub.style.cssText = "color:#9fb1bf;font-size:11px;line-height:1.55";
|
| 403 |
-
sub.innerHTML =
|
| 404 |
-
'Test-time adaptation with <b>no new module</b>: a stock MLP block\u2019s existing ' +
|
| 405 |
-
'<b>down-projection W_down</b> is re-purposed as <b>fast weights</b> (updated at inference), ' +
|
| 406 |
-
'while <b>W_up / W_gate stay frozen</b>. The update target is built by a <b>strictly-causal</b> ' +
|
| 407 |
-
'1-D convolution over past tokens (no future leakage), and one gradient step runs <b>per chunk</b>. ' +
|
| 408 |
-
'The <b>adapting</b> run\u2019s next-token loss <b>falls</b>; the <b>frozen-W_down control</b> stays <b>flat</b>. ' +
|
| 409 |
-
'Honesty label <b>MODELED</b> (inspired-not-real toy simulation; NOT the ByteDance model). 0 runtime CDN.';
|
| 410 |
-
_overlay.appendChild(sub);
|
| 411 |
-
|
| 412 |
-
const brow = document.createElement("div");
|
| 413 |
-
brow.style.cssText = "display:flex;gap:8px;align-items:center;flex-wrap:wrap";
|
| 414 |
-
if (_badge && _badge.el) brow.appendChild(_badge.el);
|
| 415 |
-
_overlay.appendChild(brow);
|
| 416 |
-
|
| 417 |
-
const card = document.createElement("div");
|
| 418 |
-
card.style.cssText = "background:#0a1117;border:1px solid #1d2a36;border-radius:9px;padding:9px 10px;display:flex;flex-direction:column;gap:6px";
|
| 419 |
-
|
| 420 |
-
const chead = document.createElement("div");
|
| 421 |
-
chead.style.cssText = "display:flex;align-items:center;gap:8px;flex-wrap:wrap";
|
| 422 |
-
const dot = document.createElement("span");
|
| 423 |
-
dot.style.cssText = "width:9px;height:9px;border-radius:50%;background:#3af4c8;box-shadow:0 0 7px #3af4c8";
|
| 424 |
-
const nm = document.createElement("b");
|
| 425 |
-
nm.style.cssText = "font-size:12px;color:#3af4c8;letter-spacing:.3px";
|
| 426 |
-
nm.textContent = "in-place test-time training";
|
| 427 |
-
chead.appendChild(dot); chead.appendChild(nm);
|
| 428 |
-
card.appendChild(chead);
|
| 429 |
-
|
| 430 |
-
const grid = document.createElement("div");
|
| 431 |
-
grid.style.cssText = "display:grid;grid-template-columns:1fr;gap:4px";
|
| 432 |
-
|
| 433 |
-
function kpiRow(id, label) {
|
| 434 |
-
const r = document.createElement("div");
|
| 435 |
-
r.style.cssText = "display:flex;justify-content:space-between;gap:10px;font-size:11px";
|
| 436 |
-
const l = document.createElement("span"); l.style.cssText = "color:#9fb1bf"; l.textContent = label;
|
| 437 |
-
const v = document.createElement("b");
|
| 438 |
-
v.id = id;
|
| 439 |
-
v.style.cssText = "font-variant-numeric:tabular-nums;color:#eef3f6;text-align:right;max-width:58%";
|
| 440 |
-
v.textContent = "\u2014";
|
| 441 |
-
_el[id] = v;
|
| 442 |
-
r.appendChild(l); r.appendChild(v); return r;
|
| 443 |
-
}
|
| 444 |
-
|
| 445 |
-
grid.appendChild(kpiRow("ip-fast", "fast weights (mutated)"));
|
| 446 |
-
grid.appendChild(kpiRow("ip-frozen", "frozen slow weights"));
|
| 447 |
-
grid.appendChild(kpiRow("ip-chunks", "chunks \u00d7 chunk_size"));
|
| 448 |
-
grid.appendChild(kpiRow("ip-lr", "learning_rate (per chunk)"));
|
| 449 |
-
grid.appendChild(kpiRow("ip-causal", "causal guard (no future leak)"));
|
| 450 |
-
grid.appendChild(kpiRow("ip-adapt", "adapt loss (start \u2192 end) \u2014 MODELED"));
|
| 451 |
-
grid.appendChild(kpiRow("ip-frozenl","frozen-control loss (flat)"));
|
| 452 |
-
grid.appendChild(kpiRow("ip-improve","improvement (adapting advantage)"));
|
| 453 |
-
grid.appendChild(kpiRow("ip-delta", "W_down movement (L1)"));
|
| 454 |
-
grid.appendChild(kpiRow("ip-label", "honesty label"));
|
| 455 |
-
card.appendChild(grid);
|
| 456 |
-
|
| 457 |
-
const fn = document.createElement("div");
|
| 458 |
-
fn.style.cssText = "font-size:9.5px;color:#6b7a86;line-height:1.5";
|
| 459 |
-
fn.textContent = "Feng et al. 2026 (ByteDance Seed + Peking Univ) \u00b7 In-Place Test-Time Training \u00b7 arXiv:2604.06169 (ICLR 2026 Oral) \u00b7 github.com/ByteDance-Seed/In-Place-TTT. MODELED \u00b7 inspired-not-real \u00b7 not claimed-as.";
|
| 460 |
-
card.appendChild(fn);
|
| 461 |
-
_overlay.appendChild(card);
|
| 462 |
-
|
| 463 |
-
const pl = document.createElement("button");
|
| 464 |
-
pl.textContent = "\u25d1 what this means";
|
| 465 |
-
pl.title = "Toggle plain-language explanation for investors & consumers.";
|
| 466 |
-
pl.style.cssText = "font:11px ui-monospace,monospace;padding:5px 11px;border-radius:7px;border:1px solid #3af4c8;background:#08140f;color:#3af4c8;cursor:pointer;width:fit-content";
|
| 467 |
-
pl.addEventListener("click", () => {
|
| 468 |
-
_plain = !_plain;
|
| 469 |
-
pl.style.background = _plain ? "#0f2a20" : "#08140f";
|
| 470 |
-
_applyPlain();
|
| 471 |
});
|
| 472 |
-
_overlay.appendChild(pl);
|
| 473 |
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
_el["
|
| 478 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 479 |
|
| 480 |
-
(ctx.container || document.body).appendChild(_overlay);
|
| 481 |
_paintOverlay();
|
| 482 |
}
|
| 483 |
|
| 484 |
-
function
|
| 485 |
-
const pd = _el["plain"];
|
| 486 |
-
if (!pd) return;
|
| 487 |
-
pd.style.display = _plain ? "block" : "none";
|
| 488 |
-
if (!_plain) return;
|
| 489 |
const chunks = S.numChunks != null ? String(S.numChunks) : "loading\u2026";
|
| 490 |
const aS = S.adaptStart != null ? S.adaptStart.toFixed(4) : "loading\u2026";
|
| 491 |
const aE = S.adaptEnd != null ? S.adaptEnd.toFixed(4) : "loading\u2026";
|
| 492 |
const fE = S.frozenEnd != null ? S.frozenEnd.toFixed(4) : "loading\u2026";
|
| 493 |
-
|
| 494 |
"<b>What this means:</b> Normally an AI model\u2019s weights are <b>frozen</b> once training ends \u2014 " +
|
| 495 |
"it can\u2019t learn anything new while it answers you. In-Place Test-Time Training lets the model " +
|
| 496 |
"keep learning <i>as it reads</i>, <b>without bolting on any new part</b>: it quietly re-uses one " +
|
|
@@ -504,7 +434,7 @@ function _applyPlain() {
|
|
| 504 |
"ByteDance model</b> and does <b>NOT</b> reproduce the paper\u2019s 128k-context or 4B-parameter results; " +
|
| 505 |
"the loss drop is a qualitative demonstration on a controlled stream, not a benchmark claim. " +
|
| 506 |
"(Different from <b>titans</b>, which adds a whole new memory module, and from <b>testtime</b>, which " +
|
| 507 |
-
"just spends more compute without changing any weights \u2014 here an existing weight actually moves.)";
|
| 508 |
}
|
| 509 |
|
| 510 |
function _tok(s) {
|
|
@@ -535,7 +465,7 @@ function _paintOverlay() {
|
|
| 535 |
_set("ip-delta", t || fx(S.deltaNorm, 3));
|
| 536 |
// honesty label verbatim — never upgraded
|
| 537 |
_set("ip-label", t || (S.label || "MODELED"));
|
| 538 |
-
if (
|
| 539 |
}
|
| 540 |
|
| 541 |
// =============================================================================
|
|
@@ -543,7 +473,7 @@ function _paintOverlay() {
|
|
| 543 |
// =============================================================================
|
| 544 |
export function unmount() {
|
| 545 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 546 |
-
try { if (
|
| 547 |
try {
|
| 548 |
if (_group && _stage) {
|
| 549 |
_group.traverse((o) => {
|
|
@@ -556,10 +486,10 @@ export function unmount() {
|
|
| 556 |
_stage.scene.remove(_group);
|
| 557 |
}
|
| 558 |
} catch (_) {}
|
| 559 |
-
_group =
|
| 560 |
_floor = null; _lattice = []; _upBar = null; _gateBar = null;
|
| 561 |
_adaptLine = null; _frozenLine = null; _core = null;
|
| 562 |
-
_el = {}; _badge = null;
|
| 563 |
_stage = _THREE = _ctx = null;
|
| 564 |
S.label = S.dModel = S.dFf = S.vocab = null;
|
| 565 |
S.chunkSize = S.numChunks = S.learningRate = null;
|
|
|
|
| 53 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 54 |
// Nothing here is in the locked-8. Λ stays Conjecture 1. Trust never 100%.
|
| 55 |
|
| 56 |
+
import { createShowcase } from "./_showcase.js";
|
| 57 |
+
|
| 58 |
const ID = "inplacettt";
|
| 59 |
const TITLE = "In-Place Test-Time Training · W_down as Fast Weights (live)";
|
| 60 |
|
|
|
|
| 80 |
const CURVE_SPAN = 12.0; // world-units the loss ribbons span along X
|
| 81 |
const CURVE_Y = 4.2; // baseline height of the loss ribbons
|
| 82 |
|
| 83 |
+
let _stage = null, _THREE = null, _ctx = null, _group = null, _show = null;
|
| 84 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
|
|
|
| 85 |
|
| 86 |
// geometry handles
|
| 87 |
let _floor = null;
|
|
|
|
| 384 |
// overlay
|
| 385 |
// =============================================================================
|
| 386 |
function _buildOverlay() {
|
| 387 |
+
_show = createShowcase(_ctx, {
|
| 388 |
+
id: ID, title: TITLE, accent: "#5b8dee",
|
| 389 |
+
badge: _badge,
|
| 390 |
+
chips: [{ label: "MODELED", text: "in-place test-time training", name: "hl" }],
|
| 391 |
+
legend: ["MODELED"],
|
| 392 |
+
description:
|
| 393 |
+
'Test-time adaptation with <b>no new module</b>: a stock MLP block\u2019s existing ' +
|
| 394 |
+
'<b>down-projection W_down</b> is re-purposed as <b>fast weights</b> (updated at inference), ' +
|
| 395 |
+
'while <b>W_up / W_gate stay frozen</b>. The update target is built by a <b>strictly-causal</b> ' +
|
| 396 |
+
'1-D convolution over past tokens (no future leakage), and one gradient step runs <b>per chunk</b>. ' +
|
| 397 |
+
'The <b>adapting</b> run\u2019s next-token loss <b>falls</b>; the <b>frozen-W_down control</b> stays <b>flat</b>. ' +
|
| 398 |
+
'Honesty label <b>MODELED</b> (inspired-not-real toy simulation; NOT the ByteDance model). 0 runtime CDN.',
|
| 399 |
+
citations:
|
| 400 |
+
"Feng et al. 2026 (ByteDance Seed + Peking Univ) \u00b7 In-Place Test-Time Training \u00b7 arXiv:2604.06169 (ICLR 2026 Oral) \u00b7 github.com/ByteDance-Seed/In-Place-TTT. MODELED \u00b7 inspired-not-real \u00b7 not claimed-as.",
|
| 401 |
+
plain: { html: _plainHtml },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 402 |
});
|
|
|
|
| 403 |
|
| 404 |
+
_el["ip-fast"] = _show.addField("fast weights (mutated)");
|
| 405 |
+
_el["ip-frozen"] = _show.addField("frozen slow weights");
|
| 406 |
+
_el["ip-chunks"] = _show.addField("chunks \u00d7 chunk_size");
|
| 407 |
+
_el["ip-lr"] = _show.addField("learning_rate (per chunk)");
|
| 408 |
+
_el["ip-causal"] = _show.addField("causal guard (no future leak)");
|
| 409 |
+
_el["ip-adapt"] = _show.addField("adapt loss (start \u2192 end) \u2014 MODELED");
|
| 410 |
+
_el["ip-frozenl"] = _show.addField("frozen-control loss (flat)");
|
| 411 |
+
_el["ip-improve"] = _show.addField("improvement (adapting advantage)");
|
| 412 |
+
_el["ip-delta"] = _show.addField("W_down movement (L1)");
|
| 413 |
+
_el["ip-label"] = _show.addField("honesty label");
|
| 414 |
|
|
|
|
| 415 |
_paintOverlay();
|
| 416 |
}
|
| 417 |
|
| 418 |
+
function _plainHtml() {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 419 |
const chunks = S.numChunks != null ? String(S.numChunks) : "loading\u2026";
|
| 420 |
const aS = S.adaptStart != null ? S.adaptStart.toFixed(4) : "loading\u2026";
|
| 421 |
const aE = S.adaptEnd != null ? S.adaptEnd.toFixed(4) : "loading\u2026";
|
| 422 |
const fE = S.frozenEnd != null ? S.frozenEnd.toFixed(4) : "loading\u2026";
|
| 423 |
+
return (
|
| 424 |
"<b>What this means:</b> Normally an AI model\u2019s weights are <b>frozen</b> once training ends \u2014 " +
|
| 425 |
"it can\u2019t learn anything new while it answers you. In-Place Test-Time Training lets the model " +
|
| 426 |
"keep learning <i>as it reads</i>, <b>without bolting on any new part</b>: it quietly re-uses one " +
|
|
|
|
| 434 |
"ByteDance model</b> and does <b>NOT</b> reproduce the paper\u2019s 128k-context or 4B-parameter results; " +
|
| 435 |
"the loss drop is a qualitative demonstration on a controlled stream, not a benchmark claim. " +
|
| 436 |
"(Different from <b>titans</b>, which adds a whole new memory module, and from <b>testtime</b>, which " +
|
| 437 |
+
"just spends more compute without changing any weights \u2014 here an existing weight actually moves.)");
|
| 438 |
}
|
| 439 |
|
| 440 |
function _tok(s) {
|
|
|
|
| 465 |
_set("ip-delta", t || fx(S.deltaNorm, 3));
|
| 466 |
// honesty label verbatim — never upgraded
|
| 467 |
_set("ip-label", t || (S.label || "MODELED"));
|
| 468 |
+
if (_show) { _show.setChip("hl", S.label || "MODELED", { text: "in-place test-time training" }); _show.refreshPlain(); }
|
| 469 |
}
|
| 470 |
|
| 471 |
// =============================================================================
|
|
|
|
| 473 |
// =============================================================================
|
| 474 |
export function unmount() {
|
| 475 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 476 |
+
try { if (_show) _show.destroy(); } catch (_) {}
|
| 477 |
try {
|
| 478 |
if (_group && _stage) {
|
| 479 |
_group.traverse((o) => {
|
|
|
|
| 486 |
_stage.scene.remove(_group);
|
| 487 |
}
|
| 488 |
} catch (_) {}
|
| 489 |
+
_group = _show = null;
|
| 490 |
_floor = null; _lattice = []; _upBar = null; _gateBar = null;
|
| 491 |
_adaptLine = null; _frozenLine = null; _core = null;
|
| 492 |
+
_el = {}; _badge = null; _frameReg = false;
|
| 493 |
_stage = _THREE = _ctx = null;
|
| 494 |
S.label = S.dModel = S.dFf = S.vocab = null;
|
| 495 |
S.chunkSize = S.numChunks = S.learningRate = null;
|
static/3d/surfaces/interpretability.js
CHANGED
|
@@ -36,6 +36,8 @@
|
|
| 36 |
// 0 RUNTIME CDN. Vendored three.js r170 via page importmap.
|
| 37 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 38 |
|
|
|
|
|
|
|
| 39 |
const ID = "interpretability";
|
| 40 |
const TITLE = "Interpretability · Sparse-Autoencoder Features (live)";
|
| 41 |
|
|
@@ -59,9 +61,8 @@ const C_GRID = 0x1b3a44; // floor / link colour
|
|
| 59 |
const N_SLOTS = 16; // visual dictionary slots on the ring (matches endpoint feature bank)
|
| 60 |
const RADIUS = 4.2; // world-unit ring radius
|
| 61 |
|
| 62 |
-
let _stage = null, _THREE = null, _ctx = null, _group = null,
|
| 63 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
| 64 |
-
let _plain = false;
|
| 65 |
|
| 66 |
// geometry handles
|
| 67 |
let _slots = []; // Array<THREE.Mesh> — one per dictionary slot on the ring
|
|
@@ -270,106 +271,35 @@ function _onFrame() {
|
|
| 270 |
// overlay
|
| 271 |
// =============================================================================
|
| 272 |
function _buildOverlay() {
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
_overlay.appendChild(h);
|
| 287 |
-
|
| 288 |
-
const sub = document.createElement("div");
|
| 289 |
-
sub.style.cssText = "color:#9fb1bf;font-size:11px;line-height:1.55";
|
| 290 |
-
sub.innerHTML =
|
| 291 |
-
'A <b>JumpReLU sparse autoencoder</b> decomposes a model\u2019s internal activation into a ' +
|
| 292 |
-
'few human-readable <b>features</b>; each fired feature is a node on the ring, and we ' +
|
| 293 |
-
'<b>causally ablate</b> it to measure the output shift (KL). Honesty label <b>MODELED</b> ' +
|
| 294 |
-
'(a simulation of the method \u2014 no proprietary weights, no measured logits). 0 runtime CDN.';
|
| 295 |
-
_overlay.appendChild(sub);
|
| 296 |
-
|
| 297 |
-
const brow = document.createElement("div");
|
| 298 |
-
brow.style.cssText = "display:flex;gap:8px;align-items:center;flex-wrap:wrap";
|
| 299 |
-
if (_badge && _badge.el) brow.appendChild(_badge.el);
|
| 300 |
-
_overlay.appendChild(brow);
|
| 301 |
-
|
| 302 |
-
const card = document.createElement("div");
|
| 303 |
-
card.style.cssText = "background:#0a1117;border:1px solid #1d2a36;border-radius:9px;padding:9px 10px;display:flex;flex-direction:column;gap:6px";
|
| 304 |
-
|
| 305 |
-
const chead = document.createElement("div");
|
| 306 |
-
chead.style.cssText = "display:flex;align-items:center;gap:8px;flex-wrap:wrap";
|
| 307 |
-
const dot = document.createElement("span");
|
| 308 |
-
dot.style.cssText = "width:9px;height:9px;border-radius:50%;background:#5b8dee;box-shadow:0 0 7px #5b8dee";
|
| 309 |
-
const nm = document.createElement("b");
|
| 310 |
-
nm.style.cssText = "font-size:12px;color:#5b8dee;letter-spacing:.3px";
|
| 311 |
-
nm.textContent = "interpretability";
|
| 312 |
-
chead.appendChild(dot); chead.appendChild(nm);
|
| 313 |
-
card.appendChild(chead);
|
| 314 |
-
|
| 315 |
-
const grid = document.createElement("div");
|
| 316 |
-
grid.style.cssText = "display:grid;grid-template-columns:1fr;gap:4px";
|
| 317 |
-
|
| 318 |
-
function kpiRow(id, label) {
|
| 319 |
-
const r = document.createElement("div");
|
| 320 |
-
r.style.cssText = "display:flex;justify-content:space-between;gap:10px;font-size:11px";
|
| 321 |
-
const l = document.createElement("span"); l.style.cssText = "color:#9fb1bf"; l.textContent = label;
|
| 322 |
-
const v = document.createElement("b");
|
| 323 |
-
v.id = id;
|
| 324 |
-
v.style.cssText = "font-variant-numeric:tabular-nums;color:#eef3f6;text-align:right;max-width:58%";
|
| 325 |
-
v.textContent = "\u2014";
|
| 326 |
-
_el[id] = v;
|
| 327 |
-
r.appendChild(l); r.appendChild(v); return r;
|
| 328 |
-
}
|
| 329 |
-
|
| 330 |
-
grid.appendChild(kpiRow("ip-l0", "L0 sparsity (active / dict)"));
|
| 331 |
-
grid.appendChild(kpiRow("ip-active", "active features"));
|
| 332 |
-
grid.appendChild(kpiRow("ip-recon", "reconstruction cos \u2014 MODELED"));
|
| 333 |
-
grid.appendChild(kpiRow("ip-topf", "top feature (by causal KL)"));
|
| 334 |
-
grid.appendChild(kpiRow("ip-label", "honesty label"));
|
| 335 |
-
card.appendChild(grid);
|
| 336 |
-
|
| 337 |
-
const fn = document.createElement("div");
|
| 338 |
-
fn.style.cssText = "font-size:9.5px;color:#6b7a86;line-height:1.5";
|
| 339 |
-
fn.textContent = "Cunningham et al. arXiv:2309.08600 \u00b7 Rajamanoharan et al. arXiv:2407.14435 (JumpReLU) \u00b7 Marks et al. arXiv:2406.02395 (sparse feature circuits) \u00b7 Anthropic transformer-circuits.pub. MODELED \u00b7 not claimed-as.";
|
| 340 |
-
card.appendChild(fn);
|
| 341 |
-
_overlay.appendChild(card);
|
| 342 |
-
|
| 343 |
-
const pl = document.createElement("button");
|
| 344 |
-
pl.textContent = "\u25d1 what this means";
|
| 345 |
-
pl.title = "Toggle plain-language explanation for investors & consumers.";
|
| 346 |
-
pl.style.cssText = "font:11px ui-monospace,monospace;padding:5px 11px;border-radius:7px;border:1px solid #3af4c8;background:#08140f;color:#3af4c8;cursor:pointer;width:fit-content";
|
| 347 |
-
pl.addEventListener("click", () => {
|
| 348 |
-
_plain = !_plain;
|
| 349 |
-
pl.style.background = _plain ? "#0f2a20" : "#08140f";
|
| 350 |
-
_applyPlain();
|
| 351 |
});
|
| 352 |
-
_overlay.appendChild(pl);
|
| 353 |
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
_el["
|
| 358 |
-
|
| 359 |
|
| 360 |
-
(ctx.container || document.body).appendChild(_overlay);
|
| 361 |
_paintOverlay();
|
| 362 |
}
|
| 363 |
|
| 364 |
-
function
|
| 365 |
-
const pd = _el["plain"];
|
| 366 |
-
if (!pd) return;
|
| 367 |
-
pd.style.display = _plain ? "block" : "none";
|
| 368 |
-
if (!_plain) return;
|
| 369 |
const act = S.active != null ? String(S.active) : "loading\u2026";
|
| 370 |
const l0 = S.l0 != null ? (S.l0 * 100).toFixed(3) + "% of the dictionary" : "loading\u2026";
|
| 371 |
const top = (S.top && S.top[0] && S.top[0].feature) ? S.top[0].feature : "loading\u2026";
|
| 372 |
-
|
| 373 |
"<b>What this means:</b> Instead of treating the model as a black box, a sparse " +
|
| 374 |
"autoencoder breaks one internal activation into a handful of named, human-readable " +
|
| 375 |
"<b>features</b> \u2014 here <b>" + act + "</b> fired (only <b>" + l0 + "</b>). " +
|
|
@@ -377,7 +307,7 @@ function _applyPlain() {
|
|
| 377 |
"the model\u2019s output the most. " +
|
| 378 |
"Plain: this is how you audit <i>why</i> an AI produced an answer and prove which internal " +
|
| 379 |
"concept drove it \u2014 but this view is a <b>MODELED</b> simulation of the technique, not a " +
|
| 380 |
-
"readout from a live production model.";
|
| 381 |
}
|
| 382 |
|
| 383 |
function _tok(s) {
|
|
@@ -400,7 +330,7 @@ function _paintOverlay() {
|
|
| 400 |
_set("ip-topf", t || (top0 ? (top0.feature + " (KL " + fx(top0.causal_ablation_kl, 3) + ")") : "\u2014"));
|
| 401 |
// honesty label verbatim — never upgraded
|
| 402 |
_set("ip-label", t || (S.label || "MODELED"));
|
| 403 |
-
if (
|
| 404 |
}
|
| 405 |
|
| 406 |
// =============================================================================
|
|
@@ -408,7 +338,7 @@ function _paintOverlay() {
|
|
| 408 |
// =============================================================================
|
| 409 |
export function unmount() {
|
| 410 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 411 |
-
try { if (
|
| 412 |
try {
|
| 413 |
if (_group && _stage) {
|
| 414 |
_group.traverse((o) => {
|
|
@@ -421,9 +351,9 @@ export function unmount() {
|
|
| 421 |
_stage.scene.remove(_group);
|
| 422 |
}
|
| 423 |
} catch (_) {}
|
| 424 |
-
_group =
|
| 425 |
_slots = []; _links = null; _hub = null; _ring = null;
|
| 426 |
-
_el = {}; _badge = null;
|
| 427 |
_stage = _THREE = _ctx = null;
|
| 428 |
S.label = S.l0 = S.active = S.recon = S.top = null;
|
| 429 |
S.state = "init";
|
|
|
|
| 36 |
// 0 RUNTIME CDN. Vendored three.js r170 via page importmap.
|
| 37 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 38 |
|
| 39 |
+
import { createShowcase } from "./_showcase.js";
|
| 40 |
+
|
| 41 |
const ID = "interpretability";
|
| 42 |
const TITLE = "Interpretability · Sparse-Autoencoder Features (live)";
|
| 43 |
|
|
|
|
| 61 |
const N_SLOTS = 16; // visual dictionary slots on the ring (matches endpoint feature bank)
|
| 62 |
const RADIUS = 4.2; // world-unit ring radius
|
| 63 |
|
| 64 |
+
let _stage = null, _THREE = null, _ctx = null, _group = null, _show = null;
|
| 65 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
|
|
|
| 66 |
|
| 67 |
// geometry handles
|
| 68 |
let _slots = []; // Array<THREE.Mesh> — one per dictionary slot on the ring
|
|
|
|
| 271 |
// overlay
|
| 272 |
// =============================================================================
|
| 273 |
function _buildOverlay() {
|
| 274 |
+
_show = createShowcase(_ctx, {
|
| 275 |
+
id: ID, title: TITLE, accent: "#5b8dee",
|
| 276 |
+
badge: _badge,
|
| 277 |
+
chips: [{ label: "MODELED", text: "interpretability", name: "hl" }],
|
| 278 |
+
legend: ["MODELED"],
|
| 279 |
+
description:
|
| 280 |
+
'A <b>JumpReLU sparse autoencoder</b> decomposes a model\u2019s internal activation into a ' +
|
| 281 |
+
'few human-readable <b>features</b>; each fired feature is a node on the ring, and we ' +
|
| 282 |
+
'<b>causally ablate</b> it to measure the output shift (KL). Honesty label <b>MODELED</b> ' +
|
| 283 |
+
'(a simulation of the method \u2014 no proprietary weights, no measured logits). 0 runtime CDN.',
|
| 284 |
+
citations:
|
| 285 |
+
"Cunningham et al. arXiv:2309.08600 \u00b7 Rajamanoharan et al. arXiv:2407.14435 (JumpReLU) \u00b7 Marks et al. arXiv:2406.02395 (sparse feature circuits) \u00b7 Anthropic transformer-circuits.pub. MODELED \u00b7 not claimed-as.",
|
| 286 |
+
plain: { html: _plainHtml },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 287 |
});
|
|
|
|
| 288 |
|
| 289 |
+
_el["ip-l0"] = _show.addField("L0 sparsity (active / dict)");
|
| 290 |
+
_el["ip-active"] = _show.addField("active features");
|
| 291 |
+
_el["ip-recon"] = _show.addField("reconstruction cos \u2014 MODELED");
|
| 292 |
+
_el["ip-topf"] = _show.addField("top feature (by causal KL)");
|
| 293 |
+
_el["ip-label"] = _show.addField("honesty label");
|
| 294 |
|
|
|
|
| 295 |
_paintOverlay();
|
| 296 |
}
|
| 297 |
|
| 298 |
+
function _plainHtml() {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 299 |
const act = S.active != null ? String(S.active) : "loading\u2026";
|
| 300 |
const l0 = S.l0 != null ? (S.l0 * 100).toFixed(3) + "% of the dictionary" : "loading\u2026";
|
| 301 |
const top = (S.top && S.top[0] && S.top[0].feature) ? S.top[0].feature : "loading\u2026";
|
| 302 |
+
return (
|
| 303 |
"<b>What this means:</b> Instead of treating the model as a black box, a sparse " +
|
| 304 |
"autoencoder breaks one internal activation into a handful of named, human-readable " +
|
| 305 |
"<b>features</b> \u2014 here <b>" + act + "</b> fired (only <b>" + l0 + "</b>). " +
|
|
|
|
| 307 |
"the model\u2019s output the most. " +
|
| 308 |
"Plain: this is how you audit <i>why</i> an AI produced an answer and prove which internal " +
|
| 309 |
"concept drove it \u2014 but this view is a <b>MODELED</b> simulation of the technique, not a " +
|
| 310 |
+
"readout from a live production model.");
|
| 311 |
}
|
| 312 |
|
| 313 |
function _tok(s) {
|
|
|
|
| 330 |
_set("ip-topf", t || (top0 ? (top0.feature + " (KL " + fx(top0.causal_ablation_kl, 3) + ")") : "\u2014"));
|
| 331 |
// honesty label verbatim — never upgraded
|
| 332 |
_set("ip-label", t || (S.label || "MODELED"));
|
| 333 |
+
if (_show) { _show.setChip("hl", S.label || "MODELED", { text: "interpretability" }); _show.refreshPlain(); }
|
| 334 |
}
|
| 335 |
|
| 336 |
// =============================================================================
|
|
|
|
| 338 |
// =============================================================================
|
| 339 |
export function unmount() {
|
| 340 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 341 |
+
try { if (_show) _show.destroy(); } catch (_) {}
|
| 342 |
try {
|
| 343 |
if (_group && _stage) {
|
| 344 |
_group.traverse((o) => {
|
|
|
|
| 351 |
_stage.scene.remove(_group);
|
| 352 |
}
|
| 353 |
} catch (_) {}
|
| 354 |
+
_group = _show = null;
|
| 355 |
_slots = []; _links = null; _hub = null; _ring = null;
|
| 356 |
+
_el = {}; _badge = null; _frameReg = false;
|
| 357 |
_stage = _THREE = _ctx = null;
|
| 358 |
S.label = S.l0 = S.active = S.recon = S.top = null;
|
| 359 |
S.state = "init";
|
static/3d/surfaces/kan.js
CHANGED
|
@@ -36,6 +36,8 @@
|
|
| 36 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 37 |
// Nothing here is in the locked-8. Lambda stays Conjecture 1. Trust never 100%.
|
| 38 |
|
|
|
|
|
|
|
| 39 |
const ID = "kan";
|
| 40 |
const TITLE = "Kolmogorov-Arnold Network · Per-Edge Splines (live)";
|
| 41 |
|
|
@@ -57,9 +59,8 @@ const NODE_GAP = 1.6; // world-units between nodes within a layer (Y)
|
|
| 57 |
const MAX_HIDDEN = 8; // pre-allocated hidden-node capacity (perf cap)
|
| 58 |
const CURVE_SEGS = 23; // spline sample segments per edge (matches server's 24 samples)
|
| 59 |
|
| 60 |
-
let _stage = null, _THREE = null, _ctx = null, _group = null,
|
| 61 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
| 62 |
-
let _plain = false;
|
| 63 |
let _markerBaseScale = 1.0;
|
| 64 |
|
| 65 |
// geometry handles
|
|
@@ -326,109 +327,38 @@ function _onFrame() {
|
|
| 326 |
// overlay
|
| 327 |
// =============================================================================
|
| 328 |
function _buildOverlay() {
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
const sub = document.createElement("div");
|
| 345 |
-
sub.style.cssText = "color:#9fb1bf;font-size:11px;line-height:1.55";
|
| 346 |
-
sub.innerHTML =
|
| 347 |
-
'A <b>Kolmogorov-Arnold Network</b> puts a learnable curve (spline) on every ' +
|
| 348 |
-
'<b>edge</b> instead of a single scalar weight; nodes just sum their inputs. ' +
|
| 349 |
-
'Fitted here on the toy task <code>f(x,y)=exp(sin(\u03c0x)+y\u00b2)</code>, each curved ' +
|
| 350 |
-
'line below is one edge\u2019s own learned shape. Honesty label <b>MODELED</b> ' +
|
| 351 |
-
'(small from-scratch fit; NOT pykan). 0 runtime CDN.';
|
| 352 |
-
_overlay.appendChild(sub);
|
| 353 |
-
|
| 354 |
-
const brow = document.createElement("div");
|
| 355 |
-
brow.style.cssText = "display:flex;gap:8px;align-items:center;flex-wrap:wrap";
|
| 356 |
-
if (_badge && _badge.el) brow.appendChild(_badge.el);
|
| 357 |
-
_overlay.appendChild(brow);
|
| 358 |
-
|
| 359 |
-
const card = document.createElement("div");
|
| 360 |
-
card.style.cssText = "background:#0a1117;border:1px solid #1d2a36;border-radius:9px;padding:9px 10px;display:flex;flex-direction:column;gap:6px";
|
| 361 |
-
|
| 362 |
-
const chead = document.createElement("div");
|
| 363 |
-
chead.style.cssText = "display:flex;align-items:center;gap:8px;flex-wrap:wrap";
|
| 364 |
-
const dot = document.createElement("span");
|
| 365 |
-
dot.style.cssText = "width:9px;height:9px;border-radius:50%;background:#3af4c8;box-shadow:0 0 7px #3af4c8";
|
| 366 |
-
const nm = document.createElement("b");
|
| 367 |
-
nm.style.cssText = "font-size:12px;color:#3af4c8;letter-spacing:.3px";
|
| 368 |
-
nm.textContent = "kolmogorov-arnold network";
|
| 369 |
-
chead.appendChild(dot); chead.appendChild(nm);
|
| 370 |
-
card.appendChild(chead);
|
| 371 |
-
|
| 372 |
-
const grid = document.createElement("div");
|
| 373 |
-
grid.style.cssText = "display:grid;grid-template-columns:1fr;gap:4px";
|
| 374 |
-
|
| 375 |
-
function kpiRow(id, label) {
|
| 376 |
-
const r = document.createElement("div");
|
| 377 |
-
r.style.cssText = "display:flex;justify-content:space-between;gap:10px;font-size:11px";
|
| 378 |
-
const l = document.createElement("span"); l.style.cssText = "color:#9fb1bf"; l.textContent = label;
|
| 379 |
-
const v = document.createElement("b");
|
| 380 |
-
v.id = id;
|
| 381 |
-
v.style.cssText = "font-variant-numeric:tabular-nums;color:#eef3f6;text-align:right;max-width:58%";
|
| 382 |
-
v.textContent = "\u2014";
|
| 383 |
-
_el[id] = v;
|
| 384 |
-
r.appendChild(l); r.appendChild(v); return r;
|
| 385 |
-
}
|
| 386 |
-
|
| 387 |
-
grid.appendChild(kpiRow("kan-formula", "target f(x,y)"));
|
| 388 |
-
grid.appendChild(kpiRow("kan-params", "KAN params \u2014 MODELED"));
|
| 389 |
-
grid.appendChild(kpiRow("kan-mse", "KAN final MSE"));
|
| 390 |
-
grid.appendChild(kpiRow("kan-mlpparams","MLP-baseline params"));
|
| 391 |
-
grid.appendChild(kpiRow("kan-mlpmse", "MLP-baseline final MSE"));
|
| 392 |
-
grid.appendChild(kpiRow("kan-fewer", "KAN fewer params?"));
|
| 393 |
-
grid.appendChild(kpiRow("kan-label", "honesty label"));
|
| 394 |
-
card.appendChild(grid);
|
| 395 |
-
|
| 396 |
-
const fn = document.createElement("div");
|
| 397 |
-
fn.style.cssText = "font-size:9.5px;color:#6b7a86;line-height:1.5";
|
| 398 |
-
fn.textContent = "Liu et al. 2024 arXiv:2404.19756 (KAN) \u00b7 pykan github.com/KindXiaoming/pykan (reference only). MODELED \u00b7 not claimed-as.";
|
| 399 |
-
card.appendChild(fn);
|
| 400 |
-
_overlay.appendChild(card);
|
| 401 |
-
|
| 402 |
-
const pl = document.createElement("button");
|
| 403 |
-
pl.textContent = "\u25d1 what this means";
|
| 404 |
-
pl.title = "Toggle plain-language explanation for investors & consumers.";
|
| 405 |
-
pl.style.cssText = "font:11px ui-monospace,monospace;padding:5px 11px;border-radius:7px;border:1px solid #3af4c8;background:#08140f;color:#3af4c8;cursor:pointer;width:fit-content";
|
| 406 |
-
pl.addEventListener("click", () => {
|
| 407 |
-
_plain = !_plain;
|
| 408 |
-
pl.style.background = _plain ? "#0f2a20" : "#08140f";
|
| 409 |
-
_applyPlain();
|
| 410 |
});
|
| 411 |
-
_overlay.appendChild(pl);
|
| 412 |
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
_el["
|
| 417 |
-
|
|
|
|
|
|
|
| 418 |
|
| 419 |
-
(ctx.container || document.body).appendChild(_overlay);
|
| 420 |
_paintOverlay();
|
| 421 |
}
|
| 422 |
|
| 423 |
-
function
|
| 424 |
-
const pd = _el["plain"];
|
| 425 |
-
if (!pd) return;
|
| 426 |
-
pd.style.display = _plain ? "block" : "none";
|
| 427 |
-
if (!_plain) return;
|
| 428 |
const kp = S.kanParams != null ? String(S.kanParams) : "loading\u2026";
|
| 429 |
const mp = S.mlpParams != null ? String(S.mlpParams) : "loading\u2026";
|
| 430 |
const km = S.kanMse != null ? S.kanMse.toFixed(4) : "loading\u2026";
|
| 431 |
-
|
| 432 |
"<b>What this means:</b> Most neural networks learn a number (a \u201cweight\u201d) for " +
|
| 433 |
"each connection. A Kolmogorov-Arnold Network instead learns a whole <b>curve</b> for " +
|
| 434 |
"each connection \u2014 you can see the exact shape of every one of those curves above. " +
|
|
@@ -437,7 +367,7 @@ function _applyPlain() {
|
|
| 437 |
"match accuracy with fewer connections at larger scale. Here it has <b>" + kp + "</b> " +
|
| 438 |
"learned numbers vs a same-size ordinary network's <b>" + mp + "</b>, reaching a fit " +
|
| 439 |
"error of <b>" + km + "</b> on the toy formula shown. This view is a small, from-scratch, " +
|
| 440 |
-
"<b>MODELED</b> demonstration \u2014 not the original pykan library or a large-scale KAN.";
|
| 441 |
}
|
| 442 |
|
| 443 |
function _tok(s) {
|
|
@@ -461,7 +391,7 @@ function _paintOverlay() {
|
|
| 461 |
_set("kan-fewer", t || (S.fewerParams === true ? "yes" : S.fewerParams === false ? "no" : "\u2014"));
|
| 462 |
// honesty label verbatim — never upgraded
|
| 463 |
_set("kan-label", t || (S.label || "MODELED"));
|
| 464 |
-
if (
|
| 465 |
}
|
| 466 |
|
| 467 |
// =============================================================================
|
|
@@ -469,7 +399,7 @@ function _paintOverlay() {
|
|
| 469 |
// =============================================================================
|
| 470 |
export function unmount() {
|
| 471 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 472 |
-
try { if (
|
| 473 |
try {
|
| 474 |
if (_group && _stage) {
|
| 475 |
_group.traverse((o) => {
|
|
@@ -482,10 +412,10 @@ export function unmount() {
|
|
| 482 |
_stage.scene.remove(_group);
|
| 483 |
}
|
| 484 |
} catch (_) {}
|
| 485 |
-
_group =
|
| 486 |
_floor = null; _inputNodes = []; _hiddenNodes = []; _outputNode = null;
|
| 487 |
_edgeCurves1 = []; _edgeCurves2 = []; _marker = null;
|
| 488 |
-
_el = {}; _badge = null;
|
| 489 |
_stage = _THREE = _ctx = null;
|
| 490 |
S.label = S.formula = S.kanParams = S.kanMse = S.kanLoss = null;
|
| 491 |
S.mlpParams = S.mlpMse = S.fewerParams = S.edgeShapes = S.distilled = null;
|
|
|
|
| 36 |
// DOCTRINE v11: degrades gracefully (grey) on 404/error; honesty label still shown.
|
| 37 |
// Nothing here is in the locked-8. Lambda stays Conjecture 1. Trust never 100%.
|
| 38 |
|
| 39 |
+
import { createShowcase } from "./_showcase.js";
|
| 40 |
+
|
| 41 |
const ID = "kan";
|
| 42 |
const TITLE = "Kolmogorov-Arnold Network · Per-Edge Splines (live)";
|
| 43 |
|
|
|
|
| 59 |
const MAX_HIDDEN = 8; // pre-allocated hidden-node capacity (perf cap)
|
| 60 |
const CURVE_SEGS = 23; // spline sample segments per edge (matches server's 24 samples)
|
| 61 |
|
| 62 |
+
let _stage = null, _THREE = null, _ctx = null, _group = null, _show = null;
|
| 63 |
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
|
|
|
| 64 |
let _markerBaseScale = 1.0;
|
| 65 |
|
| 66 |
// geometry handles
|
|
|
|
| 327 |
// overlay
|
| 328 |
// =============================================================================
|
| 329 |
function _buildOverlay() {
|
| 330 |
+
_show = createShowcase(_ctx, {
|
| 331 |
+
id: ID, title: TITLE, accent: "#5b8dee",
|
| 332 |
+
badge: _badge,
|
| 333 |
+
chips: [{ label: "MODELED", text: "kolmogorov-arnold network", name: "hl" }],
|
| 334 |
+
legend: ["MODELED"],
|
| 335 |
+
description:
|
| 336 |
+
'A <b>Kolmogorov-Arnold Network</b> puts a learnable curve (spline) on every ' +
|
| 337 |
+
'<b>edge</b> instead of a single scalar weight; nodes just sum their inputs. ' +
|
| 338 |
+
'Fitted here on the toy task <code>f(x,y)=exp(sin(\u03c0x)+y\u00b2)</code>, each curved ' +
|
| 339 |
+
'line below is one edge\u2019s own learned shape. Honesty label <b>MODELED</b> ' +
|
| 340 |
+
'(small from-scratch fit; NOT pykan). 0 runtime CDN.',
|
| 341 |
+
citations:
|
| 342 |
+
"Liu et al. 2024 arXiv:2404.19756 (KAN) \u00b7 pykan github.com/KindXiaoming/pykan (reference only). MODELED \u00b7 not claimed-as.",
|
| 343 |
+
plain: { html: _plainHtml },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 344 |
});
|
|
|
|
| 345 |
|
| 346 |
+
_el["kan-formula"] = _show.addField("target f(x,y)");
|
| 347 |
+
_el["kan-params"] = _show.addField("KAN params \u2014 MODELED");
|
| 348 |
+
_el["kan-mse"] = _show.addField("KAN final MSE");
|
| 349 |
+
_el["kan-mlpparams"] = _show.addField("MLP-baseline params");
|
| 350 |
+
_el["kan-mlpmse"] = _show.addField("MLP-baseline final MSE");
|
| 351 |
+
_el["kan-fewer"] = _show.addField("KAN fewer params?");
|
| 352 |
+
_el["kan-label"] = _show.addField("honesty label");
|
| 353 |
|
|
|
|
| 354 |
_paintOverlay();
|
| 355 |
}
|
| 356 |
|
| 357 |
+
function _plainHtml() {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 358 |
const kp = S.kanParams != null ? String(S.kanParams) : "loading\u2026";
|
| 359 |
const mp = S.mlpParams != null ? String(S.mlpParams) : "loading\u2026";
|
| 360 |
const km = S.kanMse != null ? S.kanMse.toFixed(4) : "loading\u2026";
|
| 361 |
+
return (
|
| 362 |
"<b>What this means:</b> Most neural networks learn a number (a \u201cweight\u201d) for " +
|
| 363 |
"each connection. A Kolmogorov-Arnold Network instead learns a whole <b>curve</b> for " +
|
| 364 |
"each connection \u2014 you can see the exact shape of every one of those curves above. " +
|
|
|
|
| 367 |
"match accuracy with fewer connections at larger scale. Here it has <b>" + kp + "</b> " +
|
| 368 |
"learned numbers vs a same-size ordinary network's <b>" + mp + "</b>, reaching a fit " +
|
| 369 |
"error of <b>" + km + "</b> on the toy formula shown. This view is a small, from-scratch, " +
|
| 370 |
+
"<b>MODELED</b> demonstration \u2014 not the original pykan library or a large-scale KAN.");
|
| 371 |
}
|
| 372 |
|
| 373 |
function _tok(s) {
|
|
|
|
| 391 |
_set("kan-fewer", t || (S.fewerParams === true ? "yes" : S.fewerParams === false ? "no" : "\u2014"));
|
| 392 |
// honesty label verbatim — never upgraded
|
| 393 |
_set("kan-label", t || (S.label || "MODELED"));
|
| 394 |
+
if (_show) { _show.setChip("hl", S.label || "MODELED", { text: "kolmogorov-arnold network" }); _show.refreshPlain(); }
|
| 395 |
}
|
| 396 |
|
| 397 |
// =============================================================================
|
|
|
|
| 399 |
// =============================================================================
|
| 400 |
export function unmount() {
|
| 401 |
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 402 |
+
try { if (_show) _show.destroy(); } catch (_) {}
|
| 403 |
try {
|
| 404 |
if (_group && _stage) {
|
| 405 |
_group.traverse((o) => {
|
|
|
|
| 412 |
_stage.scene.remove(_group);
|
| 413 |
}
|
| 414 |
} catch (_) {}
|
| 415 |
+
_group = _show = null;
|
| 416 |
_floor = null; _inputNodes = []; _hiddenNodes = []; _outputNode = null;
|
| 417 |
_edgeCurves1 = []; _edgeCurves2 = []; _marker = null;
|
| 418 |
+
_el = {}; _badge = null; _frameReg = false; _markerBaseScale = 1.0;
|
| 419 |
_stage = _THREE = _ctx = null;
|
| 420 |
S.label = S.formula = S.kanParams = S.kanMse = S.kanLoss = null;
|
| 421 |
S.mlpParams = S.mlpMse = S.fewerParams = S.edgeShapes = S.distilled = null;
|