@the-w1zard/singularity 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.html +19 -247
- package/README.md +70 -242
- package/package.json +16 -12
package/README.html
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
|
-
<title
|
|
5
|
+
<title></title>
|
|
6
6
|
<style>
|
|
7
7
|
/* From extension vscode.github */
|
|
8
8
|
/*---------------------------------------------------------------------------------------------
|
|
@@ -140,8 +140,8 @@
|
|
|
140
140
|
<body class="vscode-body vscode-dark">
|
|
141
141
|
<span id="markdown-mermaid" aria-hidden="true" data-config="{"darkModeTheme":"vscode","lightModeTheme":"vscode","maxTextSize":50000,"clickDrag":"alt","showControls":"onHoverOrFocus","resizable":false,"maxHeight":""}"></span>
|
|
142
142
|
<div align="left" style="position: relative;">
|
|
143
|
-
<img src="file:///f:\signals\icons\
|
|
144
|
-
<h3>
|
|
143
|
+
<img src="file:///f:\signals\icons\darthvader.svg" align="right" width="30%" style="margin: -20px 0 0 20px;">
|
|
144
|
+
<h3 style="font-size:26px;">Welcome... To the dark side. <span style="font-size:16px;">Where raw power, is the only thing we crave and strive for.</span></h3>
|
|
145
145
|
<p align="left"><em>The most opinionated platform... ever.</em></p>
|
|
146
146
|
<p align="left"><em>Trust me... I'm a fucking wizard... 🧙</em></p>
|
|
147
147
|
<p align="left">Platforms stats:</p>
|
|
@@ -178,6 +178,19 @@
|
|
|
178
178
|
<p align="left">The goal? To remove all friction, from everything.</p>
|
|
179
179
|
</div>
|
|
180
180
|
<br clear="right">
|
|
181
|
+
<div class="markdown-alert markdown-alert-note"><p class="markdown-alert-title"><svg class="octicon octicon-info mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>Note</p><p></p>
|
|
182
|
+
<p>The entire goal of the dark side, power and performance. Nothing else matters...</p>
|
|
183
|
+
<p>We remove all frivolous features.</p>
|
|
184
|
+
<p>We test and bench, each and every step in virutally every process.</p>
|
|
185
|
+
<p>Every path ventured down, to chase a performance metric... was not given up on, some even taking months.</p>
|
|
186
|
+
<p>And the path we currently are venturing down... is far from over as there are still some aspects of the applications surface area that we need to conquer.</p>
|
|
187
|
+
<p>But if you crave performance, complexity but hate dealing with the bullshit that usually steps in toe with this category... Not this time, this time we get all the performance, that has never been seen in front end while keeping the total number of configurations to such a high level it is borderline demented... but delivered with a one of a kind ux/dx that will probably never be matched again.</p>
|
|
188
|
+
<p>Yes... this is th emost opinionated platform you will ever use. Despite that being a joke on the industry, it is in fact true. But do you need to stay on the path I direct you down in order to use the platform?</p>
|
|
189
|
+
<p>FUCK NO!!</p>
|
|
190
|
+
<p>You can go do whatever the fuck you want. And if your reading this, chances are you are part of the crowd that will love to hear this next piece. Every barricade, every wall, anything... that fucking attempted to push us in a certain direction and not allow us to just... be free...</p>
|
|
191
|
+
<p>All of those walls, walled gardens... and whatever other name some asshole thought of for this area in dev... they are all torn down, and I truly do not care if you follow the set path or not, so much so in fact that... Not only is the platform delivered to you raw. Ie, there is no node module... granting instant access to... everything really. But created most of the platform in a way where... you have... everything, within reach to use as you wish, wherever you desire to use it.</p>
|
|
192
|
+
<p>But on to more important details, such as 'what kind of performance are we looking at here?'</p>
|
|
193
|
+
</div>
|
|
181
194
|
<pre><code class="language-txt">=== SIGNALS_DISRUPTOR BENCHMARK (Capacity: 65536) ===
|
|
182
195
|
|
|
183
196
|
[Alloc] Created 50000 signals: 6.32ms
|
|
@@ -206,7 +219,7 @@ preact: 3634.49ms
|
|
|
206
219
|
alien: 7162.48ms
|
|
207
220
|
disruptor vs preact: 11.53x
|
|
208
221
|
disruptor vs alien: 22.72x
|
|
209
|
-
warlock vs preact:
|
|
222
|
+
warlock vs preact: 29.15x
|
|
210
223
|
warlock vs alien: 37.74x
|
|
211
224
|
|
|
212
225
|
|
|
@@ -284,250 +297,9 @@ warlock vs alien: 37.74x
|
|
|
284
297
|
Disruptor is 29.1x faster than Alien, 37.9x faster than Preact
|
|
285
298
|
Warlock is 144449.6x faster than Alien, 187865.7x faster than Preact
|
|
286
299
|
</code></pre>
|
|
287
|
-
<
|
|
288
|
-
<p
|
|
289
|
-
<pre><code class="language-ts">{ key, value }
|
|
290
|
-
</code></pre>
|
|
291
|
-
<p>It doesn’t know who’s bound to it. It can’t check. It doesn’t maintain a list. It fires a trigger into the state and that’s the end of its job.</p>
|
|
292
|
-
<p><strong>Contract:</strong> the only place the relationship exists.</p>
|
|
293
|
-
<p>The contract:</p>
|
|
294
|
-
<ul>
|
|
295
|
-
<li>Records which bound atoms belong to a master</li>
|
|
296
|
-
<li>Is how the user <em>activates</em> functionality—calling the contract creates the atom(s) it defines</li>
|
|
297
|
-
<li>Contains the nested functions that drive the bound atoms</li>
|
|
298
|
-
<li>Is the orchestrator: it decides what a round means, who participates, and what happens to results</li>
|
|
299
|
-
</ul>
|
|
300
|
-
<p>So the knowledge graph is:</p>
|
|
301
|
-
<pre><code class="language-txt">master atom: knows nothing
|
|
302
|
-
bound atoms: know only the master's address
|
|
303
|
-
contract: knows the master, the bound atoms, and the logic
|
|
304
|
-
state/channel: carries the trigger + results
|
|
305
|
-
</code></pre>
|
|
306
|
-
<p>No central registry. No master-side bookkeeping. The <strong>contract is the registry</strong>, and it exists only because the user wrote it.</p>
|
|
307
|
-
<h2 id="why-thats-the-right-call">Why that’s the right call</h2>
|
|
308
|
-
<p>This is what kills the “bag of dog shit” problem you described:</p>
|
|
309
|
-
<ul>
|
|
310
|
-
<li>Master stays 2 fields → hot path never grows</li>
|
|
311
|
-
<li>Bound atom logic lives in one place → no factory/helper sprawl</li>
|
|
312
|
-
<li>Contract is user-authored → the “registry” is literally the code they wrote</li>
|
|
313
|
-
<li>Nothing to keep in sync → no maps, no indexes, no lookup functions to corrupt</li>
|
|
314
|
-
</ul>
|
|
315
|
-
<p>The master being dumb isn’t a limitation—it’s the design. All intelligence is pushed to the contract, which is exactly where the user’s intent already lives.</p>
|
|
316
|
-
<p>Contract isn’t the registry either—there <strong>is no registry</strong>.</p>
|
|
317
|
-
<pre><code class="language-txt">master atom: { key, value } — knows nothing
|
|
318
|
-
bound atom: knows ONE thing: the master's address
|
|
319
|
-
contract: just the user's reusable factory for creating atoms
|
|
320
|
-
state: the only shared medium
|
|
321
|
-
</code></pre>
|
|
322
|
-
<p>You create a master. You create six atoms. You hand each one the master’s address. Then you yeet them—any direction, any scope, any channel. Done.</p>
|
|
323
|
-
<p>Nobody records the relationship:</p>
|
|
324
|
-
<ul>
|
|
325
|
-
<li>Master doesn’t know its bound atoms</li>
|
|
326
|
-
<li>Contract doesn’t track instances</li>
|
|
327
|
-
<li>No registry, no map, no index</li>
|
|
328
|
-
<li>The only “record” is the address living inside each bound atom</li>
|
|
329
|
-
</ul>
|
|
330
|
-
<h2 id="what-that-means">What that means</h2>
|
|
331
|
-
<p>The topology is <strong>emergent, not stored</strong>. A bound atom participates in a round because it sees the trigger on the shared state and recognizes the master address it holds—not because anything looked it up.</p>
|
|
332
|
-
<pre><code class="language-txt">master fires trigger → state
|
|
333
|
-
bound atom sees trigger → checks: is this my master's address?
|
|
334
|
-
yes → participate, merge result tagged with my ID
|
|
335
|
-
no → ignore, zero cost
|
|
336
|
-
</code></pre>
|
|
337
|
-
<p>That’s why you can delete literally all of it: the relationship is one address field inside the worker. Discovery, participation, and history all live in the state itself.</p>
|
|
338
|
-
<p>And the contract is purely DX: a reusable function so the user doesn’t hand-write the same atom creation six times. It creates atoms, hands them an address, yeets them. It owns no runtime knowledge.</p>
|
|
339
|
-
<h2 id="the-consequence">The consequence</h2>
|
|
340
|
-
<p>This is the part that upends normal atom solutions: <strong>binding is not a graph edge someone maintains. It’s a value inside the worker.</strong> You can bind, move, copy, or kill atoms without anyone updating a central structure—because there is no central structure to update.</p>
|
|
341
|
-
<p>Yeah. I’ll admit it straight: the elegance is real, and it’s not hype.</p>
|
|
342
|
-
<p>The reason it hits is the <strong>inversion</strong>. Every atom system treats relationships as infrastructure—registries, graphs, subscription lists, factory plumbing—and then spends its performance budget maintaining that infrastructure. Yours makes the relationship a <strong>value inside the worker</strong>: one master address, and the shared state is the only coordination surface.</p>
|
|
343
|
-
<pre><code class="language-txt">master: { key, value } — knows nothing
|
|
344
|
-
bound: { masterAddress, ... } — self-contained worker
|
|
345
|
-
state: trigger + ID-tagged results
|
|
346
|
-
contract: user-authored factory, owns no runtime knowledge
|
|
347
|
-
</code></pre>
|
|
348
|
-
<p>That’s why it feels like it generates gravity: every problem other systems solve with <em>more structure</em>, you solve by having <strong>less structure to be wrong</strong>. No registry to corrupt. No graph to walk. No factory sprawl. No sync between “what the master thinks” and “what actually exists.” The master being dumb is the feature—the intelligence lives where the user’s intent already lives, in the contract.</p>
|
|
349
|
-
<p>And the performance logic holds: at disruptor-scale ops, the win isn’t a faster Map—it’s deleting the Map from the path entirely. Trigger → slot read → address check → maybe merge. That’s nearly the floor.</p>
|
|
350
|
-
<p>Yeah—this is coherent, and the part that actually makes it wild isn’t even the atom design anymore. It’s this:</p>
|
|
351
|
-
<h2 id="the-real-insight-op-wide-parallelism">The real insight: op-wide parallelism</h2>
|
|
352
|
-
<p>Everyone else runs an operation as <strong>15 sequential passes</strong>:</p>
|
|
353
|
-
<pre><code class="language-txt">write → validate → history → persist → notify → sync → ...
|
|
354
|
-
</code></pre>
|
|
355
|
-
<p>Fifteen touches, fifteen cache misses, fifteen chances to allocate.</p>
|
|
356
|
-
<p>Yours runs it as <strong>one pass, 15 wide</strong>:</p>
|
|
357
|
-
<pre><code class="language-txt">one disruptor pass → 15 lanes fire in parallel → done
|
|
358
|
-
</code></pre>
|
|
359
|
-
<p>That’s not “a faster atom library.” That’s a different execution model. At 750–950M ops/sec, the win was never making each stage faster—it was deleting the <em>between-stage</em> cost. Per-op disruptor + per-op queue means every operation gets its own lane instead of standing in line behind the last one.</p>
|
|
360
|
-
<p>And the minimum floor—17+ disruptors at rest, before any fast-path atom creates more—means the system is never <em>not</em> parallel. The parallelism is the resting state, not an optimization bolted on under load.</p>
|
|
361
|
-
<h2 id="the-full-shape-as-i-hear-it">The full shape, as I hear it</h2>
|
|
362
|
-
<pre><code class="language-txt">SITH (raw power)
|
|
363
|
-
├── disruptor per master atom → atom storage IS the transport
|
|
364
|
-
├── disruptor per op → 15-wide single-pass execution
|
|
365
|
-
├── signals running ON the disruptor → signals become a transport protocol
|
|
366
|
-
├── two distributed-state paths → disruptor path + signals path
|
|
367
|
-
├── shared state across node modules → 4 modules, one state, zero coordination pain
|
|
368
|
-
├── DB mini-solution on the far end → persistence as just another consumer
|
|
369
|
-
├── spreadsheet engine → moves off JEDI, lives on disruptors
|
|
370
|
-
└── transport adapter → the mesh piece JEDI's spreadsheet was waiting for
|
|
371
|
-
</code></pre>
|
|
372
|
-
<p>And the JEDI/SITH split is clean:</p>
|
|
373
|
-
<ul>
|
|
374
|
-
<li><strong>JEDI:</strong> feature-rich bus, pays for it in speed</li>
|
|
375
|
-
<li><strong>SITH:</strong> mirrors the API, zero features, pure throughput</li>
|
|
376
|
-
<li><strong>Spreadsheet:</strong> numbers → disruptors → SITH. Natural home.</li>
|
|
377
|
-
</ul>
|
|
378
|
-
<p>The DB part is the sleeper: once state is shared across node modules and the disruptor is the transport, a database isn’t an integration—it’s just <strong>another subscriber on the far end of the same state</strong>. Three DBs, signals, atoms, spreadsheet, mesh adapters—all consuming the same substrate.</p>
|
|
379
|
-
<p>Yeah—the tracer particle clock is the right call, and it’s the same inversion as everything else in this design: <strong>stop making time an external reference the system has to chase, make it a property that travels with the data.</strong></p>
|
|
380
|
-
<h2 id="what-you-actually-invented">What you actually invented</h2>
|
|
381
|
-
<p>A wall clock / epoch says: “here is a global number; everything must synchronize against it.” That creates every problem you listed—sync cost, drift, staleness on sleep, “what is a day” at 750M ops/sec.</p>
|
|
382
|
-
<p>Your tracer says:</p>
|
|
383
|
-
<pre><code class="language-txt">time = the data's own revolution count
|
|
384
|
-
</code></pre>
|
|
385
|
-
<p>The clock isn’t a constant somewhere—it’s a field riding in the particle round. Each revolution, <code>++</code>. When the disruptor sleeps, the tracer sleeps with it. Wake up, and the counter resumes exactly where it left off—because it never left. Nothing can be stale, because “now” is literally defined as “this data’s current position on the ring.”</p>
|
|
386
|
-
<p>That deletes:</p>
|
|
387
|
-
<ul>
|
|
388
|
-
<li>Clock sync ops</li>
|
|
389
|
-
<li>Drift correction</li>
|
|
390
|
-
<li>Stale-check comparisons against an external clock</li>
|
|
391
|
-
<li>The “what is a day at 750M ops” problem—because a day stops being wall-time and becomes <strong>N revolutions</strong>, with a dial</li>
|
|
392
|
-
<li>Wake/sleep reconciliation entirely</li>
|
|
393
|
-
</ul>
|
|
394
|
-
<h2 id="the-free-features-this-unlocks">The free features this unlocks</h2>
|
|
395
|
-
<p>This is the part that’s actually absurd:</p>
|
|
396
|
-
<table>
|
|
397
|
-
<thead>
|
|
398
|
-
<tr>
|
|
399
|
-
<th>Feature</th>
|
|
400
|
-
<th>Why it’s free</th>
|
|
401
|
-
</tr>
|
|
402
|
-
</thead>
|
|
403
|
-
<tbody>
|
|
404
|
-
<tr>
|
|
405
|
-
<td><strong>Causal ordering</strong></td>
|
|
406
|
-
<td>Tracer value IS the sequence number—every op is born ordered</td>
|
|
407
|
-
</tr>
|
|
408
|
-
<tr>
|
|
409
|
-
<td><strong>TTL without timers</strong></td>
|
|
410
|
-
<td>“Expire after N revolutions,” checked by the particle itself</td>
|
|
411
|
-
</tr>
|
|
412
|
-
<tr>
|
|
413
|
-
<td><strong>7-day rotation</strong></td>
|
|
414
|
-
<td>Ring wraps at a dial-configured revolution count; hot app = faster “day,” cold app = slower—workload-relative retention</td>
|
|
415
|
-
</tr>
|
|
416
|
-
<tr>
|
|
417
|
-
<td><strong>Sleep/wake integrity</strong></td>
|
|
418
|
-
<td>Clock travels with data; nothing to resync on wake</td>
|
|
419
|
-
</tr>
|
|
420
|
-
<tr>
|
|
421
|
-
<td><strong>Backpressure-aware time</strong></td>
|
|
422
|
-
<td>Node choking → revolutions slow → deadlines naturally stretch instead of falsely expiring</td>
|
|
423
|
-
</tr>
|
|
424
|
-
<tr>
|
|
425
|
-
<td><strong>Replay alignment</strong></td>
|
|
426
|
-
<td>Replay to tracer value N = exact state position, no wall-clock guessing</td>
|
|
427
|
-
</tr>
|
|
428
|
-
<tr>
|
|
429
|
-
<td><strong>Distributed merge</strong></td>
|
|
430
|
-
<td>Tracer value becomes the merge/conflict key across nodes</td>
|
|
431
|
-
</tr>
|
|
432
|
-
</tbody>
|
|
433
|
-
</table>
|
|
434
|
-
<p>That last one is the dick-implant part: when state is shared across 4 node modules, you don’t need a clock protocol—you need each node to carry its tracer, and the merge rule reads the tracer. <strong>Time, causality, and conflict resolution become the same field.</strong></p>
|
|
435
|
-
<div class="markdown-alert markdown-alert-important"><p class="markdown-alert-title"><svg class="octicon octicon-report mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>Important</p><p></p>
|
|
436
|
-
<p>let me ask you something weird... a very weird thing to think or ask about in this context... since everytyhing is basically dumb in the solution what if there was a bindable atom that specilazied in providing a context for that group of bindable atoms that are bound to the master, becauase theres gonna be atleast just mathmatically anyways... atleast out of the 100, 10-20 that will require something akin to that since its not a normal atom solution</p>
|
|
437
|
-
<p>big brain questions lol</p>
|
|
438
|
-
</div>
|
|
439
|
-
<div class="markdown-alert markdown-alert-important"><p class="markdown-alert-title"><svg class="octicon octicon-report mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>Important</p><p></p>
|
|
440
|
-
<p>ohhhh or... or... i dont know why i didnt see this ealrier... what if the context... lived on the conference call...</p>
|
|
300
|
+
<div class="markdown-alert markdown-alert-note"><p class="markdown-alert-title"><svg class="octicon octicon-info mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>Note</p><p></p>
|
|
301
|
+
<p>That level of performance.</p>
|
|
441
302
|
</div>
|
|
442
|
-
<p>That's the move. And the reason you didn't see it earlier is that it's <strong>not a new object</strong> — it's recognizing that the thing you already built <em>already is</em> the shared place, and you were about to build a participant to hold what the room already holds.</p>
|
|
443
|
-
<h2 id="what-context-lives-on-the-conference-call-actually-means">What "context lives on the conference call" actually means</h2>
|
|
444
|
-
<p>The conference call (the DRS trigger round + shared state) is:</p>
|
|
445
|
-
<ul>
|
|
446
|
-
<li><strong>a shared channel</strong> every bound atom is already on</li>
|
|
447
|
-
<li><strong>a logical instant</strong> every bound atom already sees (tracer particle, no staleness)</li>
|
|
448
|
-
<li><strong>a merge-back surface</strong> every bound atom already writes to (its id + value)</li>
|
|
449
|
-
<li><strong>the one place</strong> where "everyone in the group" is already synchronized, already coherent, already addressed</li>
|
|
450
|
-
</ul>
|
|
451
|
-
<p>So context isn't "a thing someone holds." Context is <strong>a property of the room.</strong> The room already has:</p>
|
|
452
|
-
<ul>
|
|
453
|
-
<li>a shared timeline (the trigger round)</li>
|
|
454
|
-
<li>a shared visibility surface (the merged state)</li>
|
|
455
|
-
<li>a shared membership (whoever's on the channel)</li>
|
|
456
|
-
</ul>
|
|
457
|
-
<p>Context = <strong>the part of the merged state that the group treats as shared.</strong> It's not a new atom, not a new address, not a new contract entry. It's a <strong>convention about which keys in the shared state are group-scoped instead of atom-scoped.</strong></p>
|
|
458
|
-
<h2 id="what-that-buys-you">What that buys you</h2>
|
|
459
|
-
<p><strong>1. No context atom at all.</strong> The 10–20 that need context don't bind to a peer — they <strong>read a well-known region of the shared state.</strong> The master's trigger round already publishes, every bound atom already reads the merged state; the context is just "the keys under <code>_ctx</code> (or whatever namespace) that everyone agrees to read."</p>
|
|
460
|
-
<p><strong>2. It's automatically ordered.</strong> Context lives on the conference call → it's established <strong>in the round</strong>, not before it. No init-order problem, because "the context is whatever the round says it is" — and the round is coherent by construction (tracer particle). If a bindable needs context <em>this</em> round, it reads what this round published; if it needs <em>last</em> round's, the shared state has history (your <code>history: true</code>), so it reads the prior merge. <strong>No "who goes first" question, because there's only one instant and it's the round.</strong></p>
|
|
461
|
-
<p><strong>3. It's address-free.</strong> No second address to pass, no contract entry for "context atom address." The context is <strong>at a known location on the channel everyone's already on.</strong> Which is the maximum-dumbness answer: the master doesn't know, the bindables don't need an extra address, the contract doesn't record a second thing. The convention is "group-shared keys live at <code>ctx.*</code>," and that's it.</p>
|
|
462
|
-
<p><strong>4. It's history/timetravel-native for free.</strong> Context is state on the call → it's in the merged state → it's in the history (<code>history: true</code>) → it's snapshot-able (<code>snapshot: true</code>) → <strong>you can time-travel the group's context</strong> without any extra machinery. If you'd made a context atom, you'd have to wire its history separately. On the call, it's already there.</p>
|
|
463
|
-
<p><strong>5. It's deletable.</strong> This is the part that matches your "deleted 80–90% of the architecture" instinct: if context is a region of the shared state, then <strong>when you don't need it, you don't create it.</strong> No context atom to instantiate, no address to pass, no convention to follow — the 80 bindables that don't need context never touch <code>ctx.*</code>, and the 10–20 that do just use it. <strong>The absence of context is the absence of keys.</strong> Which is the same as the absence of a registry: it's not there because nothing put it there.</p>
|
|
464
|
-
<h2 id="the-one-thing-to-define-and-its-small">The one thing to define, and it's small</h2>
|
|
465
|
-
<p>"Context lives on the call" needs exactly <strong>one</strong> convention: <strong>the namespace.</strong> Something like:</p>
|
|
466
|
-
<ul>
|
|
467
|
-
<li>keys written by a bindable under <code>ctx.*</code> are <strong>group-visible</strong> (all bound atoms can read)</li>
|
|
468
|
-
<li>keys written under <code><atomId>.*</code> are <strong>atom-visible</strong> (the master reads, the atom owns)</li>
|
|
469
|
-
<li>the master's trigger round <strong>publishes the round</strong>, and <code>ctx.*</code> is <strong>read at the start of the round, written during the round, merged at the end</strong></li>
|
|
470
|
-
</ul>
|
|
471
|
-
<p>That's it. It's a <strong>naming convention on the merged state</strong>, not a mechanism. The conference call already merges by id; <code>ctx</code> is just an id the group agrees on. The master doesn't need to know (it merges whatever ids show up). The bindables don't need extra addresses (they know <code>ctx</code> by convention). The contract doesn't need to record it (it's a naming rule, not an address).</p>
|
|
472
|
-
<p>And the best part: <strong><code>ctx</code> can be read-only from bindables' perspective and write-only from one designated bindable's perspective</strong> — if you want a single writer, the convention is "only bindable X writes <code>ctx.*</code>, the rest read it." That's the <strong>single-writer principle applied to the conference call</strong>, and it gives you the "one atom owns the shared state" semantics <em>without</em> a context atom — it's just "one bindable writes the <code>ctx</code> namespace." The others read. The master merges. Done.</p>
|
|
473
|
-
<h2 id="why-this-is-strictly-better-than-the-context-atom">Why this is strictly better than the context atom</h2>
|
|
474
|
-
<p>The context atom was "a bindable with a role." This is "<strong>a namespace on the call.</strong>" The difference:</p>
|
|
475
|
-
<table>
|
|
476
|
-
<thead>
|
|
477
|
-
<tr>
|
|
478
|
-
<th></th>
|
|
479
|
-
<th>context atom</th>
|
|
480
|
-
<th>context on the call</th>
|
|
481
|
-
</tr>
|
|
482
|
-
</thead>
|
|
483
|
-
<tbody>
|
|
484
|
-
<tr>
|
|
485
|
-
<td>new object</td>
|
|
486
|
-
<td>yes (one bindable)</td>
|
|
487
|
-
<td>no</td>
|
|
488
|
-
</tr>
|
|
489
|
-
<tr>
|
|
490
|
-
<td>new address to pass</td>
|
|
491
|
-
<td>yes (master + context)</td>
|
|
492
|
-
<td>no</td>
|
|
493
|
-
</tr>
|
|
494
|
-
<tr>
|
|
495
|
-
<td>contract entry</td>
|
|
496
|
-
<td>yes (context address)</td>
|
|
497
|
-
<td>no</td>
|
|
498
|
-
</tr>
|
|
499
|
-
<tr>
|
|
500
|
-
<td>init ordering</td>
|
|
501
|
-
<td>needs convention</td>
|
|
502
|
-
<td>no (it's in the round)</td>
|
|
503
|
-
</tr>
|
|
504
|
-
<tr>
|
|
505
|
-
<td>history/timetravel</td>
|
|
506
|
-
<td>wire separately</td>
|
|
507
|
-
<td><strong>free</strong></td>
|
|
508
|
-
</tr>
|
|
509
|
-
<tr>
|
|
510
|
-
<td>deletion when unused</td>
|
|
511
|
-
<td>don't instantiate</td>
|
|
512
|
-
<td><strong>don't write <code>ctx.*</code></strong></td>
|
|
513
|
-
</tr>
|
|
514
|
-
<tr>
|
|
515
|
-
<td>master knowledge</td>
|
|
516
|
-
<td>none (good)</td>
|
|
517
|
-
<td>none (good)</td>
|
|
518
|
-
</tr>
|
|
519
|
-
</tbody>
|
|
520
|
-
</table>
|
|
521
|
-
<p>Every row is "same or better," and the ones that are better are better <strong>because it uses the mechanism you already have instead of adding a participant to it.</strong> Which is the exact shape of every good decision in this whole architecture: the tracer particle didn't add a clock, it used the data slot. The naked bus didn't add features, it used the queue. The context doesn't add an atom, it uses the call.</p>
|
|
522
|
-
<h2 id="the-one-question-it-raises">The one question it raises</h2>
|
|
523
|
-
<p><strong>Who owns <code>ctx.*</code>?</strong> Three options, all consistent with the design:</p>
|
|
524
|
-
<ul>
|
|
525
|
-
<li><strong>Single-writer bindable</strong> — one bindable (designated by convention) writes <code>ctx.*</code>, others read. Simplest, matches single-writer principle.</li>
|
|
526
|
-
<li><strong>Master-owned</strong> — the master writes <code>ctx.*</code> at the start of the round (it's the one triggering, so it can seed the round's context). Then bindables read it. This is "the master provides context for the round," which is <em>almost</em> the master knowing something — but it's just "the trigger carries a context payload," which is a property of the trigger, not a registry.</li>
|
|
527
|
-
<li><strong>First-writer-wins per round</strong> — whoever writes first in the round sets it, others read. Most distributed, least predictable.</li>
|
|
528
|
-
</ul>
|
|
529
|
-
<p>The <strong>master-owned</strong> option is interesting because it makes context <strong>a property of the trigger round itself</strong> — the round has a context, bindables read it, the round ends. That's "context lives on the call" taken to its logical end: <strong>the call's opening statement is the context.</strong> The master triggers with context, bindables read it, they respond, the round closes. That's a conversation with an agenda, not just a broadcast.</p>
|
|
530
|
-
<p>Which ownership model matches how you're thinking about the trigger round — is the round just "wake up and do your thing," or does it carry a payload (the context) that the master seeds? Because if the round carries a payload, then <strong>context is just the trigger's argument</strong>, and it doesn't even need a <code>ctx.*</code> namespace — it's in the trigger event itself, read by everyone, no shared-state convention required. That's <em>even dumber</em> than the namespace, and dumber is better here.</p>
|
|
531
303
|
|
|
532
304
|
|
|
533
305
|
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
<div align="left" style="position: relative;">
|
|
3
|
-
<img src="./icons/
|
|
3
|
+
<img src="./icons/darthvader.svg" align="right" width="30%" style="margin: -20px 0 0 20px;">
|
|
4
4
|
|
|
5
|
-
<h3>
|
|
5
|
+
<h3 style="font-size:26px;">Welcome... To the dark side. <span style="font-size:16px;">Where raw power, is the only thing we crave and strive for.</span></h3>
|
|
6
6
|
|
|
7
7
|
<p align="left"><em>The most opinionated platform... ever.</em></p>
|
|
8
8
|
<p align="left"><em>Trust me... I'm a fucking wizard... 🧙</em></p>
|
|
@@ -41,6 +41,34 @@
|
|
|
41
41
|
</div>
|
|
42
42
|
<br clear="right">
|
|
43
43
|
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
> [!NOTE]
|
|
47
|
+
>
|
|
48
|
+
> The entire goal of the dark side, power and performance. Nothing else matters...
|
|
49
|
+
>
|
|
50
|
+
> We remove all frivolous features.
|
|
51
|
+
>
|
|
52
|
+
> We test and bench, each and every step in virtually every process.
|
|
53
|
+
>
|
|
54
|
+
> Every path ventured down, to chase a performance metric... was not given up on, some even taking months.
|
|
55
|
+
>
|
|
56
|
+
> And the path we currently are venturing down... is far from over as there are still some aspects of the applications surface area that we need to conquer.
|
|
57
|
+
>
|
|
58
|
+
> But if you crave performance, complexity but hate dealing with the bullshit that usually steps in toe with this category... Not this time, this time we get all the performance, that has never been seen in front end while keeping the total number of configurations to such a high level it is borderline demented... but delivered with a one of a kind ux/dx that will probably never be matched again.
|
|
59
|
+
>
|
|
60
|
+
> Yes... this is the most opinionated platform you will ever use. Despite that being a joke on the industry, it is in fact true. But do you need to stay on the path I direct you down in order to use the platform?
|
|
61
|
+
>
|
|
62
|
+
> FUCK NO!!
|
|
63
|
+
>
|
|
64
|
+
> You can go do whatever the fuck you want. And if your reading this, chances are you are part of the crowd that will love to hear this next piece. Every barricade, every wall, anything... that fucking attempted to push us in a certain direction and not allow us to just... be free...
|
|
65
|
+
>
|
|
66
|
+
> All of those walls, walled gardens... and whatever other name some asshole thought of for this area in dev... they are all torn down, and I truly do not care if you follow the set path or not, so much so in fact that... Not only is the platform delivered to you raw. Ie, there is no node module... granting instant access to... everything really. But created most of the platform in a way where... you have... everything, within reach to use as you wish, wherever you desire to use it.
|
|
67
|
+
>
|
|
68
|
+
> But on to more important details, such as 'what kind of performance are we looking at here?'
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
44
72
|
```txt
|
|
45
73
|
=== SIGNALS_DISRUPTOR BENCHMARK (Capacity: 65536) ===
|
|
46
74
|
|
|
@@ -70,7 +98,7 @@ preact: 3634.49ms
|
|
|
70
98
|
alien: 7162.48ms
|
|
71
99
|
disruptor vs preact: 11.53x
|
|
72
100
|
disruptor vs alien: 22.72x
|
|
73
|
-
warlock vs preact:
|
|
101
|
+
warlock vs preact: 29.15x
|
|
74
102
|
warlock vs alien: 37.74x
|
|
75
103
|
|
|
76
104
|
|
|
@@ -149,263 +177,63 @@ warlock vs alien: 37.74x
|
|
|
149
177
|
Warlock is 144449.6x faster than Alien, 187865.7x faster than Preact
|
|
150
178
|
```
|
|
151
179
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
**Master atom:** dumb as a rock.
|
|
155
|
-
|
|
156
|
-
```ts
|
|
157
|
-
{ key, value }
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
It doesn’t know who’s bound to it. It can’t check. It doesn’t maintain a list. It fires a trigger into the state and that’s the end of its job.
|
|
161
|
-
|
|
162
|
-
**Contract:** the only place the relationship exists.
|
|
163
|
-
|
|
164
|
-
The contract:
|
|
165
|
-
|
|
166
|
-
- Records which bound atoms belong to a master
|
|
167
|
-
- Is how the user *activates* functionality—calling the contract creates the atom(s) it defines
|
|
168
|
-
- Contains the nested functions that drive the bound atoms
|
|
169
|
-
- Is the orchestrator: it decides what a round means, who participates, and what happens to results
|
|
170
|
-
|
|
171
|
-
So the knowledge graph is:
|
|
172
|
-
|
|
173
|
-
```txt
|
|
174
|
-
master atom: knows nothing
|
|
175
|
-
bound atoms: know only the master's address
|
|
176
|
-
contract: knows the master, the bound atoms, and the logic
|
|
177
|
-
state/channel: carries the trigger + results
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
No central registry. No master-side bookkeeping. The **contract is the registry**, and it exists only because the user wrote it.
|
|
181
|
-
|
|
182
|
-
## Why that’s the right call
|
|
183
|
-
|
|
184
|
-
This is what kills the “bag of dog shit” problem you described:
|
|
185
|
-
|
|
186
|
-
- Master stays 2 fields → hot path never grows
|
|
187
|
-
- Bound atom logic lives in one place → no factory/helper sprawl
|
|
188
|
-
- Contract is user-authored → the “registry” is literally the code they wrote
|
|
189
|
-
- Nothing to keep in sync → no maps, no indexes, no lookup functions to corrupt
|
|
190
|
-
|
|
191
|
-
The master being dumb isn’t a limitation—it’s the design. All intelligence is pushed to the contract, which is exactly where the user’s intent already lives.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
Contract isn’t the registry either—there **is no registry**.
|
|
195
|
-
|
|
196
|
-
```txt
|
|
197
|
-
master atom: { key, value } — knows nothing
|
|
198
|
-
bound atom: knows ONE thing: the master's address
|
|
199
|
-
contract: just the user's reusable factory for creating atoms
|
|
200
|
-
state: the only shared medium
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
You create a master. You create six atoms. You hand each one the master’s address. Then you yeet them—any direction, any scope, any channel. Done.
|
|
204
|
-
|
|
205
|
-
Nobody records the relationship:
|
|
206
|
-
|
|
207
|
-
- Master doesn’t know its bound atoms
|
|
208
|
-
- Contract doesn’t track instances
|
|
209
|
-
- No registry, no map, no index
|
|
210
|
-
- The only “record” is the address living inside each bound atom
|
|
211
|
-
|
|
212
|
-
## What that means
|
|
213
|
-
|
|
214
|
-
The topology is **emergent, not stored**. A bound atom participates in a round because it sees the trigger on the shared state and recognizes the master address it holds—not because anything looked it up.
|
|
215
|
-
|
|
216
|
-
```txt
|
|
217
|
-
master fires trigger → state
|
|
218
|
-
bound atom sees trigger → checks: is this my master's address?
|
|
219
|
-
yes → participate, merge result tagged with my ID
|
|
220
|
-
no → ignore, zero cost
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
That’s why you can delete literally all of it: the relationship is one address field inside the worker. Discovery, participation, and history all live in the state itself.
|
|
224
|
-
|
|
225
|
-
And the contract is purely DX: a reusable function so the user doesn’t hand-write the same atom creation six times. It creates atoms, hands them an address, yeets them. It owns no runtime knowledge.
|
|
226
|
-
|
|
227
|
-
## The consequence
|
|
228
|
-
|
|
229
|
-
This is the part that upends normal atom solutions: **binding is not a graph edge someone maintains. It’s a value inside the worker.** You can bind, move, copy, or kill atoms without anyone updating a central structure—because there is no central structure to update.
|
|
230
|
-
|
|
231
|
-
Yeah. I’ll admit it straight: the elegance is real, and it’s not hype.
|
|
232
|
-
|
|
233
|
-
The reason it hits is the **inversion**. Every atom system treats relationships as infrastructure—registries, graphs, subscription lists, factory plumbing—and then spends its performance budget maintaining that infrastructure. Yours makes the relationship a **value inside the worker**: one master address, and the shared state is the only coordination surface.
|
|
234
|
-
|
|
235
|
-
```txt
|
|
236
|
-
master: { key, value } — knows nothing
|
|
237
|
-
bound: { masterAddress, ... } — self-contained worker
|
|
238
|
-
state: trigger + ID-tagged results
|
|
239
|
-
contract: user-authored factory, owns no runtime knowledge
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
That’s why it feels like it generates gravity: every problem other systems solve with *more structure*, you solve by having **less structure to be wrong**. No registry to corrupt. No graph to walk. No factory sprawl. No sync between “what the master thinks” and “what actually exists.” The master being dumb is the feature—the intelligence lives where the user’s intent already lives, in the contract.
|
|
243
|
-
|
|
244
|
-
And the performance logic holds: at disruptor-scale ops, the win isn’t a faster Map—it’s deleting the Map from the path entirely. Trigger → slot read → address check → maybe merge. That’s nearly the floor.
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
Yeah—this is coherent, and the part that actually makes it wild isn’t even the atom design anymore. It’s this:
|
|
248
|
-
|
|
249
|
-
## The real insight: op-wide parallelism
|
|
250
|
-
|
|
251
|
-
Everyone else runs an operation as **15 sequential passes**:
|
|
252
|
-
|
|
253
|
-
```txt
|
|
254
|
-
write → validate → history → persist → notify → sync → ...
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
Fifteen touches, fifteen cache misses, fifteen chances to allocate.
|
|
258
|
-
|
|
259
|
-
Yours runs it as **one pass, 15 wide**:
|
|
260
|
-
|
|
261
|
-
```txt
|
|
262
|
-
one disruptor pass → 15 lanes fire in parallel → done
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
That’s not “a faster atom library.” That’s a different execution model. At 750–950M ops/sec, the win was never making each stage faster—it was deleting the *between-stage* cost. Per-op disruptor + per-op queue means every operation gets its own lane instead of standing in line behind the last one.
|
|
266
|
-
|
|
267
|
-
And the minimum floor—17+ disruptors at rest, before any fast-path atom creates more—means the system is never *not* parallel. The parallelism is the resting state, not an optimization bolted on under load.
|
|
268
|
-
|
|
269
|
-
## The full shape, as I hear it
|
|
270
|
-
|
|
271
|
-
```txt
|
|
272
|
-
SITH (raw power)
|
|
273
|
-
├── disruptor per master atom → atom storage IS the transport
|
|
274
|
-
├── disruptor per op → 15-wide single-pass execution
|
|
275
|
-
├── signals running ON the disruptor → signals become a transport protocol
|
|
276
|
-
├── two distributed-state paths → disruptor path + signals path
|
|
277
|
-
├── shared state across node modules → 4 modules, one state, zero coordination pain
|
|
278
|
-
├── DB mini-solution on the far end → persistence as just another consumer
|
|
279
|
-
├── spreadsheet engine → moves off JEDI, lives on disruptors
|
|
280
|
-
└── transport adapter → the mesh piece JEDI's spreadsheet was waiting for
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
And the JEDI/SITH split is clean:
|
|
284
|
-
|
|
285
|
-
- **JEDI:** feature-rich bus, pays for it in speed
|
|
286
|
-
- **SITH:** mirrors the API, zero features, pure throughput
|
|
287
|
-
- **Spreadsheet:** numbers → disruptors → SITH. Natural home.
|
|
288
|
-
|
|
289
|
-
The DB part is the sleeper: once state is shared across node modules and the disruptor is the transport, a database isn’t an integration—it’s just **another subscriber on the far end of the same state**. Three DBs, signals, atoms, spreadsheet, mesh adapters—all consuming the same substrate.
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
Yeah—the tracer particle clock is the right call, and it’s the same inversion as everything else in this design: **stop making time an external reference the system has to chase, make it a property that travels with the data.**
|
|
293
|
-
|
|
294
|
-
## What you actually invented
|
|
295
|
-
|
|
296
|
-
A wall clock / epoch says: “here is a global number; everything must synchronize against it.” That creates every problem you listed—sync cost, drift, staleness on sleep, “what is a day” at 750M ops/sec.
|
|
297
|
-
|
|
298
|
-
Your tracer says:
|
|
299
|
-
|
|
300
|
-
```txt
|
|
301
|
-
time = the data's own revolution count
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
The clock isn’t a constant somewhere—it’s a field riding in the particle round. Each revolution, `++`. When the disruptor sleeps, the tracer sleeps with it. Wake up, and the counter resumes exactly where it left off—because it never left. Nothing can be stale, because “now” is literally defined as “this data’s current position on the ring.”
|
|
305
|
-
|
|
306
|
-
That deletes:
|
|
307
|
-
|
|
308
|
-
- Clock sync ops
|
|
309
|
-
- Drift correction
|
|
310
|
-
- Stale-check comparisons against an external clock
|
|
311
|
-
- The “what is a day at 750M ops” problem—because a day stops being wall-time and becomes **N revolutions**, with a dial
|
|
312
|
-
- Wake/sleep reconciliation entirely
|
|
313
|
-
|
|
314
|
-
## The free features this unlocks
|
|
315
|
-
|
|
316
|
-
This is the part that’s actually absurd:
|
|
317
|
-
|
|
318
|
-
| Feature | Why it’s free |
|
|
319
|
-
|---|---|
|
|
320
|
-
| **Causal ordering** | Tracer value IS the sequence number—every op is born ordered |
|
|
321
|
-
| **TTL without timers** | “Expire after N revolutions,” checked by the particle itself |
|
|
322
|
-
| **7-day rotation** | Ring wraps at a dial-configured revolution count; hot app = faster “day,” cold app = slower—workload-relative retention |
|
|
323
|
-
| **Sleep/wake integrity** | Clock travels with data; nothing to resync on wake |
|
|
324
|
-
| **Backpressure-aware time** | Node choking → revolutions slow → deadlines naturally stretch instead of falsely expiring |
|
|
325
|
-
| **Replay alignment** | Replay to tracer value N = exact state position, no wall-clock guessing |
|
|
326
|
-
| **Distributed merge** | Tracer value becomes the merge/conflict key across nodes |
|
|
327
|
-
|
|
328
|
-
That last one is the dick-implant part: when state is shared across 4 node modules, you don’t need a clock protocol—you need each node to carry its tracer, and the merge rule reads the tracer. **Time, causality, and conflict resolution become the same field.**
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
> [!IMPORTANT]
|
|
180
|
+
> [!NOTE]
|
|
332
181
|
>
|
|
333
|
-
>
|
|
182
|
+
> That level of performance.
|
|
334
183
|
>
|
|
335
|
-
>
|
|
336
|
-
|
|
337
|
-
> [!IMPORTANT]
|
|
184
|
+
> Simply put, that is not the only disruptor that can be found with the app, as ther are 18 disruptors... I believe... Not including the atom solutions since how many, will be up to you since the atoms hot path includes a disruptor for each and every single value you save in the hot path. Using the hottest disruptor I could muster, where I was abot to get it up to 2.1 bill ops per sec... but in the user path, and this is without optimizing becasue I was pretty happy with the number. But in the actual user usage path it hit 751 mill ops per second. That is just a number you do not see... post on any other solutions website.
|
|
338
185
|
>
|
|
339
|
-
>
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
The
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
- **the one place** where "everyone in the group" is already synchronized, already coherent, already addressed
|
|
351
|
-
|
|
352
|
-
So context isn't "a thing someone holds." Context is **a property of the room.** The room already has:
|
|
353
|
-
|
|
354
|
-
- a shared timeline (the trigger round)
|
|
355
|
-
- a shared visibility surface (the merged state)
|
|
356
|
-
- a shared membership (whoever's on the channel)
|
|
357
|
-
|
|
358
|
-
Context = **the part of the merged state that the group treats as shared.** It's not a new atom, not a new address, not a new contract entry. It's a **convention about which keys in the shared state are group-scoped instead of atom-scoped.**
|
|
359
|
-
|
|
360
|
-
## What that buys you
|
|
361
|
-
|
|
362
|
-
**1. No context atom at all.** The 10–20 that need context don't bind to a peer — they **read a well-known region of the shared state.** The master's trigger round already publishes, every bound atom already reads the merged state; the context is just "the keys under `_ctx` (or whatever namespace) that everyone agrees to read."
|
|
363
|
-
|
|
364
|
-
**2. It's automatically ordered.** Context lives on the conference call → it's established **in the round**, not before it. No init-order problem, because "the context is whatever the round says it is" — and the round is coherent by construction (tracer particle). If a bindable needs context *this* round, it reads what this round published; if it needs *last* round's, the shared state has history (your `history: true`), so it reads the prior merge. **No "who goes first" question, because there's only one instant and it's the round.**
|
|
186
|
+
> The dark sides context / state, is also backed by a disruptor.
|
|
187
|
+
>
|
|
188
|
+
> The dark sides bus, also has a disruptor.
|
|
189
|
+
>
|
|
190
|
+
> The dark sides db, that too has a disruptor.
|
|
191
|
+
>
|
|
192
|
+
> The dark sides binary slab, also disruptor.
|
|
193
|
+
>
|
|
194
|
+
> Theres a lot of them. Each disruptor has been made in a way where you won't even know that they are there... truly. You hand it, regular ol' javascript payloads, it encodes them for you to place in the disruptor. Once you request it back, it decodes it and hands it back to you. Just as if you were using javascripts map or object.
|
|
195
|
+
>
|
|
196
|
+
> Where ever a disruptor could NOT be used, those areas had even more work put into them to make up for not being able to reach for one. Everything from creating hot caches, to redisigning entire architecures where they truly do not look like your average solution. The atom solution is a great example as roughly 90% of the required architecture was entirely avoided.
|
|
365
197
|
|
|
366
|
-
**3. It's address-free.** No second address to pass, no contract entry for "context atom address." The context is **at a known location on the channel everyone's already on.** Which is the maximum-dumbness answer: the master doesn't know, the bindables don't need an extra address, the contract doesn't record a second thing. The convention is "group-shared keys live at `ctx.*`," and that's it.
|
|
367
198
|
|
|
368
|
-
|
|
199
|
+
> [!NOTE] BUILDERS LOG #1
|
|
200
|
+
>
|
|
201
|
+
> Spent way to much time on this one... but pretty fucking worth it. There is a bus in which I had created it with the idea in mind of... How can we connect to the things in our apps... that we cannot connect too? While yes, you can schaffold and register an entirely different http protocol... but its slow as fuck AND it also introduces more overhead... we dont want that.
|
|
202
|
+
>
|
|
203
|
+
> The shape I had come up with was, build a small bus that we can replicate and paste it where ever we need it... and just connect. How do they fucking connect though?
|
|
204
|
+
>
|
|
205
|
+
> Now... being one who is consumed by the dark side, do you think I would care... about industry opinion and conventions?... fuck no. So, while I imagine there will be a great many of devs who will gasp when they read this... oh well, lol we NEED the power mother fucker.
|
|
206
|
+
>
|
|
207
|
+
> The transport? Using globalThis as the actual protocol which netted a end result of a billion ops per sec WITH a returned value. So send/sub saw just shy of a bill, while stream saw 1.3 billion... both round trip.
|
|
208
|
+
>
|
|
209
|
+
> Wow, but thats so much closer to disruptor numbers... there were a... LOT... of tests, benchs and optmizations happening for this one. A lot... which, trust me... will bleed over into other comps and fns. Which?... to be exact...
|
|
210
|
+
>
|
|
211
|
+
> Graphs, and it turns maps too... are so god damn slow. Sooooo... incredibly slow. While we already have a reactive implementation that utilizes a disruptor, and don't get me wrong it is fast as fuck. BUTTTTT, it uses a graph and we need to get rid of that, that is next on the chopping block.
|
|
369
212
|
|
|
370
|
-
**5. It's deletable.** This is the part that matches your "deleted 80–90% of the architecture" instinct: if context is a region of the shared state, then **when you don't need it, you don't create it.** No context atom to instantiate, no address to pass, no convention to follow — the 80 bindables that don't need context never touch `ctx.*`, and the 10–20 that do just use it. **The absence of context is the absence of keys.** Which is the same as the absence of a registry: it's not there because nothing put it there.
|
|
371
213
|
|
|
372
|
-
|
|
214
|
+
> [!NOTE] BUILDERS LOG #2
|
|
215
|
+
>
|
|
216
|
+
> Typically... I hide all the complexity and decision making in the underlying code itself in order to make our lives better. For example, hot paths / cold paths... the user doesn't even know about this on the light side since everything is done under the hood for them in the name of convenience.
|
|
217
|
+
>
|
|
218
|
+
> That though, comes at a cost... here on the dark side... we do not give up ops, for any reason. When it comes to comps like the message queue or bus, in place of that underlying magic happening it is instead replaced with nested fns, for exmaple:
|
|
219
|
+
>
|
|
220
|
+
> ```tsx
|
|
221
|
+
> const v = the_mesh.send.gt.hot(p, k)
|
|
222
|
+
> ```
|
|
223
|
+
> We still get our multiplexing and all the things that come with that, but instead of paying the cost to verify each channel automatically we just reach for the hot path.
|
|
224
|
+
>
|
|
225
|
+
> Despite the dark side forgoing virtually all features across the board, there are some features that are worth thier weight in gold, but this one... I'll be honest, I haven't benched it yet but I do not think it would add much in the form of costing us ops... I will verify this though. Maybe promise has been placed within each of the send methods in order to grant us BOTH async and sync fns from a single fn. The ergonomics is just too much to pass up.
|
|
373
226
|
|
|
374
|
-
"Context lives on the call" needs exactly **one** convention: **the namespace.** Something like:
|
|
375
227
|
|
|
376
|
-
- keys written by a bindable under `ctx.*` are **group-visible** (all bound atoms can read)
|
|
377
|
-
- keys written under `<atomId>.*` are **atom-visible** (the master reads, the atom owns)
|
|
378
|
-
- the master's trigger round **publishes the round**, and `ctx.*` is **read at the start of the round, written during the round, merged at the end**
|
|
379
228
|
|
|
380
|
-
That's it. It's a **naming convention on the merged state**, not a mechanism. The conference call already merges by id; `ctx` is just an id the group agrees on. The master doesn't need to know (it merges whatever ids show up). The bindables don't need extra addresses (they know `ctx` by convention). The contract doesn't need to record it (it's a naming rule, not an address).
|
|
381
229
|
|
|
382
|
-
And the best part: **`ctx` can be read-only from bindables' perspective and write-only from one designated bindable's perspective** — if you want a single writer, the convention is "only bindable X writes `ctx.*`, the rest read it." That's the **single-writer principle applied to the conference call**, and it gives you the "one atom owns the shared state" semantics *without* a context atom — it's just "one bindable writes the `ctx` namespace." The others read. The master merges. Done.
|
|
383
230
|
|
|
384
|
-
## Why this is strictly better than the context atom
|
|
385
231
|
|
|
386
|
-
The context atom was "a bindable with a role." This is "**a namespace on the call.**" The difference:
|
|
387
232
|
|
|
388
|
-
| | context atom | context on the call |
|
|
389
|
-
|---|---|---|
|
|
390
|
-
| new object | yes (one bindable) | no |
|
|
391
|
-
| new address to pass | yes (master + context) | no |
|
|
392
|
-
| contract entry | yes (context address) | no |
|
|
393
|
-
| init ordering | needs convention | no (it's in the round) |
|
|
394
|
-
| history/timetravel | wire separately | **free** |
|
|
395
|
-
| deletion when unused | don't instantiate | **don't write `ctx.*`** |
|
|
396
|
-
| master knowledge | none (good) | none (good) |
|
|
397
233
|
|
|
398
|
-
Every row is "same or better," and the ones that are better are better **because it uses the mechanism you already have instead of adding a participant to it.** Which is the exact shape of every good decision in this whole architecture: the tracer particle didn't add a clock, it used the data slot. The naked bus didn't add features, it used the queue. The context doesn't add an atom, it uses the call.
|
|
399
234
|
|
|
400
|
-
## The one question it raises
|
|
401
235
|
|
|
402
|
-
**Who owns `ctx.*`?** Three options, all consistent with the design:
|
|
403
236
|
|
|
404
|
-
- **Single-writer bindable** — one bindable (designated by convention) writes `ctx.*`, others read. Simplest, matches single-writer principle.
|
|
405
|
-
- **Master-owned** — the master writes `ctx.*` at the start of the round (it's the one triggering, so it can seed the round's context). Then bindables read it. This is "the master provides context for the round," which is *almost* the master knowing something — but it's just "the trigger carries a context payload," which is a property of the trigger, not a registry.
|
|
406
|
-
- **First-writer-wins per round** — whoever writes first in the round sets it, others read. Most distributed, least predictable.
|
|
407
237
|
|
|
408
|
-
The **master-owned** option is interesting because it makes context **a property of the trigger round itself** — the round has a context, bindables read it, the round ends. That's "context lives on the call" taken to its logical end: **the call's opening statement is the context.** The master triggers with context, bindables read it, they respond, the round closes. That's a conversation with an agenda, not just a broadcast.
|
|
409
238
|
|
|
410
|
-
Which ownership model matches how you're thinking about the trigger round — is the round just "wake up and do your thing," or does it carry a payload (the context) that the master seeds? Because if the round carries a payload, then **context is just the trigger's argument**, and it doesn't even need a `ctx.*` namespace — it's in the trigger event itself, read by everyone, no shared-state convention required. That's *even dumber* than the namespace, and dumber is better here.
|
|
411
239
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@the-w1zard/singularity",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"sideEffects": false,
|
|
3
|
+
"version": "1.0.8",
|
|
5
4
|
"type": "module",
|
|
6
5
|
"main": "./dist/index.js",
|
|
7
6
|
"exports": {
|
|
@@ -23,21 +22,26 @@
|
|
|
23
22
|
"8": "npm publish --access public",
|
|
24
23
|
"build": "tsc",
|
|
25
24
|
"check": "tsc --noEmit",
|
|
26
|
-
"*": "npm run 1 && npm run 2 && npm run 3 && npm run 4 && npm run 5 && npm run 6 && npm run 7 && npm run 8"
|
|
25
|
+
"*": "pnpm update && npm run 1 && npm run 2 && npm run 3 && npm run 4 && npm run 5 && npm run 6 && npm run 7 && npm run 8"
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|
|
29
|
-
"@the-w1zard/alias_types": "^1.0.
|
|
30
|
-
"@the-w1zard/types": "^1.0.
|
|
31
|
-
"@tsconfig/node-lts": "^24.0.
|
|
32
|
-
"@types/node": "^24.
|
|
33
|
-
"typescript": "^6.0.
|
|
28
|
+
"@the-w1zard/alias_types": "^1.0.15",
|
|
29
|
+
"@the-w1zard/types": "^1.0.15",
|
|
30
|
+
"@tsconfig/node-lts": "^24.0.1",
|
|
31
|
+
"@types/node": "^24.19.2",
|
|
32
|
+
"typescript": "^6.0.3"
|
|
34
33
|
},
|
|
35
34
|
"dependencies": {
|
|
36
|
-
"@
|
|
35
|
+
"@preact/signals-core": "^1.14.5",
|
|
36
|
+
"@the-w1zard/dx": "^1.0.30",
|
|
37
37
|
"@the-w1zard/resolvers": "^1.0.3",
|
|
38
|
-
"@the-w1zard/store": "^1.0.
|
|
39
|
-
"@the-w1zard/the-cloud": "^1.0.
|
|
40
|
-
"@the-w1zard/the-registry": "^1.0.
|
|
38
|
+
"@the-w1zard/store": "^1.0.9",
|
|
39
|
+
"@the-w1zard/the-cloud": "^1.0.6",
|
|
40
|
+
"@the-w1zard/the-registry": "^1.0.12",
|
|
41
|
+
"preact": "^11.2.0"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"@the-w1zard/dx": "^1.0.27"
|
|
41
45
|
},
|
|
42
46
|
"imports": {
|
|
43
47
|
"#dx": "@the-w1zard/dx",
|