Spaces:
Sleeping
Sleeping
Update index.html
Browse files- index.html +120 -73
index.html
CHANGED
|
@@ -8,84 +8,110 @@
|
|
| 8 |
<style>
|
| 9 |
body { background: #06090e; color: #cbd5e1; }
|
| 10 |
.glass { background: rgba(15,23,42,0.95); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.08); }
|
| 11 |
-
select, input { background: #0f172a; color: #60a5fa; border: 1px solid #334155; padding: 4px; border-radius: 4px; font-weight: bold;}
|
|
|
|
|
|
|
|
|
|
| 12 |
</style>
|
| 13 |
</head>
|
| 14 |
-
<body class="flex h-screen overflow-hidden text-sm">
|
| 15 |
|
| 16 |
-
<aside id="sidebar" class="w-
|
| 17 |
-
<div class="p-4 border-b border-slate-700
|
| 18 |
-
<h1 class="text-xl font-
|
| 19 |
</div>
|
| 20 |
|
| 21 |
-
<div class="p-
|
| 22 |
-
|
| 23 |
-
<
|
| 24 |
-
|
| 25 |
-
<
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
| 28 |
</select>
|
| 29 |
-
<
|
| 30 |
-
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
</select>
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
| 36 |
</label>
|
| 37 |
</div>
|
| 38 |
|
| 39 |
-
<!--
|
| 40 |
-
<div class="p-
|
| 41 |
-
<h3 class="font-bold text-green-400 text-
|
| 42 |
-
<
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
| 45 |
</select>
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
<
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
| 50 |
</div>
|
| 51 |
</div>
|
| 52 |
|
| 53 |
-
<!--
|
| 54 |
-
<div class="p-
|
| 55 |
-
<h3 class="font-bold text-purple-400 text-
|
| 56 |
-
<
|
| 57 |
-
|
| 58 |
-
<
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
<span>Max Target</span> <input type="number" id="b_max" value="100" class="w-16">
|
| 64 |
</div>
|
| 65 |
-
<button onclick="triggerBatch()" class="w-full py-2 bg-purple-
|
| 66 |
</div>
|
|
|
|
|
|
|
| 67 |
|
| 68 |
-
<button onclick="triggerHalt()" class="w-full py-2 bg-red-900 border border-red-500 text-red-100 font-bold hover:bg-red-600 shadow rounded">⚠ PANIC: STOP QUEUE</button>
|
| 69 |
</div>
|
| 70 |
</aside>
|
| 71 |
|
| 72 |
<main class="flex-grow flex flex-col h-screen">
|
| 73 |
-
<div class="h-[65%] w-full" id="plot"></div>
|
| 74 |
-
<div class="h-[35%] flex
|
| 75 |
-
|
| 76 |
-
<
|
| 77 |
-
|
|
|
|
| 78 |
</div>
|
| 79 |
-
<!--
|
| 80 |
<div class="w-[50%] bg-black p-4 font-mono overflow-y-auto flex flex-col gap-1 text-[10px] tracking-wide text-green-500 relative">
|
| 81 |
-
<div class="absolute inset-0 bg-[linear-gradient(rgba(
|
| 82 |
-
<div
|
|
|
|
| 83 |
</div>
|
| 84 |
</div>
|
| 85 |
</main>
|
| 86 |
|
| 87 |
<script>
|
| 88 |
-
const endpoint = ''; //
|
| 89 |
|
| 90 |
async function sendConfig() {
|
| 91 |
await fetch('/apply_config', {
|
|
@@ -100,6 +126,7 @@
|
|
| 100 |
}
|
| 101 |
|
| 102 |
async function triggerSingle() {
|
|
|
|
| 103 |
await fetch('/single_run', {
|
| 104 |
method: 'POST', headers: {'Content-Type':'application/json'},
|
| 105 |
body: JSON.stringify({ target: document.getElementById('singleVal').value })
|
|
@@ -107,7 +134,7 @@
|
|
| 107 |
}
|
| 108 |
|
| 109 |
async function triggerBatch() {
|
| 110 |
-
await sendConfig();
|
| 111 |
await fetch('/batch_run', {
|
| 112 |
method: 'POST', headers: {'Content-Type':'application/json'},
|
| 113 |
body: JSON.stringify({
|
|
@@ -120,7 +147,7 @@
|
|
| 120 |
|
| 121 |
async function triggerHalt() { await fetch('/halt', { method: 'POST'}); }
|
| 122 |
|
| 123 |
-
//
|
| 124 |
setInterval(async () => {
|
| 125 |
try {
|
| 126 |
let res = await fetch('/state');
|
|
@@ -128,44 +155,64 @@
|
|
| 128 |
|
| 129 |
let isTraining = document.getElementById('engineMode').value === "training";
|
| 130 |
|
| 131 |
-
//
|
| 132 |
-
let px=[], py=[], pz=[],
|
| 133 |
-
|
|
|
|
|
|
|
| 134 |
|
|
|
|
| 135 |
Object.keys(d.nodes).forEach(id => {
|
| 136 |
let v = d.nodes[id];
|
| 137 |
px.push(v.x); py.push(v.y); pz.push(v.z);
|
| 138 |
-
let
|
| 139 |
-
|
| 140 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
});
|
| 142 |
|
| 143 |
-
document.getElementById('tracker').innerHTML =
|
| 144 |
-
|
|
|
|
|
|
|
| 145 |
|
| 146 |
-
|
|
|
|
|
|
|
| 147 |
x: px.concat([px[0]]), y: py.concat([py[0]]), z: pz.concat([pz[0]]),
|
| 148 |
text: Object.keys(d.nodes).concat(['']),
|
| 149 |
-
textfont:{color:'
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
|
|
|
| 153 |
};
|
| 154 |
|
| 155 |
-
let
|
| 156 |
-
margin: { l: 0, r: 0, b: 0, t:
|
| 157 |
scene: {
|
| 158 |
-
camera: { eye: {x:0, y:-1.5, z:1.
|
| 159 |
-
xaxis: {title:'
|
| 160 |
-
yaxis: {title:'
|
|
|
|
| 161 |
}
|
| 162 |
};
|
| 163 |
|
| 164 |
-
if(!window.
|
| 165 |
-
else { Plotly.react('plot', [
|
| 166 |
|
| 167 |
} catch(e) {}
|
| 168 |
-
},
|
| 169 |
</script>
|
| 170 |
</body>
|
| 171 |
</html>
|
|
|
|
| 8 |
<style>
|
| 9 |
body { background: #06090e; color: #cbd5e1; }
|
| 10 |
.glass { background: rgba(15,23,42,0.95); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.08); }
|
| 11 |
+
select, input { background: #0f172a; color: #60a5fa; border: 1px solid #334155; padding: 4px; border-radius: 4px; font-weight: bold; width: 100%;}
|
| 12 |
+
input[type="checkbox"] { width: auto; }
|
| 13 |
+
::-webkit-scrollbar { width: 6px; }
|
| 14 |
+
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px;}
|
| 15 |
</style>
|
| 16 |
</head>
|
| 17 |
+
<body class="flex h-screen overflow-hidden text-sm font-sans tracking-wide">
|
| 18 |
|
| 19 |
+
<aside id="sidebar" class="w-[420px] h-full glass border-r border-slate-700 flex flex-col z-20 flex-shrink-0 shadow-2xl">
|
| 20 |
+
<div class="p-4 border-b border-slate-700 bg-slate-900 shadow text-center">
|
| 21 |
+
<h1 class="text-xl font-black tracking-tight text-blue-400">LABORATORY DIALS</h1>
|
| 22 |
</div>
|
| 23 |
|
| 24 |
+
<div class="p-5 space-y-6 overflow-y-auto custom-scroll flex-grow pb-10">
|
| 25 |
+
|
| 26 |
+
<!-- SECTION 1: EXECUTION PHASE -->
|
| 27 |
+
<div class="p-4 border border-slate-700 bg-black/60 rounded-md">
|
| 28 |
+
<h3 class="font-bold text-orange-400 text-[13px] mb-1 tracking-widest border-b border-slate-800 pb-1">1. EXECUTION PHASE</h3>
|
| 29 |
+
<p class="text-[10.5px] text-slate-400 mb-3 leading-tight font-serif italic">What part of the mesh are we updating? Dimensional space (solving a problem) or internal physics (forming memory)?</p>
|
| 30 |
+
|
| 31 |
+
<select id="engineMode" onchange="sendConfig()" class="text-[13px] py-1.5 cursor-pointer text-white">
|
| 32 |
+
<option value="inference">⚙ INFERENCE (Move space, calculate answers)</option>
|
| 33 |
+
<option value="training">🎯 TRAINING (Lock nodes, optimize stiffness 'K')</option>
|
| 34 |
</select>
|
| 35 |
+
<div class="mt-2 text-[10px] text-blue-200/50 pl-2 border-l border-blue-500/30">
|
| 36 |
+
* In <b>INFERENCE</b>, A & B freely slide to find correct factor numbers. <br>
|
| 37 |
+
* In <b>TRAINING</b>, A & B lock mathematically to objective C; the strain updates their structural memory (K-coef).
|
| 38 |
+
</div>
|
| 39 |
+
</div>
|
| 40 |
+
|
| 41 |
+
<!-- SECTION 2: TOPOLOGICAL PHYSICS LAWS -->
|
| 42 |
+
<div class="p-4 border border-slate-700 bg-black/60 rounded-md">
|
| 43 |
+
<h3 class="font-bold text-sky-400 text-[13px] mb-1 tracking-widest border-b border-slate-800 pb-1">2. TOPOLOGICAL LAWS</h3>
|
| 44 |
+
<p class="text-[10.5px] text-slate-400 mb-3 leading-tight font-serif italic">How do physical forces distribute inside the triangle mesh when constraint parameters don't match?</p>
|
| 45 |
+
|
| 46 |
+
<select id="distSplit" onchange="sendConfig()" class="text-[13px] py-1.5 mb-3 cursor-pointer text-white">
|
| 47 |
+
<option value="uniform">DUMB GEOMETRY (50/50 Equal Split Shock)</option>
|
| 48 |
+
<option value="individual">LEARNED BEHAVIOR (Split uses Elastic 'K' modifiers)</option>
|
| 49 |
</select>
|
| 50 |
+
|
| 51 |
+
<label class="flex items-start text-xs text-slate-300 bg-slate-800/40 p-2 border border-slate-700/50 rounded cursor-pointer">
|
| 52 |
+
<input type="checkbox" id="asymmetric" onchange="sendConfig()" class="w-4 h-4 mr-2 mt-0.5 cursor-pointer accent-orange-500">
|
| 53 |
+
<span class="leading-snug block"><b>Apply Non-Reciprocal Tension Damper?</b> <br>
|
| 54 |
+
<span class="text-[10px] text-slate-400 font-serif">(Test: Check this if the node forces are resonating, vibrating forever, or values mathematically explode during calculations.)</span></span>
|
| 55 |
</label>
|
| 56 |
</div>
|
| 57 |
|
| 58 |
+
<!-- SECTION 3: LOGICAL CONSTRAINT -->
|
| 59 |
+
<div class="p-4 border border-slate-700 bg-black/60 rounded-md">
|
| 60 |
+
<h3 class="font-bold text-green-400 text-[13px] mb-1 tracking-widest border-b border-slate-800 pb-1">3. MANAUL CONSTRAINT GOAL</h3>
|
| 61 |
+
<p class="text-[10.5px] text-slate-400 mb-3 leading-tight font-serif italic">What arithmetic "rule" dictates the resting equilibrium point between nodes A, B, and clamped objective C?</p>
|
| 62 |
+
|
| 63 |
+
<select id="probType" onchange="sendConfig()" class="text-[13px] py-1.5 mb-3 cursor-pointer text-white">
|
| 64 |
+
<option value="add">TEST RULE: Alignments (Node A + Node B = Node C)</option>
|
| 65 |
+
<option value="mult">TEST RULE: Multiplication (Node A * Node B = Node C)</option>
|
| 66 |
</select>
|
| 67 |
+
|
| 68 |
+
<div class="flex items-center gap-2 mt-4 bg-slate-800/50 p-2 rounded">
|
| 69 |
+
<div class="flex flex-col">
|
| 70 |
+
<span class="font-bold text-[10px] text-green-400">Lock Target Constraint C To:</span>
|
| 71 |
+
<input type="number" id="singleVal" value="45" class="text-center font-mono w-24">
|
| 72 |
+
</div>
|
| 73 |
+
<button onclick="triggerSingle()" class="flex-grow bg-blue-600 hover:bg-blue-500 rounded text-white font-bold h-11 text-xs transition duration-200 uppercase tracking-widest">Single Test Run</button>
|
| 74 |
</div>
|
| 75 |
</div>
|
| 76 |
|
| 77 |
+
<!-- SECTION 4: DATASET EVALUATION -->
|
| 78 |
+
<div class="p-4 border border-purple-800 bg-purple-900/10 rounded-md">
|
| 79 |
+
<h3 class="font-bold text-purple-400 text-[13px] mb-1 tracking-widest border-b border-purple-800/50 pb-1">4. AUTOMATED DATASET PIPELINE</h3>
|
| 80 |
+
<p class="text-[10.5px] text-purple-300/60 mb-3 leading-tight font-serif italic">Continuously feed a batch of changing objective "C" variables. Tests the network's capacity to adjust continuously.</p>
|
| 81 |
+
|
| 82 |
+
<div class="grid grid-cols-2 gap-2 text-xs font-mono mb-4 bg-black/50 p-3 rounded">
|
| 83 |
+
<div> <span class="block text-slate-500">Problem Ct:</span> <input type="number" id="b_count" value="15" class="text-white text-center mt-1"> </div>
|
| 84 |
+
<div> <span class="block text-slate-500">-</span> </div>
|
| 85 |
+
<div> <span class="block text-slate-500">Target MIN:</span> <input type="number" id="b_min" value="10" class="text-white text-center mt-1"> </div>
|
| 86 |
+
<div> <span class="block text-slate-500">Target MAX:</span> <input type="number" id="b_max" value="100" class="text-white text-center mt-1"> </div>
|
|
|
|
| 87 |
</div>
|
| 88 |
+
<button onclick="triggerBatch()" class="w-full py-2.5 bg-purple-600 hover:bg-purple-500 text-white font-bold rounded shadow transition tracking-widest text-[12px] uppercase">Initialize Continuous Pipeline</button>
|
| 89 |
</div>
|
| 90 |
+
|
| 91 |
+
<button onclick="triggerHalt()" class="w-full py-2 border-2 border-red-900 text-red-500 hover:bg-red-900 hover:text-white text-[13px] font-black uppercase tracking-widest transition">⛔ Halt Server & Clear Queues</button>
|
| 92 |
|
|
|
|
| 93 |
</div>
|
| 94 |
</aside>
|
| 95 |
|
| 96 |
<main class="flex-grow flex flex-col h-screen">
|
| 97 |
+
<div class="h-[65%] w-full relative border-b border-slate-700 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-slate-900 to-black" id="plot"></div>
|
| 98 |
+
<div class="h-[35%] flex shadow-[0_-5px_20px_rgba(0,0,0,0.5)]">
|
| 99 |
+
|
| 100 |
+
<!-- LIVE TELEMETRY: Math -->
|
| 101 |
+
<div class="w-[50%] bg-slate-950/80 border-r border-slate-700 p-4 font-mono overflow-y-auto flex flex-col gap-1 text-[11px] backdrop-blur relative">
|
| 102 |
+
<span id="tracker" class="space-y-[3px] text-slate-300 whitespace-pre">Connecting telemetry port to mathematical core...</span>
|
| 103 |
</div>
|
| 104 |
+
<!-- EVENT QUEUE: Messaging loop tracker -->
|
| 105 |
<div class="w-[50%] bg-black p-4 font-mono overflow-y-auto flex flex-col gap-1 text-[10px] tracking-wide text-green-500 relative">
|
| 106 |
+
<div class="absolute inset-0 bg-[linear-gradient(rgba(0,0,0,1)_5%,rgba(0,0,0,0))] pointer-events-none border-t border-b h-[20px] shadow z-10"></div>
|
| 107 |
+
<div class="font-bold text-[9px] uppercase tracking-widest border-b border-green-900/50 pb-1 mb-1 opacity-70">Push/Pull Server Action Queue</div>
|
| 108 |
+
<div id="logger">No pipeline initialized...</div>
|
| 109 |
</div>
|
| 110 |
</div>
|
| 111 |
</main>
|
| 112 |
|
| 113 |
<script>
|
| 114 |
+
const endpoint = ''; // Set relative for HF
|
| 115 |
|
| 116 |
async function sendConfig() {
|
| 117 |
await fetch('/apply_config', {
|
|
|
|
| 126 |
}
|
| 127 |
|
| 128 |
async function triggerSingle() {
|
| 129 |
+
await sendConfig();
|
| 130 |
await fetch('/single_run', {
|
| 131 |
method: 'POST', headers: {'Content-Type':'application/json'},
|
| 132 |
body: JSON.stringify({ target: document.getElementById('singleVal').value })
|
|
|
|
| 134 |
}
|
| 135 |
|
| 136 |
async function triggerBatch() {
|
| 137 |
+
await sendConfig();
|
| 138 |
await fetch('/batch_run', {
|
| 139 |
method: 'POST', headers: {'Content-Type':'application/json'},
|
| 140 |
body: JSON.stringify({
|
|
|
|
| 147 |
|
| 148 |
async function triggerHalt() { await fetch('/halt', { method: 'POST'}); }
|
| 149 |
|
| 150 |
+
// DRAW LOOP ============================
|
| 151 |
setInterval(async () => {
|
| 152 |
try {
|
| 153 |
let res = await fetch('/state');
|
|
|
|
| 155 |
|
| 156 |
let isTraining = document.getElementById('engineMode').value === "training";
|
| 157 |
|
| 158 |
+
// Visual Traces Map Arrays
|
| 159 |
+
let px=[], py=[], pz=[], hoverData=[];
|
| 160 |
+
|
| 161 |
+
// Print System Status Top Header
|
| 162 |
+
let systemLogHeader = `<b class='text-blue-400 tracking-[0.2em] font-sans block border-b border-slate-700 pb-2 mb-2'>T-EPOCH: [ <span class='text-white'>${d.iteration}</span> ] // DATASETS QUEUE:[ <span class='text-white'>${d.batch_size}</span> ] // FAST-EVENTS:[ <span class='text-purple-400'>${d.buffer_size}</span> ]</b>`;
|
| 163 |
|
| 164 |
+
// Construct the Math Coordinate text UI log below it
|
| 165 |
Object.keys(d.nodes).forEach(id => {
|
| 166 |
let v = d.nodes[id];
|
| 167 |
px.push(v.x); py.push(v.y); pz.push(v.z);
|
| 168 |
+
let stateLockTxt = v.anchored ? '[🔒 ANCHOR_POINT]' : '[🌊 FLOWING]';
|
| 169 |
+
|
| 170 |
+
// Graph tooltip content
|
| 171 |
+
hoverData.push(`VERTEX ${id}<br>Solution Coord: ${v.x.toFixed(3)}<br>Phys Memory (K): ${v.k.toFixed(4)}`);
|
| 172 |
+
|
| 173 |
+
// Lower Left Window output formatting
|
| 174 |
+
let nodeColor = v.anchored ? 'text-red-300' : 'text-sky-300';
|
| 175 |
+
systemLogHeader += `
|
| 176 |
+
<div class="py-1">
|
| 177 |
+
<span class="${nodeColor}">◆ [ VERTEX ${id} ]</span> <span class="text-slate-500 font-bold ml-1">${stateLockTxt}</span><br>
|
| 178 |
+
├─ Structural Answer (Dim X) <span class='text-white bg-slate-800 rounded px-1.5 ml-2 font-black shadow shadow-black'>${v.x.toFixed(6)}</span><br>
|
| 179 |
+
└─ Latent Cell Mod (Stiff-K) <span class='text-purple-300 ml-2 font-mono'>${v.k.toFixed(6)}</span>
|
| 180 |
+
</div>
|
| 181 |
+
`;
|
| 182 |
});
|
| 183 |
|
| 184 |
+
document.getElementById('tracker').innerHTML = systemLogHeader;
|
| 185 |
+
|
| 186 |
+
// Pushing strings sequentially as pipeline lines
|
| 187 |
+
document.getElementById('logger').innerHTML = d.logs.map(lg => `<span class='opacity-80 block hover:bg-slate-800 border-b border-green-900/20 cursor-default'>▰ ${lg}</span>`).join('');
|
| 188 |
|
| 189 |
+
// Draw Network Lines visually via Plotly
|
| 190 |
+
let DrawShapeParams = {
|
| 191 |
+
type: 'scatter3d', mode: 'lines+markers+text',
|
| 192 |
x: px.concat([px[0]]), y: py.concat([py[0]]), z: pz.concat([pz[0]]),
|
| 193 |
text: Object.keys(d.nodes).concat(['']),
|
| 194 |
+
textfont:{color:'rgba(255,255,255,0.7)',size:12, family:'system-ui, monospace'},
|
| 195 |
+
textposition: 'top left',
|
| 196 |
+
hoverinfo: 'text', hovertext: hoverData.concat(['']),
|
| 197 |
+
line: {color: isTraining ? 'rgba(239, 68, 68, 0.6)':'rgba(56, 189, 248, 0.6)', width: 5},
|
| 198 |
+
marker: {size: 14, line:{width:2, color:'#1e293b'}, color:['#fb923c','#c084fc','#38bdf8']}
|
| 199 |
};
|
| 200 |
|
| 201 |
+
let SceneLayout = {
|
| 202 |
+
margin: { l: 0, r: 0, b: 0, t: 15}, paper_bgcolor: 'transparent',
|
| 203 |
scene: {
|
| 204 |
+
camera: { eye: {x:0, y:-1.5, z:1.3} },
|
| 205 |
+
xaxis: {title:'Constraint Values (Latent Logic X Axis)', color:'white', gridcolor:'#1e293b'},
|
| 206 |
+
yaxis: {title:'System Shift Y', color:'#475569', gridcolor:'#1e293b', zerolinecolor:'#475569'},
|
| 207 |
+
zaxis: {title:'System Shift Z', color:'#475569', gridcolor:'#1e293b', zerolinecolor:'#475569'}
|
| 208 |
}
|
| 209 |
};
|
| 210 |
|
| 211 |
+
if(!window.plotlyRun){ Plotly.newPlot('plot',[DrawShapeParams], SceneLayout, {responsive:true}); window.plotlyRun = true; }
|
| 212 |
+
else { Plotly.react('plot', [DrawShapeParams], SceneLayout); }
|
| 213 |
|
| 214 |
} catch(e) {}
|
| 215 |
+
}, 110);
|
| 216 |
</script>
|
| 217 |
</body>
|
| 218 |
</html>
|