everydaytok commited on
Commit
fe9c5f9
·
verified ·
1 Parent(s): 7c05a72

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +85 -153
index.html CHANGED
@@ -2,125 +2,87 @@
2
  <html lang="en">
3
  <head>
4
  <meta charset="UTF-8">
5
- <title>Mesh Reasoner Engine Dashboard</title>
6
  <script src="https://cdn.tailwindcss.com"></script>
7
  <script src="https://cdn.plot.ly/plotly-2.24.1.min.js"></script>
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', {
118
  method: 'POST', headers: {'Content-Type': 'application/json'},
119
  body: JSON.stringify({
120
- mode: document.getElementById('engineMode').value,
121
- distribution: document.getElementById('distSplit').value,
122
  problem_type: document.getElementById('probType').value,
123
- asymmetric: document.getElementById('asymmetric').checked
124
  })
125
  });
126
  }
@@ -134,85 +96,55 @@
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({
141
  batch_size: document.getElementById('b_count').value,
142
- val_min: document.getElementById('b_min').value,
143
- val_max: document.getElementById('b_max').value
144
  })
145
  });
146
  }
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');
154
- let d = await res.json();
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>
 
2
  <html lang="en">
3
  <head>
4
  <meta charset="UTF-8">
5
+ <title>Mesh Reasoner Lab</title>
6
  <script src="https://cdn.tailwindcss.com"></script>
7
  <script src="https://cdn.plot.ly/plotly-2.24.1.min.js"></script>
8
  <style>
9
+ body { background: #06090e; color: #cbd5e1; font-family: monospace; }
10
+ .glass { background: rgba(15,23,42,0.9); border: 1px solid #334155; }
11
+ .force-pos { color: #4ade80; }
12
+ .force-neg { color: #f87171; }
 
 
13
  </style>
14
  </head>
15
+ <body class="flex h-screen overflow-hidden">
16
 
17
+ <aside class="w-96 glass p-4 flex flex-col gap-4 overflow-y-auto">
18
+ <h1 class="text-blue-400 font-bold border-b border-slate-700 pb-2">TOPOLOGICAL DIALS</h1>
19
+
20
+ <div class="space-y-4 text-xs">
21
+ <section>
22
+ <label class="text-slate-500">PHASE</label>
23
+ <select id="mode" onchange="sendConfig()" class="w-full bg-slate-900 border border-slate-700 p-1">
24
+ <option value="inference">INFERENCE (Solving)</option>
25
+ <option value="training">TRAINING (Learning K)</option>
 
 
 
 
 
 
26
  </select>
27
+ </section>
 
 
 
 
28
 
29
+ <section>
30
+ <label class="text-slate-500">CONSTRAINT LOGIC</label>
31
+ <select id="probType" onchange="sendConfig()" class="w-full bg-slate-900 border border-slate-700 p-1">
32
+ <option value="add">A + B = C</option>
33
+ <option value="mult">A * B = C</option>
 
 
 
34
  </select>
35
+ </section>
36
 
37
+ <section class="border-t border-slate-800 pt-2">
38
+ <label class="text-green-400">TARGET C:</label>
39
+ <input type="number" id="singleVal" value="45" class="w-full bg-black border border-slate-700 p-1 text-center">
40
+ <button onclick="triggerSingle()" class="w-full bg-blue-700 mt-2 py-1 font-bold">ENGAGE SINGLE RUN</button>
41
+ </section>
 
42
 
43
+ <section class="bg-slate-900 p-2 rounded">
44
+ <label class="text-purple-400">BATCH TEST SETS:</label>
45
+ <input type="number" id="b_count" value="10" class="w-full bg-black border border-slate-700 p-1 mb-1">
46
+ <button onclick="triggerBatch()" class="w-full bg-purple-700 py-1 font-bold">START BATCH RUN</button>
47
+ </section>
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
+ <button onclick="triggerHalt()" class="w-full border border-red-500 text-red-500 py-1 hover:bg-red-900">RESET ENGINE</button>
50
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
+ <div class="mt-auto border-t border-slate-800 pt-4">
53
+ <h3 class="text-xs text-orange-400">LIVE SYSTEM ERROR</h3>
54
+ <div id="error-meter" class="text-2xl font-bold">0.000</div>
55
+ <div class="w-full bg-slate-800 h-2 mt-1 rounded-full overflow-hidden">
56
+ <div id="error-bar" class="bg-red-500 h-full transition-all" style="width: 0%"></div>
57
+ </div>
58
  </div>
59
  </aside>
60
 
61
+ <main class="flex-grow flex flex-col">
62
+ <div id="plot" class="flex-grow"></div>
63
+ <div class="h-64 border-t border-slate-700 flex bg-black/50">
64
+ <!-- Force Meters -->
65
+ <div id="force-tracker" class="w-1/2 p-4 border-r border-slate-800 text-[11px] overflow-y-auto">
66
+ <h4 class="text-blue-300 mb-2 underline">NODE FORCE VECTORS</h4>
67
+ <div id="node-details">Waiting...</div>
68
  </div>
69
+ <!-- Event Log -->
70
+ <div id="logger" class="w-1/2 p-4 text-[10px] text-slate-500 overflow-y-auto">
71
+ <h4 class="text-slate-400 mb-2">EVENT LOG</h4>
72
+ <div id="log-content">...</div>
 
73
  </div>
74
  </div>
75
  </main>
76
 
77
  <script>
 
 
78
  async function sendConfig() {
79
  await fetch('/apply_config', {
80
  method: 'POST', headers: {'Content-Type': 'application/json'},
81
  body: JSON.stringify({
82
+ mode: document.getElementById('mode').value,
83
+ distribution: 'individual',
84
  problem_type: document.getElementById('probType').value,
85
+ asymmetric: false
86
  })
87
  });
88
  }
 
96
  }
97
 
98
  async function triggerBatch() {
 
99
  await fetch('/batch_run', {
100
  method: 'POST', headers: {'Content-Type':'application/json'},
101
  body: JSON.stringify({
102
  batch_size: document.getElementById('b_count').value,
103
+ val_min: 10, val_max: 100
 
104
  })
105
  });
106
  }
 
 
107
 
108
+ async function triggerHalt() { await fetch('/halt', {method: 'POST'}); }
109
+
110
  setInterval(async () => {
111
  try {
112
+ const r = await fetch('/state');
113
+ const d = await r.json();
114
+
115
+ // 1. Update Error UI
116
+ const err = Math.abs(d.error);
117
+ document.getElementById('error-meter').innerText = d.error.toFixed(4);
118
+ document.getElementById('error-bar').style.width = Math.min(100, err * 2) + "%";
119
+ document.getElementById('error-meter').className = err < 0.1 ? "text-green-400 text-2xl font-bold" : "text-red-400 text-2xl font-bold";
120
+
121
+ // 2. Update Force UI
122
+ let forceHTML = "";
123
+ let px=[], py=[], pz=[], ids=[];
124
  Object.keys(d.nodes).forEach(id => {
125
+ const n = d.nodes[id];
126
+ const fClass = n.force > 0 ? "force-pos" : "force-neg";
127
+ forceHTML += `<div>NODE ${id}: X=[${n.x.toFixed(2)}] | <span class="${fClass}">FORCE: ${n.force.toFixed(4)}</span> | K: ${n.k.toFixed(3)}</div>`;
128
+ px.push(n.x); py.push(n.y); pz.push(n.z); ids.push(id);
 
 
 
 
 
 
 
 
 
 
 
 
129
  });
130
+ document.getElementById('node-details').innerHTML = forceHTML;
131
+ document.getElementById('log-content').innerHTML = d.logs.map(l => `<div>${l}</div>`).join('');
132
+
133
+ // 3. Update Plot
134
+ const trace = {
 
 
 
135
  type: 'scatter3d', mode: 'lines+markers+text',
136
  x: px.concat([px[0]]), y: py.concat([py[0]]), z: pz.concat([pz[0]]),
137
+ text: ids.concat(['']), marker: {size: 10, color: ['#fb923c','#c084fc','#38bdf8']}
 
 
 
 
 
138
  };
139
+ const layout = {
140
+ margin: {l:0,r:0,t:0,b:0}, paper_bgcolor: 'transparent',
141
+ scene: { xaxis: {range: [-10, 110]}, yaxis: {range: [-5, 5]}, zaxis: {range: [-5, 5]} }
 
 
 
 
 
 
142
  };
143
+ if(!window.plotted){ Plotly.newPlot('plot', [trace], layout); window.plotted=true; }
144
+ else { Plotly.react('plot', [trace], layout); }
145
 
 
 
 
146
  } catch(e) {}
147
+ }, 150);
148
  </script>
149
  </body>
150
  </html>