<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nikolay Suslov</title>
    <description>The latest articles on DEV Community by Nikolay Suslov (@nikolaysuslov).</description>
    <link>https://dev.to/nikolaysuslov</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F327950%2Fa9df0cc7-df85-4fac-878e-fcdf85929b50.jpeg</url>
      <title>DEV Community: Nikolay Suslov</title>
      <link>https://dev.to/nikolaysuslov</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nikolaysuslov"/>
    <language>en</language>
    <item>
      <title>Fractal Time Generator in Schrödinger equation</title>
      <dc:creator>Nikolay Suslov</dc:creator>
      <pubDate>Fri, 29 May 2026 04:59:05 +0000</pubDate>
      <link>https://dev.to/nikolaysuslov/fractal-time-generator-in-schrodinger-equation-1d6l</link>
      <guid>https://dev.to/nikolaysuslov/fractal-time-generator-in-schrodinger-equation-1d6l</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/NikolaySuslov/krestianstvo-wavefront-evaluator" rel="noopener noreferrer"&gt;Krestianstvo Wavefront Evaluator&lt;/a&gt; fractal time generator is substituted into the Schrödinger equation as a quantum kinetics operator, even though it is not one. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxupz7ja35l7frvmboxh.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxupz7ja35l7frvmboxh.jpg" alt="Fractal Time Generator in Schrödinger equation" width="800" height="519"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Video: Object's wavefront as solitons interact with the "eye's retina", projects back into a virtual world as solitons.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.facebook.com/reel/2129896597791057" rel="noopener noreferrer"&gt;https://www.facebook.com/reel/2129896597791057&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The use of a fractal time generator makes it possible to bridge the concepts of quantum (wave) mechanics with Hopfield associative memory (an artificial neural network). Towards AGI. Both operate on the principle of "energy" minimization: solitons—much like neurons in AI — "roll down" into potential wells corresponding to minimum energy states.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffbag7pasodno45pd6ir6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffbag7pasodno45pd6ir6.jpg" alt="" width="799" height="382"&gt;&lt;/a&gt;&lt;br&gt;
Video  shows the generation of the image on "eye's retina" achieved by fractal time generator within the Krestianstvo Wavefront Evaluator.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.facebook.com/reel/972183702382043" rel="noopener noreferrer"&gt;https://www.facebook.com/reel/972183702382043&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>gamedev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Live Holographic Editor In Fractal Time</title>
      <dc:creator>Nikolay Suslov</dc:creator>
      <pubDate>Mon, 25 May 2026 05:41:39 +0000</pubDate>
      <link>https://dev.to/nikolaysuslov/live-holographic-editor-in-fractal-time-34lj</link>
      <guid>https://dev.to/nikolaysuslov/live-holographic-editor-in-fractal-time-34lj</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flzs4zw0en5c2o4s0uzph.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flzs4zw0en5c2o4s0uzph.jpg" alt="Holography" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.facebook.com/reel/998276146091090" rel="noopener noreferrer"&gt;https://www.facebook.com/reel/998276146091090&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The  photo demonstrates the process of working with new types of the holograms. Interaction with these holograms takes place directly within the wavefront itself,  experimenting with resonance. This footage represents a fragment of a future wavefront-based computer graphics applications — in which the traditional ontological distinction between "model" and "view" is blurred up.&lt;/p&gt;

&lt;p&gt;What does it mean to "observe" and what constitutes the authentic "life of an Instanton"? It might seem, that observation process depends on the dynamics of the fractal time generator; however, this is not almost complete, because observation process enters into resonance with itself—it observes the very life of the observer. This constitutes the Universal Observer, analogous to the Universal Turing Machine.&lt;br&gt;
The "hologram" of the wavefront—produced by fractal-time generator - is fed back to itself. The process then recursively converges toward an an "Instanton". That serves simultaneously as both the model and the view. Also this represents a new understanding of the hologram.&lt;/p&gt;

&lt;p&gt;Consequently, the fundamental question regarding the "source of truth" (i.e., the correspondence between the model and reality) transforms onto the question of the theory of interaction. Same time geometry of the spacetime, replaced by the geometry of interaction.&lt;br&gt;&lt;br&gt;
Traditionally, functional-reactive programming and incremental computation approach this new geometry through the prism of algebraic geometry, rather through physical experiment as found in Krestianstvo Wavefront Evaluator.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>mixedreality</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Instanton in Fractal Time</title>
      <dc:creator>Nikolay Suslov</dc:creator>
      <pubDate>Mon, 25 May 2026 05:38:07 +0000</pubDate>
      <link>https://dev.to/nikolaysuslov/instanton-in-fractal-time-4ip7</link>
      <guid>https://dev.to/nikolaysuslov/instanton-in-fractal-time-4ip7</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fctpb99qdnsbm6h21lx72.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fctpb99qdnsbm6h21lx72.jpg" alt="Instanton" width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.facebook.com/reel/1522546685934753" rel="noopener noreferrer"&gt;https://www.facebook.com/reel/1522546685934753&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is not a standard animation of an instanton's "life," but rather a recording captured through an "lens of the eye" that adapts itself to the instanton. Drived by fractal time generator. The fractional order of the operator "breathes" in rhythm with the system's dynamics.&lt;/p&gt;

&lt;p&gt;Left — intensity, Middle — phase, Right — topo charge.&lt;br&gt;
In standard implementation, the operator kernel is selected prior to the commencement of calculations and remains fixed until their completion. This implementation replaces this fixed kernel; instead, the kernel is constructed based on the orbits of a fractal time generator. If the field is turbulent and generates shorter "pulses" (beats), the operator becomes more local. Conversely, if these "pulses" propagate widely, the operator becomes more nonlocal.&lt;br&gt;
The effective Laplacian retains its fractal character regardless of whether the fine or coarse structure of the field is being examined. Fractal time acts as a natural regulator, preventing the system from collapsing.&lt;/p&gt;

&lt;p&gt;One might assume that this "focusing" through a fractal lens captures only the most stable ratios; however, this is not the case. What you observe through the fractal time generator is, in fact, the true "life" of the instanton. &lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>computerscience</category>
      <category>science</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Fractal Time Oriented Programming</title>
      <dc:creator>Nikolay Suslov</dc:creator>
      <pubDate>Sat, 23 May 2026 03:16:48 +0000</pubDate>
      <link>https://dev.to/nikolaysuslov/fractal-time-oriented-programming-50nb</link>
      <guid>https://dev.to/nikolaysuslov/fractal-time-oriented-programming-50nb</guid>
      <description>&lt;ol&gt;
&lt;li&gt;Everything is an Instanton (a localized event).&lt;/li&gt;
&lt;li&gt;Instantons "exchange" Solitons (causal connections).&lt;/li&gt;
&lt;li&gt;An Instanton resonates at various depths of Fractal Time, forming natural harmonics of the space-time medium itself—the Instanton.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;Video demo:&lt;br&gt;
&lt;a href="https://www.facebook.com/reel/35617205774594807" rel="noopener noreferrer"&gt;https://www.facebook.com/reel/35617205774594807&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Everything is an Instanton (Computation as an Event)&lt;/strong&gt;.
&lt;/h2&gt;

&lt;p&gt;In a continuous medium, there are no "static objects" holding data in memory. There are only localized events (tunneling/state transitions).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Paradigm Shift&lt;/strong&gt;: In traditional architectures, computation is State + Manipulation (a noun being acted upon by a verb). In new formulation, computation is purely an Event (the verb is the noun). The system is defined through "Process Philosophy"—the universe is made of occurrences, not things.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Instantons exchange Solitons (Causal Connections)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Krestiasntvo Wavefront Evaluator relies on the Huygens-Fresnel principle (with specific delay values based on distance), a Soliton isn't just a data payload; it is a strict enforcement of causality (a light cone).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Paradigm Shift&lt;/strong&gt;: In traditional programming, messages are effectively instantaneous pointers jumping across "memory". In this architecture, information has a "speed of light." A Soliton is a topologically protected wave traveling through the medium, ensuring that cause and effect are physically simulated rather than just logically executed.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Interactions resonate at depths (Continuous, Recursive Structure)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Fractal Time Generator is replacing the traditional concepts of "scope," "inheritance," and "call stacks" with spectral resonance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Paradigm Shift&lt;/strong&gt;: In a standard program, if an action requires broader context, it makes an API call or goes up a class hierarchy. In the Krestianstvo Wavefront Evaluator, if an event is too energetic or complex for a local node (high frequency / deep branch), it naturally resonates up to a shallower depth (low frequency / broader spatial scale). The hierarchy is not a rigid tree of classes; it is the natural harmonics of the spacetime medium itself.&lt;/p&gt;

&lt;p&gt;These three principles serve as a rigorous definition for Topological Event-Driven Computing, replace the traditional virtual machine with wavefront propagation. &lt;/p&gt;

&lt;p&gt;This shifts from "matrix grids" and "memory addresses" and firmly into the realm of a living, computational fluid. &lt;/p&gt;

&lt;p&gt;On cover photo generated Solitons are live on two different devices, without exchanging data.&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>programming</category>
      <category>mixedreality</category>
      <category>webdev</category>
    </item>
    <item>
      <title>This “cyberphysical engine” replaces the traditional virtual machine with wavefront propagation</title>
      <dc:creator>Nikolay Suslov</dc:creator>
      <pubDate>Wed, 20 May 2026 18:12:38 +0000</pubDate>
      <link>https://dev.to/nikolaysuslov/this-cyberphysical-engine-replaces-the-traditional-virtual-machine-with-wavefront-propagation-2deg</link>
      <guid>https://dev.to/nikolaysuslov/this-cyberphysical-engine-replaces-the-traditional-virtual-machine-with-wavefront-propagation-2deg</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3fy4x6t7969t011u8zzl.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3fy4x6t7969t011u8zzl.jpg" alt="Hologram" width="799" height="558"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Screenshot demonstrates the hologram resolution of 100 x 100, recording and restoring the object wireframe cube with 80 glowing dots on edges, with Fractal Time Generator.&lt;/p&gt;

&lt;h2&gt;
  
  
  Krestianstvo Wavefront Evaluator
&lt;/h2&gt;

&lt;p&gt;About: &lt;a href="https://dev.to/nikolaysuslov/krestianstvo-wavefront-evaluator-3j9f"&gt;https://dev.to/nikolaysuslov/krestianstvo-wavefront-evaluator-3j9f&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Live demo: &lt;a href="https://wavefront.krestianstvo.org" rel="noopener noreferrer"&gt;https://wavefront.krestianstvo.org&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Source code: &lt;a href="https://github.com/NikolaySuslov/krestianstvo-wavefront-evaluator" rel="noopener noreferrer"&gt;https://github.com/NikolaySuslov/krestianstvo-wavefront-evaluator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the News (20/05/2026)&lt;/p&gt;

&lt;h2&gt;
  
  
  This “cyberphysical engine” replaces the traditional virtual machine with wavefront propagation, achieving deterministic synchronization in just 11 lines of code.
&lt;/h2&gt;

&lt;p&gt;“The synchronization problem in distributed systems is usually treated as an engineering challenge. But the creators of Krestianstvo Wavefront Evaluator took a different approach: since information propagation in space follows physical laws, why not directly simulate physics?&lt;/p&gt;

&lt;p&gt;This system is essentially an “information physics engine.” It abandons the traditional “linear list” execution model in programming and instead adopts the laws of classical mechanics and wave propagation. The core algorithm is a software implementation of Huygens’ principle-in physics, every point on a wavefront is a source of a secondary spherical wave; in this evaluator, each node that receives a message becomes a “wave source” that can generate new messages (waves) for other nodes.&lt;/p&gt;

&lt;p&gt;Causality is guaranteed through a “light cone” structure. Each node maintains a local queue, and messages can only affect future states-either in the next macro cycle or a later micro cycle. Effects never occur before causes. This “discrete impulse + local settlement” model follows a principle: correctness takes precedence over speed.&lt;/p&gt;

&lt;p&gt;Architecturally, it replaces the Krestianstvo VM, employing entirely different methods for timing, computation, and inter-node communication. Causality is no longer routed through a central message scheduler, but rather propagates as a wavefront through a graph of local autonomous nodes.&lt;/p&gt;

&lt;p&gt;Even if 100 browser windows are opened, as long as the initial script (“laws of physics”) and snapshot (“initial energy”) are the same, they will eventually reach the same state (stability).&lt;/p&gt;

&lt;p&gt;This is equivalent to bringing lattice field theory into JavaScript objects. The system runs on a pure functional reactive programming (FRP) platform called Renkon, which inherits the synchronous application architecture of the Croquet VM, but replaces the original virtual machine core with a wavefront evaluator.&lt;/p&gt;

&lt;p&gt;The project offers an online demo and complete source code, and is open-source under the MIT license. For multiplayer distributed applications requiring deterministic synchronization-from collaboration tools to multiplayer games-this approach of translating physical intuition into a computational model may be closer to the essence of the problem than traditional message-passing architectures.”&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>distributedsystems</category>
      <category>showdev</category>
      <category>mixedreality</category>
    </item>
    <item>
      <title>Krestianstvo Wavefront Evaluator</title>
      <dc:creator>Nikolay Suslov</dc:creator>
      <pubDate>Thu, 14 May 2026 03:58:49 +0000</pubDate>
      <link>https://dev.to/nikolaysuslov/krestianstvo-wavefront-evaluator-3j9f</link>
      <guid>https://dev.to/nikolaysuslov/krestianstvo-wavefront-evaluator-3j9f</guid>
      <description>&lt;p&gt;&lt;em&gt;Architecture overview and core concepts&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;The Krestianstvo Wavefront Evaluator is a deterministic reactive collaborative computational engine for multiplayer, distributed applications built on top of &lt;a href="https://github.com/yoshikiohshima/renkon" rel="noopener noreferrer"&gt;Renkon&lt;/a&gt; and ideas of &lt;a href="https://github.com/NikolaySuslov/krestianstvo-renkon" rel="noopener noreferrer"&gt;Krestianstvo | Renkon&lt;/a&gt; implemented in pure FRP the &lt;a href="https://github.com/croquet/croquet" rel="noopener noreferrer"&gt;Croquet VM&lt;/a&gt; synchronisation applicaition architecture.&lt;/p&gt;

&lt;p&gt;It replaces the Krestianstvo VM with a fundamentally different approach to time, computation, and inter-node communication — one where causality propagates as a &lt;em&gt;wavefront&lt;/em&gt; through a graph of locally autonomous nodes, rather than being routed through a central message dispatcher.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Live demo: &lt;a href="https://wavefront.krestianstvo.org" rel="noopener noreferrer"&gt;https://wavefront.krestianstvo.org&lt;/a&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Source code: &lt;a href="https://github.com/NikolaySuslov/krestianstvo-wavefront-evaluator" rel="noopener noreferrer"&gt;https://github.com/NikolaySuslov/krestianstvo-wavefront-evaluator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl6lqb0ei3pcz92fwkrzh.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl6lqb0ei3pcz92fwkrzh.gif" alt="Wave 2D demo" width="480" height="256"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The Relation to Physics&lt;/li&gt;
&lt;li&gt;Fractal Heartbeat&lt;/li&gt;
&lt;li&gt;Fractal IFS-based clock&lt;/li&gt;
&lt;li&gt;From Virtual Machine to Wavefront Evaluator&lt;/li&gt;
&lt;li&gt;Core Vocabulary&lt;/li&gt;
&lt;li&gt;Architecture Layers&lt;/li&gt;
&lt;li&gt;Meta Program&lt;/li&gt;
&lt;li&gt;W - the Node Runtime&lt;/li&gt;
&lt;li&gt;Distributed Determinism Invariants&lt;/li&gt;
&lt;li&gt;Telemetry&lt;/li&gt;
&lt;li&gt;Feedback Loop&lt;/li&gt;
&lt;li&gt;Two Layer Time&lt;/li&gt;
&lt;li&gt;Key Architectural Decisions&lt;/li&gt;
&lt;li&gt;Simulation Speed Control&lt;/li&gt;
&lt;li&gt;Autonomous Mode&lt;/li&gt;
&lt;li&gt;Examples&lt;/li&gt;
&lt;li&gt;Develop &amp;amp; Run&lt;/li&gt;
&lt;li&gt;Related works&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introducation
&lt;/h2&gt;

&lt;p&gt;The Wavefront Evaluator isn’t just a clever way to sync avatars; it is deeply rooted in computational physics and hardware architecture. It mimics how information naturally propagates through space-time. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frsono3aijw0njan7vqbl.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frsono3aijw0njan7vqbl.gif" alt="Lorenz_clock" width="480" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Relation to Physics
&lt;/h3&gt;

&lt;p&gt;The Wavefront Evaluator is essentially a "physics engine for information". It replaces the "linear list" of standard programming with the laws of Classical Mechanics and Wave Propagation. The algorithm is essentially a software implementation of Huygens’ Principle applied to information. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Wavefront Propagation&lt;/strong&gt;: In physics, every point on a wavefront acts as a source of secondary waves. In evaluator, every Node that receives a message becomes a "source" that can generate new messages (waves) for other nodes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Causality and the "Light Cone"&lt;/strong&gt;: Each node has a local queue. A message can only affect a future state (either in the next macro-tick or a later micro-tick). This preserves Causality—the effect never happens before the cause.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This specific pattern—Discrete Pulses + Local Settlement follows the principle - "correctness" is more important than "speed."&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Concept&lt;/th&gt;
&lt;th&gt;Physics Equivalent&lt;/th&gt;
&lt;th&gt;Wavefront Implementation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Pulse&lt;/td&gt;
&lt;td&gt;Universal Time&lt;/td&gt;
&lt;td&gt;The Reflector Heartbeat&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Node Queue&lt;/td&gt;
&lt;td&gt;Local Particle State&lt;/td&gt;
&lt;td&gt;W.reduce local _Q&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Micro-tick&lt;/td&gt;
&lt;td&gt;Particle Interaction&lt;/td&gt;
&lt;td&gt;The "Drain" / Feedback loop&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stability&lt;/td&gt;
&lt;td&gt;Thermal Equilibrium&lt;/td&gt;
&lt;td&gt;When all queues are empty&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Even if you have 100 Web browser windows, as long as they all start with the same "Laws of Physics" (the scripts) and the same "Initial Energy" (the snapshot), they must arrive at the same "State" (Stability).  &lt;/p&gt;

&lt;p&gt;It’s essentially &lt;strong&gt;Lattice Field Theory&lt;/strong&gt; for JavaScript objects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Physics engine for information
&lt;/h3&gt;

&lt;p&gt;Here are the specific physics laws and mathematical formulas that serve as the "blueprints" for this algorithm:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Huygens’ Principle (Wave Propagation)
&lt;/h4&gt;

&lt;p&gt;The algorithm's name comes directly from the Huygens–Fresnel principle, which explains how waves move through a medium.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;In physics&lt;/strong&gt;: Every point on a wavefront acts as a point source of secondary spherical waves. The new wavefront is the "envelope" of all these secondary waves.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;In the algorithm&lt;/strong&gt;: Every Node in evaluator acts as a point source. When a pulse hits a node, that node "ripples" by sending messages to its neighbors. The "Stability" reached after the Drain phase is the new global wavefront.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  2. Special Relativity (The Light Cone)
&lt;/h4&gt;

&lt;p&gt;The external Reflector and the logical timestamps simulate the Finite Speed of Information &lt;strong&gt;C&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;In physics&lt;/strong&gt;: No information can travel faster than light. Events have a "Past Light Cone" (things that could have caused them) and a "Future Light Cone" (things they can influence).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;In the algorithm&lt;/strong&gt;: By using logicalTime, the evaluator enforces a "Speed Limit." A message sent at Tick 10 cannot affect Tick 9. This ensures Causality Preservation. Even if two peers are on opposite sides of the planet, the "Light Cone" of the Reflector ensures they see the same history.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  3. The Second Law of Thermodynamics (Entropy and Equilibrium)
&lt;/h4&gt;

&lt;p&gt;The "Drain" phase, where the Meta-program loops until all queues are empty, is a simulation of a physical system reaching Thermal Equilibrium.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;In physics&lt;/strong&gt;: A system will naturally move toward a state of maximum entropy or minimum potential energy (stability).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;In the algorithm&lt;/strong&gt;: The messages in the local queues are like "Potential Energy." As the nodes fire, they "dissipate" that energy. When all remaining queue entries are scheduled beyond the current tick boundary (&lt;code&gt;fireAt &amp;gt; wallTime&lt;/code&gt;), the system has reached Stability (Equilibrium) for this tick. The "Stable" flag is the signal that the system has settled into its lowest "energy" state — no ready work remains, no feedback loop is in progress, and no cross-node message is in-flight.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  4. Zeno’s Paradox &amp;amp; The Geometric Series (Sub-tick Futures)
&lt;/h4&gt;

&lt;p&gt;The Zeno Effect (Sub-tick Futures) mentions the "Zeno Series." This relates to Zeno’s Paradox in physics—the idea that to travel a distance, you must first travel half that distance, then half of that, and so on. By using micro-ticks (0.5, 0.25, 0.125), the evaluator simulates "infinite" interactions within a single discrete second, much like how physical forces settle into equilibrium almost instantly. This is a direct implementation of a mathematical limit used in physics to describe continuous motion.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;In physics&lt;/strong&gt;: The Sum of a Convergent Geometric Series.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;In the algorithm&lt;/strong&gt;: The evaluator uses this to pack "infinite" causality into a single discrete tick. By scheduling events at t+0.5, then t+0.75, the system "settles" toward the next whole integer (the next second) but executes all the reactive logic in between.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Summary: The "Law" of the Evaluator
&lt;/h4&gt;

&lt;p&gt;If you had to write a single "Formula" for the Wavefront Evaluator, it would look like this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;S(t+1) = (Stability (Drain (Pulse(t) + S(t))))&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;S&lt;/strong&gt; = State of the Universe.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pulse&lt;/strong&gt; = The "Energy" injected by the Reflector.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Drain&lt;/strong&gt; = The "Work" performed by the nodes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stability&lt;/strong&gt; = The "Lowest Energy State" (where the UI is rendered).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is why the system feels so "solid" — it isn't just following a list of instructions; it is simulating a stable physical environment where every action has a reaction, and everything eventually settles into place.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fractal Heartbeat and Local Reflector
&lt;/h3&gt;

&lt;p&gt;Local Reflector is recursive in its logic, and it can indeed trigger other reflectors or "nest" emulated ticks. Because the Wavefront Evaluator treats time as a continuous priority queue rather than a fixed set of slots, you can think of the local reflector as a "fractal" heartbeat.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fswuy8y8i4t23agg54evs.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fswuy8y8i4t23agg54evs.gif" alt="hb2" width="600" height="587"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Generating Fractal Heartbeats
&lt;/h4&gt;

&lt;p&gt;Fractal heartbeats form a vector space; they can be added together to yield an object of the same nature. This stands in contrast to harmonic oscillations of different frequences, the sum of which is not a harmonic oscillation.&lt;br&gt;&lt;br&gt;
Phase analysis is simplifying.&lt;/p&gt;

&lt;p&gt;Orthogonal (perpendicular in space-time) fractal heartbeats are generated through scaling, whereas orthogonal harmonic oscillations are non-homothetic (dissimilar), and each requires separate generation.   &lt;/p&gt;
&lt;h4&gt;
  
  
  How that recursive nesting works within the implementation:
&lt;/h4&gt;
&lt;h4&gt;
  
  
  1. Logical Recursion (The "Loop")
&lt;/h4&gt;

&lt;p&gt;The most basic form of recursion is a single node "ticking" itself. In the krestianstvo-wavefront-evaluator.js code, this is handled by a state-guarded feedback loop.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Step 1: A node receives a pulse and calls &lt;code&gt;ctx.localReflector("tick", 0.1)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Step 2: The Evaluator enqueues a future at &lt;code&gt;wallTime + 0.1&lt;/code&gt; carrying &lt;code&gt;{ _isLocalTick: true, _innerTickDelay: 0.1 }&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Step 3: When the drain loop reaches &lt;code&gt;wallTime + 0.1&lt;/code&gt;, the node receives the message named &lt;code&gt;"tick"&lt;/code&gt; (the first argument you passed — not a fixed &lt;code&gt;__local_tick&lt;/code&gt; name).&lt;/li&gt;
&lt;li&gt;Step 4: The node's handler calls &lt;code&gt;ctx.localReflector("tick", 0.1)&lt;/code&gt; again, re-enqueuing for the next step.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Is it truly recursive?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In Logic: Yes. Tick(n) to Tick(n+1).&lt;/li&gt;
&lt;li&gt;In Memory: No. The evaluator uses the Priority Queue to "flatten" this recursion. Instead of the function calling itself and growing the stack, it "yields" to the queue. The META_PROGRAM loop then picks it back up.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  2. Cascading Reflectors (The "Nesting")
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh02d3fltdao7xa3i9hd0.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh02d3fltdao7xa3i9hd0.gif" alt="Fractal Heartbeat demo" width="480" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can have multiple nodes, each running its own local reflector, and they can trigger each other. This creates a "Reflector within a Reflector" behavior.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node A (running at 0.1 intervals) calculates a physics state.&lt;/li&gt;
&lt;li&gt;At T+0.2, Node A sends a message to Node B.&lt;/li&gt;
&lt;li&gt;Node B receives that message and, as a result, starts its own local reflector running at 0.05 intervals to handle a high-speed sub-calculation (like an explosion or a particle effect).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this scenario, Node B’s "Local Reflector" is logically nested inside the timeline generated by Node A’s reflector. The Evaluator manages all these different frequencies perfectly because it simply sorts all resulting messages by their fireAt time.&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Creating "Emulated Ticks" for Sub-Reflectors
&lt;/h3&gt;

&lt;p&gt;The system allows you to create &lt;strong&gt;"Nested Time Scales"&lt;/strong&gt; using the Zeno sub-ticks.&lt;/p&gt;

&lt;p&gt;If you want a "Local Reflector" to emulate a whole second's worth of logic inside a single sub-tick, you use Temporal Compression:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Global Reflector is at T=100.&lt;/li&gt;
&lt;li&gt;Node uses W.future(0.001, msg) to run a local loop.3. Each loop only advances the internal state, while the logical time only moves by 0.001.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;This allows you to run a "Virtual World" inside a single tick of the "Real World."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  4. The "Stability" Safety Valve
&lt;/h4&gt;

&lt;p&gt;The main risk with recursive reflectors is an &lt;strong&gt;"Infinite Loop"&lt;/strong&gt; that freezes the browser. The evaluator has a built-in safety mechanism: &lt;strong&gt;The Integer Boundary&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Even if your recursive reflectors create 1,000,000 sub-ticks, the Evaluator will only process them as long as they are less than the next integer tick.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If a recursive call accidentally schedules a message for T+1.1, the Evaluator stops and waits for the next real pulse from the external Reflector to "authorize" that time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This prevents a "Local Paradox" where one node lives in the year 2030 while the rest of the peers are in 2026.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  5. Summary: Local reflector with a flat structure
&lt;/h4&gt;

&lt;p&gt;Think of it like this: You can't create a &lt;strong&gt;"Reflector inside a Reflector"&lt;/strong&gt; in terms of code structure, but you can create a &lt;strong&gt;"Wavefront that triggers another Wavefront."&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Because every message in the Evaluator is just a &lt;strong&gt;(time, target, data)&lt;/strong&gt; tuple, the system doesn't care if a message came from a real human, a global heartbeat, or a recursive local sub-tick. It treats them all as equal "waves" moving through the graph.&lt;/p&gt;
&lt;h2&gt;
  
  
  Fractal IFS-based clock
&lt;/h2&gt;

&lt;p&gt;The Fractal Heartbeat has been generalised into &lt;strong&gt;&lt;code&gt;makeIfsClock&lt;/code&gt;&lt;/strong&gt; — a deterministic, multiplayer-synchronised fractal cascade that alters the fundamental relationship between time and chaotic flows, suited for non-uniform, fractal time-reparametrisation of any continuous dynamical system. This is a highly suitable for investigating chaotic systems, establishing a canvas where time is no longer a linear axis, but a self-similar fractal landscape. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl5d1ek5rs0bmfh3qpk20.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl5d1ek5rs0bmfh3qpk20.jpg" alt="ifs" width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In standard physics, to see the inner core of a Lorenz lobe one simply has to wait a long time for a uniform clock to eventually pass through it. In the Krestianstvo Wavefront Evaluator, space and time are coupled through the fractal depth: the system enters the deep structure of the attractor precisely because it enters the deep structure of the clock.&lt;/p&gt;
&lt;h3&gt;
  
  
  Implementation: makeIfsClock
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;makeIfsClock&lt;/code&gt; is a stochastic Iterated Function System (IFS) running deterministically inside a discrete-event priority queue. It is a composable primitive — callers supply &lt;code&gt;onCycle&lt;/code&gt; and &lt;code&gt;onBeat&lt;/code&gt; callbacks to plug in any ODE or dynamical system, while all clock mechanics are handled internally.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multiplayer determinism.&lt;/strong&gt; A classic problem with randomised IFS cascades in distributed environments is state divergence. This is solved by reseeding &lt;code&gt;W.rng&lt;/code&gt; at the start of every cycle using a bijective MurmurHash3 finalizer on the logical time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cycleCount&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;logicalTime&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;imul&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;h&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;h&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mh"&gt;0x85ebca6b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;imul&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;h&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;h&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mh"&gt;0xc2b2ae35&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;h&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;h&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rng&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;seed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;h&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unconditionally consuming exactly two RNG values per beat (&lt;code&gt;selfRatio&lt;/code&gt; and &lt;code&gt;childRatio&lt;/code&gt;) guarantees that every peer follows the identical randomised execution branch, satisfying strict state-replication requirements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cascade mechanics.&lt;/strong&gt; The tree branching logic splits generation into controlled sequences:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;gen &amp;lt; genCap&lt;/code&gt; schedules self-loops at the current depth, scaled by a random contraction ratio &lt;code&gt;selfRatio&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;gen === 0 &amp;amp;&amp;amp; depth + 1 &amp;lt; depth&lt;/code&gt; spawns a child branch into the next nested layer at temporal offset &lt;code&gt;selfDelay + childDelay&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This prevents exponential event explosion while ensuring every tier of the fractal cascade is systematically visited.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Irrational base and contraction ratios.&lt;/strong&gt; No finite integer product of the contraction ratios can equal an integer multiple of the base delay. This guarantees that scheduled event times (&lt;code&gt;ctx.future(delay, ...)&lt;/code&gt;) are dense and do not collapse onto a periodic lattice. The time increments are truly fractal-distributed, yielding a discrete point process whose temporal structure mirrors the Hausdorff measure of the underlying IFS attractor.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multi-resolution time
&lt;/h3&gt;

&lt;p&gt;The wavefront engine with nested &lt;code&gt;ctx.future&lt;/code&gt; ticks is not discrete-time in the classical sense. It is a multi-resolution time where ticks exist at every scale simultaneously:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;coarse:  t = 0,    4.28,  6.47,  7.61...    (D0 beats)
medium:  t = 2.14, 3.47,  4.82,  5.63...    (D1 beats)
fine:    t = 1.32, 2.06,  2.57,  3.02...    (D2 beats)
finer:   ...                                 (D3, D4)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All these ticks coexist on the same continuous time axis — they interleave rather than separate into levels. The system has events at arbitrarily fine temporal resolution, bounded only by &lt;code&gt;FRACTAL_MIN_DELAY&lt;/code&gt;. This is structurally similar to a wavelet decomposition — multi-scale analysis where coarse and fine scales coexist — or to a Cantor function clock that runs at fractal density on the time axis.&lt;/p&gt;

&lt;h3&gt;
  
  
  Modulating the SRB Measure
&lt;/h3&gt;

&lt;p&gt;In a traditional system, a chaotic ODE like Lorenz or Rössler flows through phase space in uniform continuous time. According to the ergodic theorem, a single long trajectory samples the strange attractor according to its natural SRB (Sinai-Ruelle-Bowen) measure — the probability density of the trajectory's position over uniform intervals of time &lt;code&gt;dt&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;By driving the integration step from the fractal delay (&lt;code&gt;dt = delay * SCALE / STEPS&lt;/code&gt;) via the &lt;code&gt;onBeat&lt;/code&gt; hook, the sampling density on the attractor is no longer uniform. Because the density of IFS clock ticks is governed by the IFS invariant measure, the point cloud captured in &lt;code&gt;tickEvents&lt;/code&gt; is a convolution of two distinct measures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Geometry of the Flow&lt;/strong&gt; — the spatial constraints of the classical attractor (the SRB measure).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Chronology of the Clock&lt;/strong&gt; — the temporal constraints of the contraction mapping (the IFS Hausdorff measure).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The resulting object is a trajectory tracing a classical attractor embedded in a non-Archimedean, fractal temporal topology — a state distribution that cannot be replicated by any standard uniform numerical solver.&lt;/p&gt;

&lt;h3&gt;
  
  
  The three-layer insight
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Layer 1 — What standard visualization does.&lt;/strong&gt;&lt;br&gt;
A single trajectory with fixed &lt;code&gt;dt&lt;/code&gt; steps through the ODE at one resolution. Every point is equally spaced in ODE time. Ergodic coverage is eventual but uniform — no sense of which regions are visited more often at different scales.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layer 2 — What fractal time adds.&lt;/strong&gt;&lt;br&gt;
The IFS heartbeat generates beats at multiple delay scales simultaneously within one cycle:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Depth&lt;/th&gt;
&lt;th&gt;Delay&lt;/th&gt;
&lt;th&gt;dt_ODE&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;D0&lt;/td&gt;
&lt;td&gt;≈ 2.14t&lt;/td&gt;
&lt;td&gt;≈ 1.07 (coarse)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D1&lt;/td&gt;
&lt;td&gt;≈ 0.88t&lt;/td&gt;
&lt;td&gt;≈ 0.44&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D2&lt;/td&gt;
&lt;td&gt;≈ 0.36t&lt;/td&gt;
&lt;td&gt;≈ 0.18&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D3&lt;/td&gt;
&lt;td&gt;≈ 0.15t&lt;/td&gt;
&lt;td&gt;≈ 0.075&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D4&lt;/td&gt;
&lt;td&gt;≈ 0.06t&lt;/td&gt;
&lt;td&gt;≈ 0.03 (fine)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Each depth integrates the same trajectory continuation but samples it at a different temporal grain. The coarse levels skip over fast oscillations; the fine levels resolve them. The attractor is being measured simultaneously with five rulers of different lengths.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layer 3 — What the IFS random map selection does on top.&lt;/strong&gt;&lt;br&gt;
At each beat, &lt;code&gt;selfRatio&lt;/code&gt; is drawn randomly from &lt;code&gt;[√2-1, 1/φ, √3-1]&lt;/code&gt;. The next self-loop delay contracts by a randomly chosen irrational ratio. The set of all possible delay sequences forms an IFS in delay-space whose invariant set is the Cantor-like attractor visible in the IFS canvas.&lt;/p&gt;

&lt;p&gt;The sampling density on the Lorenz attractor is therefore not uniform — it is weighted by the invariant measure of the IFS in delay-space. The two attractors — one in (X,Z) space, one in delay-space — are coupled through the shared trajectory.&lt;/p&gt;
&lt;h3&gt;
  
  
  Fractal magnifying lens
&lt;/h3&gt;

&lt;p&gt;A standard ergodic theorem says a single long trajectory samples the attractor according to its natural measure (the SRB measure). Here the sampling measure on the Lorenz attractor is &lt;strong&gt;modulated by the IFS invariant measure in time&lt;/strong&gt;. The system is not just tracing the attractor — it is tracing it with a fractal magnifying glass that zooms in and out at irrational ratios, producing a point cloud whose density reflects both the Lorenz SRB measure and the IFS Hausdorff measure simultaneously.&lt;/p&gt;

&lt;p&gt;That is what the colour-coded depth layers reveal visually:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;D0 (red/orange)&lt;/strong&gt; — coarse time steps, broad skeletal structure of the butterfly lobes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;D4 (grey/white)&lt;/strong&gt; — fine time steps, intricate spiral structures inside each lobe.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The butterfly is not one attractor but &lt;strong&gt;five nested samplings of the same attractor at five fractal time scales&lt;/strong&gt;. You are looking at five simultaneous geometric windows into how the chaotic flow resolves at different scales of temporal magnification.&lt;/p&gt;
&lt;h3&gt;
  
  
  Parallel ensemble and multi-peer mapping
&lt;/h3&gt;

&lt;p&gt;Each cycle launches an independent trajectory with slightly different initial conditions (seeded from RNG). The IFS randomly selects integration step sizes from the map set. Each trajectory traces the attractor independently — this is the ensemble approach.&lt;/p&gt;

&lt;p&gt;The accumulated point cloud shows the ensemble density — where all trajectories spend their time. For a true strange attractor this density is the SRB measure — the physically observable invariant measure of the chaotic system.&lt;/p&gt;

&lt;p&gt;This maps directly to the multi-peer architecture: &lt;strong&gt;different peers literally run different ensemble members&lt;/strong&gt;. The collective visualisation is the ergodic average across the ensemble.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No numerical stability problem — each trajectory is self-consistent.&lt;/li&gt;
&lt;li&gt;Naturally multi-peer — peers run different ensemble members.&lt;/li&gt;
&lt;li&gt;The visualisation density is exactly the SRB measure — what physicists want from a strange attractor.&lt;/li&gt;
&lt;li&gt;It proves the wavefront engine can explore measure-theoretic properties of dynamical systems, not just trajectories.&lt;/li&gt;
&lt;li&gt;Various forms of self-similar Fractal Time can be generated follwing the objectives of the dynamic system under investigation. This approach can be utilized in physiology to study heart rhythms, the nervous system and other homeostatic processes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  From Virtual Machine to Wavefront Evaluator
&lt;/h2&gt;

&lt;p&gt;The table below captures the essential shift in each architectural dimension.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dimension&lt;/th&gt;
&lt;th&gt;Krestianstvo VM&lt;/th&gt;
&lt;th&gt;Krestianstvo Wavefront Evaluator&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Message queue&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Centralised — one shared queue per world, all messages pass through it&lt;/td&gt;
&lt;td&gt;Decentralised — each node owns its own local queue of futures&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Time authority&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;VM clock drives all nodes uniformly&lt;/td&gt;
&lt;td&gt;Two-layer time: shared logical pulse + local micro-tick settlement&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Causality&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Enforced by queue ordering at the VM level&lt;/td&gt;
&lt;td&gt;Emerges from wavefront propagation across node dependencies&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Sub-step execution&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Async, RAF-driven&lt;/td&gt;
&lt;td&gt;Synchronous drain loop — sub-ticks are fractions of a logical tick&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Late-join / desync recovery&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Manual snapshot and replay&lt;/td&gt;
&lt;td&gt;Warp mechanism — local clock-advance to catch up before advancing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Node communication&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;VM routes messages between nodes centrally&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;ctx.send()&lt;/code&gt; writes to a per-world outbox; nodes pull inbound on next evaluate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Stability detection&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;VM-level flag&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;W.stable()&lt;/code&gt; checked after each evaluate call; user defines the condition&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Introspection&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Opaque&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;_telemetry&lt;/code&gt; captures per-evaluate snapshots across all nodes generically&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Autonomous operation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Requires reflector&lt;/td&gt;
&lt;td&gt;Local fallback clock via &lt;code&gt;makeMeta.startAutonomous()&lt;/code&gt; + &lt;code&gt;W.localReflector&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Sub-tick scheduling&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Not supported&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;future(delay &amp;lt; SUBTICK_MS)&lt;/code&gt; drains within current tick&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The central insight of the shift: in the VM architecture the queue &lt;em&gt;was&lt;/em&gt; the synchronisation mechanism. In the Wavefront Evaluator, the queue is a local implementation detail of each node — synchronisation is achieved instead through shared logical time and deterministic local computation.&lt;/p&gt;


&lt;h2&gt;
  
  
  Core vocabulary
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Pure Logical Time
&lt;/h3&gt;

&lt;p&gt;All time is &lt;strong&gt;logical&lt;/strong&gt; — no &lt;code&gt;Date.now()&lt;/code&gt;, no wall-clock dependency in the model.&lt;/p&gt;

&lt;p&gt;The reflector stamps each pulse with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;logicalTime = lt        (tick counter, increments by 1 per pulse)
wallTime    = lt        (pure tick count — 1 logical unit per tick)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;REFLECTOR_MS = 50&lt;/code&gt; is only the real-time heartbeat rate. World programs never see it. Two peers on different machines receive identical &lt;code&gt;{ logicalTime, wallTime }&lt;/code&gt; and produce identical state regardless of real-time jitter, browser lag, or GC pauses.&lt;/p&gt;

&lt;h3&gt;
  
  
  Future Scheduling
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;ctx.future(delay, msg, payload)&lt;/code&gt; schedules &lt;code&gt;msg&lt;/code&gt; when &lt;code&gt;wallTime &amp;gt;= currentWallTime + delay&lt;/code&gt;. Since &lt;code&gt;wallTime = lt&lt;/code&gt;, delays are in &lt;strong&gt;logical ticks&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;future(1)     → next reflector tick
future(0.5)   → sub-tick: fires within current tick's drain pass
future(0.001) → sub-tick: fires immediately in drain
future(60)    → 60 ticks from now
future(80)    → 80 ticks from now
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The drain boundary is &lt;code&gt;SUBTICK_MS = 1&lt;/code&gt;. Any future with &lt;code&gt;delay &amp;lt; 1&lt;/code&gt; is a sub-tick.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pulse
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;pulse&lt;/strong&gt; is the fundamental unit of shared time. It is produced by the external Reflector at regular intervals and delivered to all peers. Every pulse carries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;logicalTime&lt;/code&gt; — a monotonically increasing integer, identical for all peers&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;wallTime&lt;/code&gt; — equal to &lt;code&gt;logicalTime&lt;/code&gt; (pure tick count, no real-time involvement)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The pulse content is frozen and identical on all peers. &lt;code&gt;REFLECTOR_MS&lt;/code&gt; is only the  real-time heartbeat rate — world programs never see it. This is the foundation of determinism.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wave
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;wave&lt;/strong&gt; is the complete lifecycle of computation triggered by a single logical pulse. A wave begins when a pulse arrives at a world, propagates through the node graph as each node processes its ready queue entries and schedules futures, and ends when the world reaches &lt;em&gt;stability&lt;/em&gt;. A wave has an identifier (&lt;code&gt;logicalTime&lt;/code&gt;) and a completion status (&lt;code&gt;success&lt;/code&gt;, &lt;code&gt;process&lt;/code&gt;, &lt;code&gt;fail&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Each peer runs its own wave independently. Because inputs are identical, waves on different peers converge to the same final state — they are the same wave, computed locally.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wavefront
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;wavefront&lt;/strong&gt; is the propagating boundary of settled computation within a wave. As each node processes its ready entries and emits futures, the frontier of "what has been computed" advances through the graph. The wavefront evaluator's job is to keep driving this frontier forward — via sub-tick iterations — until no node has any pending entry at or before the current &lt;code&gt;wallTime&lt;/code&gt;. At that point the wave is stable. The wavefront is &lt;em&gt;local&lt;/em&gt; — no cross-peer coordination required. Each peer's wavefront advances independently, reaching stability at the same logical result because the inputs were identical.&lt;/p&gt;

&lt;h3&gt;
  
  
  Phase
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;phase&lt;/strong&gt; is one stage within a wave. The current implementation has two named phases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Macro phase&lt;/strong&gt; — triggered by the arrival of a new shared pulse. Every node receives the &lt;code&gt;__macro&lt;/code&gt; message once per &lt;code&gt;logicalTime&lt;/code&gt; (guaranteed by &lt;code&gt;W.reduce&lt;/code&gt;'s &lt;code&gt;_lt&lt;/code&gt; guard). Nodes respond to the new logical time — either scheduling new work (total &lt;code&gt;__macro&lt;/code&gt;) or returning unchanged if nothing relevant changed (incremental &lt;code&gt;__macro&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Micro phase&lt;/strong&gt; (sub-tick) — one or more local iterations that settle inter-node dependencies and drain queued futures. The micro phase is invisible to the outside world; only the final settled state is observable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A wave is &lt;code&gt;stable&lt;/code&gt; when its micro phase has fully drained — all pending futures have &lt;code&gt;fireAt &amp;gt; wallTime&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Warp
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Warp&lt;/strong&gt; handles the case where a new shared pulse arrives with &lt;code&gt;logicalTime &amp;gt; lastLT + 1&lt;/code&gt; — the peer missed one or more pulses. The evaluator synthetically advances &lt;code&gt;wallTime&lt;/code&gt; through the remaining queue entries until stable, then proceeds to the new pulse.&lt;/p&gt;

&lt;p&gt;Three conditions must all hold before warp fires: &lt;code&gt;pulse.logicalTime &amp;gt; lastLT + 1&lt;/code&gt; (gap detected), &lt;code&gt;lastLT &amp;gt; 0&lt;/code&gt; (not the very first pulse), and &lt;code&gt;!world.isStable&lt;/code&gt; (the previous tick did not fully settle). If the world already reached stability before the gap was noticed, warp is skipped.&lt;/p&gt;

&lt;p&gt;Warp does &lt;strong&gt;not&lt;/strong&gt; fire on normal sequential pulses (&lt;code&gt;LT+1&lt;/code&gt;). With pure logical time, a world may legitimately have pending futures when the next pulse arrives — those drain normally. Only genuine missed pulses trigger warp.&lt;/p&gt;

&lt;p&gt;Warp preserves determinism because the synthetic &lt;code&gt;wallTime&lt;/code&gt; values injected during the loop are derived from the node queue's own &lt;code&gt;fireAt&lt;/code&gt; entries — the same values that the heartbeat would have delivered in real time, in the same order. Both peers warp through the same sequence and reach the same state.&lt;/p&gt;

&lt;h3&gt;
  
  
  Drain
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Drain&lt;/strong&gt; exhausts all ready queue entries within a micro phase. Stop condition: &lt;code&gt;_worldNextAt(world) &amp;gt;= wallTime + SUBTICK_MS&lt;/code&gt; — where &lt;code&gt;_worldNextAt&lt;/code&gt; is the minimum &lt;code&gt;_nextAt&lt;/code&gt; across all node states. When that minimum is beyond the current tick boundary, no node has any ready work. Queues may still contain entries — they are simply all future-dated. After the drain, an outbox flush runs an extra evaluate only if the outbox is non-empty, delivering any pending &lt;code&gt;ctx.send()&lt;/code&gt; messages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stability
&lt;/h3&gt;

&lt;p&gt;A world is &lt;strong&gt;stable&lt;/strong&gt; when three conditions all hold:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;All node queues contain only entries with &lt;code&gt;fireAt &amp;gt; wallTime&lt;/code&gt; (no ready work remaining)&lt;/li&gt;
&lt;li&gt;No node is mid-feedback-loop (&lt;code&gt;_depth === 0&lt;/code&gt; on all nodes)&lt;/li&gt;
&lt;li&gt;The shared outbox is empty — no &lt;code&gt;ctx.send()&lt;/code&gt; message is pending delivery&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All three conditions are checked together inside &lt;code&gt;W.stable()&lt;/code&gt; — the outbox check is not a separate step. Condition 3 guards against a subtle timing issue: a &lt;code&gt;ctx.send()&lt;/code&gt; written by one node during an evaluate pass lands in the outbox, not a queue — so the queue check alone would miss it. Without the outbox check, the drain loop exits while a message is in-flight, the receiving node never processes it, and the wave terminates prematurely. The application's own semantic completion condition (e.g. &lt;code&gt;stepsDone &amp;gt;= stepsTarget&lt;/code&gt;) is defined by the user in &lt;code&gt;WORLD_PROGRAM&lt;/code&gt; and combined with &lt;code&gt;W.stable()&lt;/code&gt; in the &lt;code&gt;_isStable&lt;/code&gt; expression.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reflector
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;Reflector&lt;/strong&gt; is the Krestianstvo - equivalent, that stamps and broadcasts pulses. It is the sole source of &lt;code&gt;wallTime&lt;/code&gt; — no world ever calls &lt;code&gt;Date.now()&lt;/code&gt; internally. This ensures that "now" is the same for all peers regardless of their real-time clock drift.&lt;/p&gt;




&lt;h2&gt;
  
  
  Architecture layers
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────────────────────────────────────────────────────┐
│  Reflector                                          │
│  Stamps pulse once. Delivers to all peers.          │
└────────────────────┬────────────────────────────────┘
                     │ pulse { lt, wallTime=lt }
┌────────────────────▼────────────────────────────────┐
│  Meta Program                                       │
│  Orchestrates worlds. Drives the wavefront.         │
│  Warp · Drain · Stability check · UI sync           |
|  startAutonomous() — local fallback clock           │
└────────────────────┬────────────────────────────────┘
                     │ registerEvent / evaluate
┌────────────────────▼────────────────────────────────┐
│  World (ProgramState)                               │
│  Hosts W nodes: Behaviors.collect + W.reduce        | 
|        the reactive node graph.                     │
│  Each node: W.reduce → local queue → futures        │
└────────────────────┬────────────────────────────────┘
                     │ handler(state, payload, ctx)
┌────────────────────▼────────────────────────────────┐
│  W.reduce(state, pulse, nodeId, handlers)           │
│  ctx: future · send · feedback · futureInf          │
│       localReflector                                │
└────────────────────┬────────────────────────────────┘
                     │ W.export → isStable, logicalTime
┌────────────────────▼────────────────────────────────┐
│  Host layer                                         │
│  _worldNextAt · _worldSnapshot · _uiRefresh         │
└─────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Meta Program
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;META_PROGRAM&lt;/code&gt; is a Renkon program that runs &lt;em&gt;above&lt;/em&gt; the world programs. It receives pulses from the Reflector via a queued receiver (&lt;code&gt;Events.receiver({queued: true})&lt;/code&gt;), processes each pulse in order (backpressure-safe), and drives the wavefront for each registered world by calling &lt;code&gt;worldps.registerEvent&lt;/code&gt; and &lt;code&gt;worldps.evaluate()&lt;/code&gt; in a controlled loop.&lt;/p&gt;

&lt;p&gt;For each pulse × world, in order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;WARP&lt;/strong&gt; — fires only when &lt;code&gt;isNewPulse &amp;amp;&amp;amp; lastLT &amp;gt; 0 &amp;amp;&amp;amp; !world.isStable &amp;amp;&amp;amp; pulse.logicalTime &amp;gt; lastLT + 1&lt;/code&gt; (new pulse arrived, peer missed ticks, and prior tick didn't settle). Calls &lt;code&gt;registerEvent&lt;/code&gt; + &lt;code&gt;evaluate()&lt;/code&gt; in a loop using &lt;code&gt;_worldNextAt&lt;/code&gt; as the advancing &lt;code&gt;wallTime&lt;/code&gt;, with &lt;code&gt;isSubTick: true&lt;/code&gt;. Safety cap: 1000 iterations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MACRO&lt;/strong&gt; — fires on every new pulse (&lt;code&gt;isNewPulse || lastLT === 0&lt;/code&gt;). Increments &lt;code&gt;_currentEvalGen&lt;/code&gt;, calls &lt;code&gt;registerEvent(pulse)&lt;/code&gt; + &lt;code&gt;evaluate()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DRAIN&lt;/strong&gt; — immediately after macro, loops while &lt;code&gt;!world.isStable &amp;amp;&amp;amp; _worldNextAt(world) &amp;lt; wallTime + SUBTICK_MS&lt;/code&gt;. Each iteration increments &lt;code&gt;_currentEvalGen&lt;/code&gt;, calls &lt;code&gt;registerEvent&lt;/code&gt; with advancing &lt;code&gt;wallTime&lt;/code&gt; and &lt;code&gt;isSubTick: true&lt;/code&gt;. Safety cap: 10000 iterations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Outbox flush&lt;/strong&gt; — one extra evaluate, only if &lt;code&gt;world._outbox&lt;/code&gt; is non-empty after drain. Uses &lt;code&gt;isSubTick: true&lt;/code&gt; at current &lt;code&gt;wallTime&lt;/code&gt; (no &lt;code&gt;wallTime&lt;/code&gt; advance). Delivers pending &lt;code&gt;ctx.send()&lt;/code&gt; messages before stability is checked.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;META_PROGRAM never knows the names of nodes inside a world. All world-level introspection goes through generic host helpers (&lt;code&gt;_worldNextAt&lt;/code&gt;, &lt;code&gt;_worldSnapshot&lt;/code&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  W — the node runtime
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;W&lt;/code&gt; is the functional core of each node. Its &lt;code&gt;reduce&lt;/code&gt; function takes &lt;code&gt;(state, pulse, nodeId, handlers)&lt;/code&gt; and returns a new state. On each call it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Restore check&lt;/strong&gt; — if &lt;code&gt;pulse._restoreState[nodeId]&lt;/code&gt; exists, return it immediately (snapshot replay, bypasses all normal logic).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inbound outbox&lt;/strong&gt; — collects messages from &lt;code&gt;appRef._outbox[nodeId]&lt;/code&gt; where &lt;code&gt;_evalGen &amp;lt; _currentEvalGen&lt;/code&gt; (previous evalGen only). Consumed entries are removed from the outbox; remaining same-gen entries stay. This prevents a node from consuming a &lt;code&gt;ctx.send()&lt;/code&gt; written in the same evaluate pass.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Queue split&lt;/strong&gt; — splits &lt;code&gt;state._queue&lt;/code&gt; into &lt;code&gt;ready&lt;/code&gt; (fireAt ≤ wallTime) and &lt;code&gt;later&lt;/code&gt; (fireAt &amp;gt; wallTime). Merges &lt;code&gt;inbound&lt;/code&gt; + &lt;code&gt;ownReady&lt;/code&gt; into &lt;code&gt;allReady&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;__macro&lt;/code&gt; injection&lt;/strong&gt; — if &lt;code&gt;!isSubTick &amp;amp;&amp;amp; (state._lt ?? -1) !== logicalTime&lt;/code&gt;, prepends &lt;code&gt;{msg: "__macro", payload: pulse, _depth: 0}&lt;/code&gt; to &lt;code&gt;allReady&lt;/code&gt;. Skipped on sub-tick evaluates and if &lt;code&gt;_lt&lt;/code&gt; already equals &lt;code&gt;logicalTime&lt;/code&gt; (warp-replay guard). &lt;code&gt;_lt&lt;/code&gt; is updated to &lt;code&gt;logicalTime&lt;/code&gt; on macro pulses; preserved as-is on sub-tick pulses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Handler dispatch&lt;/strong&gt; — iterates &lt;code&gt;allReady&lt;/code&gt;, calls &lt;code&gt;handlers[entry.msg](userState, entry.payload, ctx)&lt;/code&gt;. Unknown messages are silently skipped. &lt;code&gt;ctx.depth&lt;/code&gt; equals the entry's &lt;code&gt;_depth&lt;/code&gt;. Tracks &lt;code&gt;maxDepthSeen&lt;/code&gt; across all entries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Effect collection&lt;/strong&gt; — &lt;code&gt;ctx.future&lt;/code&gt; pushes &lt;code&gt;{kind:"future", fireAt: wallTime+delay, ...}&lt;/code&gt;. &lt;code&gt;ctx.send&lt;/code&gt; pushes to &lt;code&gt;appRef._outbox[targetId]&lt;/code&gt; stamped with &lt;code&gt;_currentEvalGen&lt;/code&gt;. &lt;code&gt;ctx.feedback&lt;/code&gt; pushes a future at &lt;code&gt;wallTime + _fbStepMs&lt;/code&gt; with &lt;code&gt;_depth + 1&lt;/code&gt;, silently no-ops if &lt;code&gt;entryDepth &amp;gt;= maxDepth&lt;/code&gt;. &lt;code&gt;ctx.futureInf&lt;/code&gt; pushes &lt;code&gt;fireAt: wallTime&lt;/code&gt;. &lt;code&gt;ctx.localReflector&lt;/code&gt; pushes &lt;code&gt;fireAt: wallTime + innerTickDelay&lt;/code&gt; with &lt;code&gt;{_isLocalTick: true, _innerTickDelay, ...extraPayload}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Returns&lt;/strong&gt; &lt;code&gt;{ ...userState, _queue: newQueue, _nextAt: _Q.nextAt(newQueue), _depth: maxDepthSeen, _lt }&lt;/code&gt; — infrastructure fields stripped by &lt;code&gt;W.getState&lt;/code&gt; before the view layer sees them.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;_nextAt&lt;/code&gt; — the timestamp of the next pending entry — is the signal that &lt;code&gt;_worldNextAt&lt;/code&gt; reads to drive the drain loop. It is written on every &lt;code&gt;reduce&lt;/code&gt; call without any node-name coupling.&lt;/p&gt;

&lt;p&gt;Outbox entries are stamped with &lt;code&gt;_evalGen&lt;/code&gt; (the evaluation generation at write time). When a node reads its inbound messages it only consumes entries from a &lt;strong&gt;previous&lt;/strong&gt; evalGen — entries written in the current evaluate pass are filtered out and discarded from the outbox. This means &lt;code&gt;ctx.send()&lt;/code&gt; messages written in evaluate pass N are consumed in pass N+1 (the next &lt;code&gt;evaluate()&lt;/code&gt; call or drain iteration), ensuring that a message written by node A is available to node B on the next pass rather than the same one.&lt;/p&gt;

&lt;p&gt;Each &lt;code&gt;Behaviors.collect&lt;/code&gt; wraps one W node:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Behaviors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;collect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;started&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="nx"&gt;reflector&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pulse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pulse&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;counter&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;__macro&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;   &lt;span class="c1"&gt;// fires once per logicalTime&lt;/span&gt;
    &lt;span class="na"&gt;newCycle&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;  &lt;span class="c1"&gt;// fires when future arrives&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;__macro&lt;/code&gt; fires on every new &lt;code&gt;logicalTime&lt;/code&gt; (guarded by &lt;code&gt;_lt&lt;/code&gt; field internally). Use a &lt;code&gt;started: true&lt;/code&gt; flag in the returned state to fire only once.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stability
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;W.stable(nodes, pulse)&lt;/code&gt; returns &lt;code&gt;true&lt;/code&gt; when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;appRef._outbox&lt;/code&gt; is empty (no pending &lt;code&gt;ctx.send()&lt;/code&gt; messages)&lt;/li&gt;
&lt;li&gt;every node's &lt;code&gt;_queue&lt;/code&gt; has all entries with &lt;code&gt;fireAt &amp;gt; wallTime&lt;/code&gt; (strictly future — nothing ready to fire)&lt;/li&gt;
&lt;li&gt;every node's &lt;code&gt;_depth === 0&lt;/code&gt; (no in-progress feedback loop)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;nodes&lt;/code&gt; may contain nested arrays — &lt;code&gt;W.stable&lt;/code&gt; flattens them. A &lt;code&gt;null&lt;/code&gt; node is treated as stable. World programs export &lt;code&gt;_isStable = W.stable([...nodes], reflector)&lt;/code&gt; which META_PROGRAM reads via &lt;code&gt;world.isStable&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  ctx Primitives
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Primitive&lt;/th&gt;
&lt;th&gt;Semantics&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ctx.future(delay, msg, payload)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Schedule &lt;code&gt;msg&lt;/code&gt; after &lt;code&gt;delay&lt;/code&gt; logical ticks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ctx.send(nodeId, msg, payload)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Cross-node message via evalGen-gated outbox&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ctx.feedback(msg, payload, maxDepth)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Depth-tracked future at &lt;code&gt;wallTime + _fbStepMs&lt;/code&gt; (convergence loops)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ctx.futureInf(msg, payload)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;fireAt = wallTime&lt;/code&gt; — re-enqueues every drain pass (bounded by the drain loop's 10000-iteration safety cap)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ctx.localReflector(tickMsg, delay, payload)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sub-tick self-hosting clock step, with optional user payload&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  ctx.future — payload and idempotency guards
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;payload&lt;/code&gt; is any plain serialisable value (scalar, array, or object). The handler receives it as the second argument &lt;code&gt;p&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;future&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;delay&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;beat&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;depth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nl"&gt;beat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// stale — ignore&lt;/span&gt;
  &lt;span class="c1"&gt;// p.depth, p.cycleId available here&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why pass &lt;code&gt;cycleId&lt;/code&gt; (or equivalent) in the payload?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Sub-tick futures fire asynchronously within the drain loop. If a new macro pulse arrives and resets the cycle before an earlier future fires, the handler will see both the old and new futures in sequence. Without a guard, the stale future corrupts state. The pattern is: stamp the current cycle identity into every payload, and silently drop any future whose &lt;code&gt;cycleId&lt;/code&gt; no longer matches &lt;code&gt;s.cycleId&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This is essential in cascading or recursive future chains — such as the &lt;strong&gt;Fractal Heartbeat&lt;/strong&gt;, where each depth schedules the next:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ECG / Fractal Heartbeat — depth cascade via ctx.future&lt;/span&gt;
&lt;span class="nx"&gt;beat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;       &lt;span class="c1"&gt;// stale cycle guard&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;depth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;delay&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;future&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;delay&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;beat&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;depth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;delay&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;   &lt;span class="c1"&gt;// re-fire self&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;childDelay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;delay&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;future&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;childDelay&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;beat&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                                       &lt;span class="c1"&gt;// spawn child depth&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;depth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;depth&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;delay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;childDelay&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each level halves its delay, creating a self-similar cascade entirely within the sub-tick drain. &lt;code&gt;depth&lt;/code&gt; in the payload lets the handler know which level of the hierarchy it is processing. &lt;code&gt;cycleId&lt;/code&gt; lets it discard futures from the previous RR cycle the moment a new one begins.&lt;/p&gt;




&lt;h2&gt;
  
  
  Local Reflector mixin
&lt;/h2&gt;

&lt;p&gt;A handler mixin creating a self-hosting clock node. Activates on &lt;code&gt;__macro&lt;/code&gt;, drives itself via &lt;code&gt;ctx.localReflector(tickMsg, delay)&lt;/code&gt;. Needs no external time reference. The local clock IS the node — purely logical, purely deterministic.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;localReflector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tick&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;initialDelay&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;// spread into W.reduce handlers&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: &lt;code&gt;W.localReflector&lt;/code&gt; defines a &lt;code&gt;__macro&lt;/code&gt; handler that sets the &lt;code&gt;_localActive&lt;/code&gt; guard flag. Do not also define &lt;code&gt;__macro&lt;/code&gt; in the same handler object — the spread will silently overwrite one of them. Put all bootstrap logic inside the tick handler or use a separate node.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The mixin sets &lt;code&gt;_localActive: true&lt;/code&gt; and &lt;code&gt;localLt: 0&lt;/code&gt; on first &lt;code&gt;__macro&lt;/code&gt; so the local clock starts exactly once per world, even under warp replay. The &lt;code&gt;localLt&lt;/code&gt; field is available in state for tracking inner tick count if needed.&lt;/p&gt;

&lt;h3&gt;
  
  
  ctx.localReflector — optional user payload
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;ctx.localReflector(tickMsg, delay, payload)&lt;/code&gt; accepts an optional third argument that is merged into the tick pulse delivered to the handler. This lets the local clock carry application-specific state across ticks — for example a &lt;strong&gt;phase accumulator&lt;/strong&gt; for oscillators or animation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Phase-accumulating local clock&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;localReflector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tick&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.05&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;

&lt;span class="nx"&gt;tick&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;phase&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;phase&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// advance phase each tick&lt;/span&gt;
  &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;localReflector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tick&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.05&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;phase&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;   &lt;span class="c1"&gt;// pass phase forward in payload&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;phase&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The payload is available on the next tick's pulse &lt;code&gt;p&lt;/code&gt; as &lt;code&gt;p.phase&lt;/code&gt;. Unlike state (which is the node's accumulated value), the payload travels &lt;em&gt;in the queue entry&lt;/em&gt; — it is the message's data, not a side-effect. This is useful when you want the next tick to know something about the previous one without storing it in the main state object, or when you need to pass ephemeral per-step data (animation frame index, phase, seed) that does not belong in the canonical exported state.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sub-Tick Scheduling
&lt;/h2&gt;

&lt;p&gt;Futures with &lt;code&gt;delay &amp;lt; SUBTICK_MS = 1&lt;/code&gt; drain within the current pulse:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;future(0)     → fireAt = wallTime      → drains now (same drain pass)
future(0.5)   → fireAt = wallTime+0.5  → drains now (0.5 &amp;lt; SUBTICK_MS=1)
future(1)     → fireAt = wallTime+1    → waits next tick
future(60)    → fireAt = wallTime+60   → waits 60 ticks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All sub-tick steps are deterministic — every peer runs the same drain loop with the same logical &lt;code&gt;wallTime&lt;/code&gt;. This enables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Synchronous multi-step computation&lt;/strong&gt; — &lt;code&gt;future(0)&lt;/code&gt; chains drain in one pass&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zeno series&lt;/strong&gt; — geometrically decreasing delays converging toward 1 tick&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Self-hosting clock nodes&lt;/strong&gt; — via &lt;code&gt;W.localReflector&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Incremental &lt;code&gt;__macro&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;__macro&lt;/code&gt; is called &lt;strong&gt;at most once per &lt;code&gt;logicalTime&lt;/code&gt;&lt;/strong&gt;. The application chooses what to do:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Total &lt;code&gt;__macro&lt;/code&gt;&lt;/strong&gt; — reschedules everything every cycle. Correct when every cycle produces new work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Incremental &lt;code&gt;__macro&lt;/code&gt;&lt;/strong&gt; — only schedules work when inputs changed. The production-correct Krestianstvo/Croquet idiom. When the trigger is a pure function of &lt;code&gt;logicalTime&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;__macro&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cur&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_computeInput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;logicalTime&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;prev&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_computeInput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;logicalTime&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// no extra state needed&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cur&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;prev&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;               &lt;span class="c1"&gt;// idle — zero queue churn&lt;/span&gt;
  &lt;span class="c1"&gt;// schedule futures for the new input&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;started&lt;/code&gt; guard&lt;/strong&gt; — fire &lt;code&gt;__macro&lt;/code&gt; once to bootstrap, then let futures drive cycles:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;__macro&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;started&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;future&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;startCycle&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;started&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the trigger is &lt;strong&gt;not&lt;/strong&gt; a pure function of time (message-driven state, accumulated values), use &lt;code&gt;Behaviors.collect&lt;/code&gt;'s own previous state — the reducer's first argument — to detect changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;__macro&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;someValue&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lastValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;logicalTime&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt; &lt;span class="c1"&gt;// idle&lt;/span&gt;
  &lt;span class="c1"&gt;// ... schedule work for the new value&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;lastValue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;someValue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;logicalTime&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The 2D wave example uses the pure-function approach: &lt;code&gt;_waveOrigin(t)&lt;/code&gt; vs &lt;code&gt;_waveOrigin(t-1)&lt;/code&gt;. When the origin hasn't moved, all 100 cells return immediately — zero futures scheduled.&lt;/p&gt;




&lt;h3&gt;
  
  
  Host helpers
&lt;/h3&gt;

&lt;p&gt;Three functions live in the host layer, registered on &lt;code&gt;meta.ps.app&lt;/code&gt; and callable from inside the META_PROGRAM string as &lt;code&gt;Renkon.app.*&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;_worldNextAt(world)&lt;/code&gt;&lt;/strong&gt; — scans all node states for the minimum &lt;code&gt;_nextAt&lt;/code&gt;, returns it or &lt;code&gt;null&lt;/code&gt;. Used to advance &lt;code&gt;wallTime&lt;/code&gt; correctly during drain and warp.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;_worldSnapshot(world, source, iter)&lt;/code&gt;&lt;/strong&gt; — scans all W nodes (identified by having an array &lt;code&gt;_queue&lt;/code&gt;) and captures their current scalar fields into a plain serialisable object. Used for telemetry and future network snapshot/restore. Optional — metas that don't need telemetry (e.g. wave worlds) simply don't register it; META_PROGRAM calls it with optional chaining (&lt;code&gt;?.&lt;/code&gt;) so absent registration is silently skipped.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Distributed determinism invariants
&lt;/h2&gt;

&lt;p&gt;These invariants must hold for two peers to stay in sync across arbitrary network jitter:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;wallTime = lt&lt;/code&gt;&lt;/strong&gt; — pure logical tick count. No &lt;code&gt;Date.now()&lt;/code&gt; in the model.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The canonical pulse is frozen and delivered unchanged.&lt;/strong&gt; The Reflector stamps &lt;code&gt;wallTime&lt;/code&gt; once and freezes the pulse object. Peers receive the original — delivery delay does not alter content.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Warp uses queue-derived &lt;code&gt;wallTime&lt;/code&gt;.&lt;/strong&gt; During warp, &lt;code&gt;wallTime&lt;/code&gt; is advanced to &lt;code&gt;_worldNextAt&lt;/code&gt; on each iteration — the actual &lt;code&gt;fireAt&lt;/code&gt; values already in the queue — not to &lt;code&gt;Date.now()&lt;/code&gt;. This ensures both peers traverse the same synthetic time sequence.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;No closures in queue payloads.&lt;/strong&gt; All future payloads are plain scalars or plain objects. This makes state fully serialisable and comparable across peers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Stability is locally determined.&lt;/strong&gt; Each peer settles its own wavefront independently. Because inputs are identical, independent local settlement converges to the same result — no cross-peer coordination is needed during a wave.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Queued pulse receiver.&lt;/strong&gt; The META_PROGRAM receiver uses &lt;code&gt;{queued: true}&lt;/code&gt; — no pulse is silently dropped under jitter or load. Each pulse is processed in arrival order.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;__macro&lt;/code&gt; fires at most once per &lt;code&gt;logicalTime&lt;/code&gt;.&lt;/strong&gt; &lt;code&gt;W.reduce&lt;/code&gt; tracks &lt;code&gt;_lt&lt;/code&gt; and skips &lt;code&gt;__macro&lt;/code&gt; injection if the node already processed this logical tick. This prevents double-firing under warp replay without any app-level guard.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Telemetry
&lt;/h2&gt;

&lt;p&gt;The evaluator captures a &lt;code&gt;_telemetry&lt;/code&gt; map on each world, keyed by &lt;code&gt;logicalTime&lt;/code&gt;. Each key holds an array of snapshots — one per &lt;code&gt;evaluate()&lt;/code&gt; call during that wave:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;source&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;macro&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;drain&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;warp&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;iter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;nodes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;nodeName&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;userFields&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;queueLen&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;nextAt&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Snapshots are produced by &lt;code&gt;_worldSnapshot&lt;/code&gt; — generic, no node-name coupling. The telemetry window is bounded to the last 5 logical times to prevent unbounded growth.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;_lastDrainIters&lt;/code&gt; and &lt;code&gt;_lastWarpIters&lt;/code&gt; are stored as scalars for quick UI display.&lt;/p&gt;

&lt;p&gt;The snapshot format is deliberately fully serialisable, positioning telemetry as a foundation for future network snapshot/restore: a late-joining peer could receive a stable snapshot, reconstruct node states and queues, inject a synthetic pulse at the correct &lt;code&gt;logicalTime&lt;/code&gt;, and resume from that point — consistent with the Krestianstvo model of snapshot-plus-replay.&lt;/p&gt;




&lt;h2&gt;
  
  
  Feedback Loop
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;feedback loop&lt;/strong&gt; is a wave that deepens through multiple iterations of inter-node exchange before reaching a fixed point. Unlike a linear chain of futures, a feedback loop involves nodes that respond to each other cyclically — each response potentially triggering another request, until a convergence condition is met.&lt;/p&gt;

&lt;p&gt;The term &lt;em&gt;feedback loop&lt;/em&gt; is preferred over &lt;em&gt;recursion&lt;/em&gt; because there is no call stack involved. Each iteration is a new entry in a node's queue, processed in a subsequent drain iteration. The depth is a property of the &lt;em&gt;wave&lt;/em&gt;, not of any function's activation frame.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;ctx.feedback(msg, payload, maxDepth)&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Feedback loops are expressed through a dedicated effect type distinct from &lt;code&gt;ctx.future()&lt;/code&gt; and &lt;code&gt;ctx.send()&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;feedback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;respond&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;ctx.feedback()&lt;/code&gt; schedules a message at &lt;code&gt;wallTime + _fbStepMs&lt;/code&gt; (where &lt;code&gt;_fbStepMs&lt;/code&gt; defaults to &lt;code&gt;0&lt;/code&gt;, making it equivalent to &lt;code&gt;ctx.future(0, ...)&lt;/code&gt; in the default case), but increments the wave's depth counter by 1. &lt;code&gt;_fbStepMs&lt;/code&gt; is configurable via &lt;code&gt;makeMeta&lt;/code&gt; and allows feedback steps to carry a small non-zero delay when needed. If &lt;code&gt;depth &amp;gt;= maxDepth&lt;/code&gt; the call is a silent no-op, enforcing termination without requiring the handler to check depth manually. The &lt;code&gt;maxDepth&lt;/code&gt; parameter makes the termination budget explicit and local to each feedback relationship.&lt;/p&gt;

&lt;h3&gt;
  
  
  Depth as a first-class wave property
&lt;/h3&gt;

&lt;p&gt;Every queue entry and every outbox message carries a &lt;code&gt;_depth&lt;/code&gt; field. &lt;code&gt;W.reduce&lt;/code&gt; tracks the maximum depth seen across all ready entries in each evaluate call and writes it back as &lt;code&gt;_depth&lt;/code&gt; on the node state. &lt;code&gt;W.stable()&lt;/code&gt; requires &lt;code&gt;_depth === 0&lt;/code&gt; on all nodes — a world with an in-progress feedback loop is never considered stable, keeping the drain loop running until the loop fully unwinds.&lt;/p&gt;

&lt;p&gt;Depth propagates across node boundaries according to these rules:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Effect&lt;/th&gt;
&lt;th&gt;Depth carried&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ctx.feedback(msg, payload)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;depth + 1&lt;/code&gt; — explicit loop increment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ctx.send(target, msg)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;depth&lt;/code&gt; — same wave, preserved across node boundary&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ctx.future(0, msg)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;depth&lt;/code&gt; — zero-delay, same wave phase&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;ctx.future(N, msg)&lt;/code&gt; where N &amp;gt; 0&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0&lt;/code&gt; — new real-time phase, depth resets&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;__macro&lt;/code&gt; injection&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;0&lt;/code&gt; — new wave boundary, always resets&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;ctx.send()&lt;/code&gt; preserving depth is critical: without it, a feedback loop that crosses a node boundary via &lt;code&gt;send()&lt;/code&gt; would reset depth to 0 on delivery, making the accumulating depth invisible to &lt;code&gt;W.stable()&lt;/code&gt; and breaking convergence tracking.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wave depth diagram with feedback
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Logical time  T
              │
           pulse
              ├── depth 0   estimator.__macro  → ctx.future(0, "sendObserve")
              ├── depth 0   estimator.sendObserve → ctx.send("corrector", "observe")
              ├── depth 0   corrector.observe   → ctx.feedback("respond")
              ├── depth 1   corrector.respond   → ctx.send("estimator", "refine")
              ├── depth 1   estimator.refine    → delta &amp;gt; ε → ctx.feedback("continueRefine")
              ├── depth 2   estimator.continueRefine → ctx.send("corrector", "observe")
              ├── depth 2   corrector.observe   → ctx.feedback("respond")
              ├── depth 3   ...loop continues...
              └── depth N   delta &amp;lt; ε → no ctx.feedback → queues drain → stable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example: fixed-point bisection
&lt;/h3&gt;

&lt;p&gt;The reference implementation uses two nodes — &lt;code&gt;estimator&lt;/code&gt; and &lt;code&gt;corrector&lt;/code&gt; — running a bisection toward the nearest integer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;estimator&lt;/strong&gt; proposes an initial value each macro pulse and refines it on each correction received:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// estimator: proposes value, refines on correction&lt;/span&gt;
&lt;span class="nx"&gt;__macro&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;logicalTime&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="nx"&gt;FB_CYCLE_MS&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;initial&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;49&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;wallTime&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.0023&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;future&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sendObserve&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;initial&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;logicalTime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;wt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;wallTime&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;initial&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;iterations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;logicalTime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;trace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="na"&gt;n&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;v&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;initial&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="nx"&gt;sendObserve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;corrector&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;observe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="nx"&gt;refine&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;delta&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;correction&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;refined&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;correction&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;delta&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;feedback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;continueRefine&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;refined&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="nx"&gt;MAX_FB_DEPTH&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;newIter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;iterations&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;newTrace&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;trace&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;trace&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;n&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;newIter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;v&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;refined&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="na"&gt;n&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;newIter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;v&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;refined&lt;/span&gt;&lt;span class="p"&gt;}];&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;refined&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;iterations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;newIter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;trace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;newTrace&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="nx"&gt;continueRefine&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;corrector&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;observe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;

&lt;span class="c1"&gt;// corrector: computes midpoint toward nearest integer&lt;/span&gt;
&lt;span class="nx"&gt;observe&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;target&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;correction&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;feedback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;respond&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;correction&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="nx"&gt;MAX_FB_DEPTH&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;correction&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="nx"&gt;respond&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;estimator&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;refine&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;correction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;correction&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Convergence ratio 3/4 per step. For &lt;code&gt;delta_0 = 0.48&lt;/code&gt;, &lt;code&gt;EPSILON = 0.01&lt;/code&gt;: ~14 iterations.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;trace&lt;/code&gt; array is built inside the world program on each &lt;code&gt;refine&lt;/code&gt; call and exported — the bisect canvas reads the complete convergence trajectory without RAF sampling artifacts.&lt;/p&gt;




&lt;h2&gt;
  
  
  Two-layer time
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Logical time  T ──────────────────────────────────────▶
              │          │          │
           pulse(lt=1) pulse(lt=2) pulse(lt=3)    shared, discrete
              │
              ├── sub-tick 0      (macro phase)
              ├── sub-tick 0.5    (Zeno step — if scheduled, depth 0..N for feedback loops)
              ├── sub-tick 0.75
              ├── ...
              └── stable          (all fireAt ≥ wallTime+1, all depths 0, outbox empty)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Macro time is shared and observable. Sub-tick time is local and transient. Feedback loops deepen the micro phase but remain invisible externally; only the converged result is exported. This is the same two-layer model described in the original Renkon/Krestianstvo design, made explicit and enforced by the wavefront evaluator.&lt;/p&gt;




&lt;h2&gt;
  
  
  Deterministic Pseudo-Random Number Generator
&lt;/h2&gt;

&lt;p&gt;The Krestianstvo Wavefront Evaluator includes a deterministic &lt;strong&gt;xorshift128+&lt;/strong&gt; PRNG (&lt;code&gt;W.rng&lt;/code&gt;) to ensure all peers produce identical random sequences from the same seed. All peers seeded identically will generate the same values in the same order — guaranteed consensus on randomness.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr0e9qenfag5wvx3i5tkz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr0e9qenfag5wvx3i5tkz.jpg" alt="Deterministic Pseudo-Random Number Generator" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;WARNING&lt;/strong&gt;: never use &lt;code&gt;Math.random()&lt;/code&gt; inside world nodes — it is non-deterministic and will cause peers to desync.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  W.rng API
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rng&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;          &lt;span class="c1"&gt;// → float in [0, 1)&lt;/span&gt;
&lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rng&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;nextInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="c1"&gt;// → integer in [0, n)&lt;/span&gt;
&lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rng&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;seed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;        &lt;span class="c1"&gt;// re-seed from logicalTime (deterministic per-cycle reset)&lt;/span&gt;
&lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rng&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;state&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;         &lt;span class="c1"&gt;// → { s0, s1, s2, s3 }  (snapshot)&lt;/span&gt;
&lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rng&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;restore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;// restore from snapshot&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The session seed is set once at startup via &lt;code&gt;makeMeta&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;SESSION_RNG_SEED&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;s0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;0x12345678&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;s1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;0x9abcdef0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;s2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;0xdeadbeef&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;0xcafebabe&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;meta&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;makeMeta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;peerId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;SESSION_RNG_SEED&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;REFLECTOR_MS&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// W.rng.restore(SESSION_RNG_SEED) is called internally&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  RNG example — deterministic sequence per cycle
&lt;/h3&gt;

&lt;p&gt;The RNG example generates &lt;code&gt;RNG_STEPS=20&lt;/code&gt; values per cycle, re-seeding from &lt;code&gt;cycleId&lt;/code&gt; at the start of each cycle so every peer produces the same sequence:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;rngNode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Behaviors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;collect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;values&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;started&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="nx"&gt;reflector&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pulse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pulse&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rngNode&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;__macro&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;started&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;future&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;generate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;step&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;values&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;started&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// stale guard&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;step&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rng&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;seed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;                 &lt;span class="c1"&gt;// re-seed per cycle&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;v&lt;/span&gt;      &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rng&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;values&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[...(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;values&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;[]),&lt;/span&gt; &lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;RNG_STEPS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;future&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;generate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;step&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;step&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;values&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;future&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;RNG_CYCLE_TICKS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;generate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;step&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;values&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Architecture:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rngNode.__macro   → once (started guard): ctx.future(0, "generate", {cycleId:1, step:0, values:[]})
rngNode.generate  → stale guard (p.cycleId !== s.cycleId &amp;amp;&amp;amp; p.cycleId &amp;gt; 1): drop
                  → step=0: W.rng.seed(cycleId)         // deterministic re-seed
                  → W.rng.next() → append to values[]   // carried in payload, not state
                  → if values.length &amp;lt; RNG_STEPS:
                      ctx.future(0, "generate", {cycleId, step+1, values})  // sub-tick chain
                  → else:
                      ctx.future(RNG_CYCLE_TICKS, "generate", {cycleId+1, step:0, values:[]})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: &lt;code&gt;values&lt;/code&gt; accumulates in the &lt;strong&gt;payload&lt;/strong&gt; across the sub-tick chain (not in node state) and is only committed to state on the final step. This avoids intermediate state exports mid-chain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Parameters: &lt;code&gt;RNG_STEPS=20&lt;/code&gt;, &lt;code&gt;RNG_CYCLE_TICKS=80 ticks&lt;/code&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  W API Reference
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Node reducer — call inside Behaviors.collect&lt;/span&gt;
&lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pulse&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;nodeId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;handlers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;newState&lt;/span&gt;

&lt;span class="c1"&gt;// Stability check — use in _isStable&lt;/span&gt;
&lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;nodes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pulse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;boolean&lt;/span&gt;

&lt;span class="c1"&gt;// Export world state to world.app (call from world program)&lt;/span&gt;
&lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;export&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Renkon&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;node1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;node2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="nx"&gt;isStable&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Self-hosting clock mixin — spread into handlers&lt;/span&gt;
&lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;localReflector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tickMsg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;innerTickDelay&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;handlersMixin&lt;/span&gt;

&lt;span class="c1"&gt;// Strip infrastructure fields (_queue, _nextAt, _depth, _lt)&lt;/span&gt;
&lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;userFields&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Handler Context (ctx)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;wallTime&lt;/span&gt;                            &lt;span class="c1"&gt;// current logical wallTime (= lt)&lt;/span&gt;
&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;logicalTime&lt;/span&gt;                         &lt;span class="c1"&gt;// current logicalTime (= lt)&lt;/span&gt;
&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;depth&lt;/span&gt;                               &lt;span class="c1"&gt;// current feedback depth&lt;/span&gt;

&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;future&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;delay&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;         &lt;span class="c1"&gt;// schedule at wallTime + delay&lt;/span&gt;
&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;targetId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;        &lt;span class="c1"&gt;// cross-node via outbox&lt;/span&gt;
&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;feedback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;maxDepth&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c1"&gt;// depth-tracked future at wallTime + _fbStepMs (convergence)&lt;/span&gt;
&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;futureInf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;             &lt;span class="c1"&gt;// fireAt = wallTime — re-enqueues every drain pass&lt;/span&gt;
&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;localReflector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tickMsg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;delay&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="c1"&gt;// sub-tick self-hosting clock step&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Key Architectural Decisions
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Decision&lt;/th&gt;
&lt;th&gt;Rationale&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;wallTime = lt&lt;/code&gt; not &lt;code&gt;Date.now()&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Pure determinism — immune to real-time jitter&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Single reflector for all worlds&lt;/td&gt;
&lt;td&gt;One clock, all peers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Future delays in logical ticks&lt;/td&gt;
&lt;td&gt;No unit confusion, scale-independent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;SUBTICK_MS = 1&lt;/code&gt; boundary&lt;/td&gt;
&lt;td&gt;Clean two-level clock without extra machinery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Warp only on &lt;code&gt;LT &amp;gt; lastLT + 1&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Logical gaps only — normal ticks drain naturally&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;future(0)&lt;/code&gt; chains drain synchronously&lt;/td&gt;
&lt;td&gt;Arbitrary within-tick computation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;ctx.feedback&lt;/code&gt; with depth tracking&lt;/td&gt;
&lt;td&gt;Convergence loops as observable wavefront property&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;W.localReflector&lt;/code&gt; mixin&lt;/td&gt;
&lt;td&gt;Self-hosting clock, autonomous operation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Outbox flush after drain&lt;/td&gt;
&lt;td&gt;Cross-node sends settle before stability check&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;setLt(n)&lt;/code&gt; on reconnect&lt;/td&gt;
&lt;td&gt;Prevents logicalTime regression after autonomous mode&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;trace&lt;/code&gt; array in world state&lt;/td&gt;
&lt;td&gt;Full convergence path without RAF sampling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No separate wave shim&lt;/td&gt;
&lt;td&gt;All worlds share one reflector — future-driven cycles only&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Local Reflector as Simulation Speed Control
&lt;/h2&gt;

&lt;p&gt;The local reflector's tick size directly defines the unit of computation — it can be used to decouple the &lt;strong&gt;simulation resolution&lt;/strong&gt; from the &lt;strong&gt;network synchronisation rate&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Concept
&lt;/h3&gt;

&lt;p&gt;The outer reflector gives one tick per &lt;code&gt;REFLECTOR_MS&lt;/code&gt; real time (e.g. 50ms). The local reflector subdivides each outer tick into &lt;code&gt;N&lt;/code&gt; inner steps by setting &lt;code&gt;innerTickDelay = 1/N&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;outer tick  = network synchronisation boundary  (every 50ms real time)
inner tick  = simulation integration step       (every 1/N logical units)

ratio N = inner_ticks_per_outer_tick = 1 / innerTickDelay
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change &lt;code&gt;innerTickDelay&lt;/code&gt; and you change how much computation happens per network tick — without touching the reflector rate, without changing real-time intervals, without breaking determinism. Both peers run exactly the same &lt;code&gt;N&lt;/code&gt; inner steps per outer tick.&lt;/p&gt;

&lt;h3&gt;
  
  
  Physics simulation example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// PHYSICS_STEP_VAL and STEPS_VAL injected via .replace() chain&lt;/span&gt;
&lt;span class="c1"&gt;// PHYSICS_STEP_VAL = 0.1  → 10 steps per outer tick&lt;/span&gt;
&lt;span class="c1"&gt;// PHYSICS_STEP_VAL = 0.01 → 100 steps per outer tick&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;physics&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Behaviors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;collect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;vel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;step&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;_localActive&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="nx"&gt;reflector&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pulse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pulse&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;physics&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="c1"&gt;// Bootstrap local clock on first __macro&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;localReflector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;simulate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;PHYSICS_STEP_VAL&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;

    &lt;span class="na"&gt;simulate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// One integration step using innerTickDelay as dt&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dt&lt;/span&gt;     &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;_innerTickDelay&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;newPos&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;vel&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;newVel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;vel&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.99&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;         &lt;span class="c1"&gt;// damping&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;newStep&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;step&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newStep&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;STEPS_VAL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;localReflector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;simulate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// reschedule at same rate&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="c1"&gt;// else: all steps done — world stable until next outer tick&lt;/span&gt;

      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;newPos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;vel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;newVel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;step&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;newStep&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;

    &lt;span class="c1"&gt;// External event — arrives only at outer tick boundaries&lt;/span&gt;
    &lt;span class="na"&gt;applyForce&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;vel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;vel&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;force&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Speed multiplier table
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;innerTickDelay&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;Steps per outer tick&lt;/th&gt;
&lt;th&gt;Equivalent simulation rate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.5&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2× per network tick&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;10× per network tick&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.01&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;td&gt;100× per network tick&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;0.001&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;1000&lt;/td&gt;
&lt;td&gt;1000× (near float floor)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Key properties
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Deterministic&lt;/strong&gt; — both peers run exactly &lt;code&gt;STEPS_PER_TICK&lt;/code&gt; inner steps per outer tick. &lt;code&gt;innerTickDelay&lt;/code&gt; is injected via &lt;code&gt;.replace()&lt;/code&gt; so it's identical in both world instances.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;External events at outer tick boundaries&lt;/strong&gt; — &lt;code&gt;applyForce&lt;/code&gt; (user input, collision with another peer) arrives via &lt;code&gt;ctx.send()&lt;/code&gt; from the outer reflector pulse. The local clock runs "inside" each outer tick; external events "interrupt" only between outer ticks. This matches how multiplayer physics engines handle authority boundaries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Variable resolution&lt;/strong&gt; — different worlds can run at different inner rates on the same outer reflector. A physics world at &lt;code&gt;0.01&lt;/code&gt; and an AI world at &lt;code&gt;0.1&lt;/code&gt; both synchronise at the same outer tick boundary, each running its own number of inner steps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Analogous to game engine substeps&lt;/strong&gt; — physics at 300Hz, rendering at 60Hz, network sync at 20Hz. In Krestianstvo terms: local reflector at &lt;code&gt;1/300&lt;/code&gt; ticks, outer reflector at &lt;code&gt;1/20&lt;/code&gt; ticks, external events only at outer tick boundaries.&lt;/p&gt;




&lt;h2&gt;
  
  
  Autonomous Mode
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;DISCONNECT / RECONNECT&lt;/strong&gt; button demonstrates peer autonomy.&lt;/p&gt;

&lt;h3&gt;
  
  
  On Disconnect
&lt;/h3&gt;

&lt;p&gt;If user disconected with outer reflector. &lt;code&gt;meta.startAutonomous()&lt;/code&gt; on all metas starts a local &lt;code&gt;setInterval(REFLECTOR_MS)&lt;/code&gt; injecting pulses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;logicalTime&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;localLt&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;wallTime&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;localLt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;_isLocal&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All worlds continue animating using purely logical ticks. The local state is &lt;strong&gt;deterministic and correct&lt;/strong&gt; for purely internal computation — it is exactly what the reflector would have produced, since world programs here have no external inputs beyond the logical clock itself. Every peer running autonomously produces identical state.&lt;/p&gt;

&lt;p&gt;The state becomes &lt;strong&gt;speculative&lt;/strong&gt; only in full Krestianstvo when the reflector carries external events (user input, peer messages, new joins). In that case, missing those events means the local computation since disconnect must be discarded and replayed from the authoritative event stream on reconnect. The current examples contain no external events, so no rollback occurs.&lt;/p&gt;

&lt;h3&gt;
  
  
  On Reconnect
&lt;/h3&gt;

&lt;p&gt;Animation resumes seamlessly. If any world diverged, warp fires and replays the authoritative state. The speculative work is cleanly discarded. In full Krestianstvo with external events, this becomes optimistic simulation — compute locally, correct authoritatively on reconnect. For purely internal worlds, it is simply correct deterministic continuation.&lt;/p&gt;




&lt;h2&gt;
  
  
  Examples
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Example 1 — Counter (Wavefront Integrity Physical Trace)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flb2cuyz2rozovpzio49w.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flb2cuyz2rozovpzio49w.gif" alt="Counter demo" width="480" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Demonstrates the Krestianstvo consensus model. Two peers independently run sub-step chains. The view shows each peer's progress and marks &lt;strong&gt;SUCCESS&lt;/strong&gt; only when both reach the same target — confirming deterministic consensus.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Architecture:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;counter.__macro      → once (started guard): ctx.future(0, "newCycle", {cycleId:1})
counter.newCycle     → ctx.send("subcounter", "startSubCount", {cycleId})
                     → ctx.future(COUNTER_CYCLE_MS, "newCycle", {cycleId+1})
subcounter.startSubCount → guard (p.cycleId &amp;lt;= s.currentCycle): drop stale
                         → ctx.future(0, "step", cycleId)        // bootstrap first step
                         → reset subCount, stepsDone, stepsTarget
subcounter.step      → payload is scalar cycleId (not object)
                     → guard (cycleId !== s.currentCycle || stepsDone &amp;gt;= SUB_STEPS): drop
                     → if next &amp;lt; SUB_STEPS: ctx.future(STEP_MS, "step", cycleId)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Parameters: &lt;code&gt;STEP_MS=1 tick&lt;/code&gt;, &lt;code&gt;SUB_STEPS=50&lt;/code&gt;, &lt;code&gt;COUNTER_CYCLE_MS=60 ticks&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Example 2 — Fixed-Point Bisection (Feedback Loop Convergence)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft7ocpkhenkqms6n4f0lh.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft7ocpkhenkqms6n4f0lh.gif" alt="Feedback Loop demo" width="640" height="700"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Demonstrates &lt;code&gt;ctx.feedback&lt;/code&gt; — a convergence loop that animates step by step. Depth is a first-class observable property of the wavefront.&lt;/p&gt;

&lt;p&gt;The initial value for each cycle uses a sine-based formula:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;initial = 50 + 49 × sin(lt × 0.0023)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This produces values spread across &lt;code&gt;[1, 99]&lt;/code&gt; with varying fractional parts on every cycle — the irrational multiplier &lt;code&gt;0.0023&lt;/code&gt; ensures the sequence never repeats over any practical run. Some cycles land very close to an integer (fast convergence, 3–5 iterations), others land near the midpoint between two integers (slow convergence, 20+ iterations). The depth bar and canvas curve look different each cycle, making the wavefront depth visibly meaningful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Architecture:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;estimator.__macro     → every 80 ticks (logicalTime % 80 === 1)
                      → ctx.future(0, "sendObserve", {value, cycleId})
corrector.observe     → ctx.feedback("respond", correction, MAX_FB_DEPTH)
corrector.respond     → ctx.send("estimator", "refine", correction)
estimator.refine      → ctx.feedback("continueRefine") if delta &amp;gt; EPSILON
estimator.continueRefine → ctx.send("corrector", "observe", refined)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The bisect canvas shows the convergence trajectory (value vs iteration) for both peers, with a frozen arc between cycles and faded history traces. The &lt;code&gt;trace&lt;/code&gt; array is built inside the world program and exported — bypassing the RAF sampling problem.&lt;/p&gt;

&lt;p&gt;The number of refinement iterations varies per cycle depending on &lt;code&gt;|initial - target|&lt;/code&gt;. Each iteration crosses the node boundary twice (estimator → corrector → estimator), so &lt;code&gt;estimator.iterations&lt;/code&gt; equals the wavefront depth at convergence. Both peers start from the identical deterministic &lt;code&gt;initial&lt;/code&gt; value and apply the same formula — they converge to the same result in the same number of steps, confirming distributed determinism.&lt;/p&gt;

&lt;p&gt;Parameters: &lt;code&gt;EPSILON=0.01&lt;/code&gt;, &lt;code&gt;MAX_FB_DEPTH=64&lt;/code&gt;, &lt;code&gt;FB_STEP_MS=1 tick&lt;/code&gt;, cycle every &lt;code&gt;80 ticks&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Example 3 — 2D Wavefront Stress (225 independent W nodes, user-triggered waves)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl6lqb0ei3pcz92fwkrzh.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl6lqb0ei3pcz92fwkrzh.gif" alt="Wave 2D demo" width="480" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A 15×15 grid of cell nodes. Waves are triggered by user interaction (mouse/touch click). The &lt;code&gt;clock&lt;/code&gt; node receives injected &lt;code&gt;cellClick&lt;/code&gt; events and broadcasts a &lt;code&gt;wave&lt;/code&gt; message to all 225 cells. Each cell independently schedules its own propagation delay based on distance from the click origin.&lt;/p&gt;

&lt;h3&gt;
  
  
  Architecture
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;clock (event)    → injectExternalEvent({type:"cellClick", ox, oy, wt, clientId})
                   enqueued directly onto clock._queue as a "userWave" entry
clock.userWave   → ctx.send("cell_N", "wave", {ox, oy, wt, clientId}) × 225
clock.__macro    → once (_alive guard): ctx.future(1, "_keepalive", {})
clock._keepalive → ctx.future(1, "_keepalive", {})   // perpetual heartbeat

cell.wave        → dist = sqrt((cx-ox)²+(cy-oy)²)
                   contribution = cos(dist*0.45) * exp(-dist*0.22) * 0.8
                   ctx.future(max(1, floor(dist * WAVE_STEP_MS)), "activate", {contribution, clientId})
cell.activate    → ctx.future(WAVE_DECAY_MS, "decay", {contribution})
                   amp += contribution, _count++, active = true
cell.decay       → _count--; amp -= contribution (or 0 if _count reaches 0)
                   active = _count &amp;gt; 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each cell captures its grid position &lt;code&gt;(cx, cy)&lt;/code&gt; in a closure at construction time (&lt;code&gt;cx = id % GRID_W&lt;/code&gt;, &lt;code&gt;cy = floor(id / GRID_W)&lt;/code&gt;). The propagation delay &lt;code&gt;max(1, floor(dist × WAVE_STEP_MS))&lt;/code&gt; is scheduled as a &lt;code&gt;ctx.future&lt;/code&gt; in each cell's own local queue — 225 independent queues, no central structure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Overlapping waves&lt;/strong&gt;: &lt;code&gt;activate&lt;/code&gt; accumulates &lt;code&gt;amp&lt;/code&gt; and increments &lt;code&gt;_count&lt;/code&gt;; &lt;code&gt;decay&lt;/code&gt; decrements both. Multiple in-flight waves from the same or different users overlap additively and decay independently.&lt;/p&gt;

&lt;h3&gt;
  
  
  Node generation via multi-script array
&lt;/h3&gt;

&lt;p&gt;The 225 cell declarations are generated programmatically by &lt;code&gt;makeWave2dScripts()&lt;/code&gt;, which builds a second script string via &lt;code&gt;Array.from({ length: GRID_W * GRID_H }, ...)&lt;/code&gt; and returns &lt;code&gt;[wave2dWorldProgram, cellScript, avatarScript]&lt;/code&gt;. The multi-script array is passed to &lt;code&gt;makeWorld&lt;/code&gt; — each script is evaluated in the same Renkon scope, so &lt;code&gt;_makeCell&lt;/code&gt; defined in script 1 is available when cell declarations in script 2 call it.&lt;/p&gt;

&lt;h3&gt;
  
  
  W.stable under load
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;W.stable([clock, cell_0, ..., cell_224], reflector)&lt;/code&gt; checks all 226 node queues on every evaluate call. The world is stable only when every cell has both fired &lt;code&gt;activate&lt;/code&gt; and &lt;code&gt;decay&lt;/code&gt; for all in-flight waves — all queues empty, all &lt;code&gt;_depth&lt;/code&gt; values 0.&lt;/p&gt;

&lt;p&gt;Parameters: &lt;code&gt;GRID_W=15&lt;/code&gt;, &lt;code&gt;GRID_H=15&lt;/code&gt;, &lt;code&gt;WAVE_STEP_MS=2 ticks&lt;/code&gt;, &lt;code&gt;WAVE_DECAY_MS=28 ticks&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Example 4 — Zeno Series (Sub-Tick Futures + Local Reflector)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5fu9ktvx2hmzxepqyk5q.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5fu9ktvx2hmzxepqyk5q.jpg" alt="Zeno Series demo" width="800" height="185"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Demonstrates sub-tick scheduling and the &lt;code&gt;W.localReflector&lt;/code&gt; primitive.&lt;/p&gt;

&lt;p&gt;A geometrically decreasing series of futures, all within one logical tick:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;future(0.5)    → sum = 0.5
future(0.25)   → sum = 0.75
future(0.125)  → sum = 0.875
...            → converges to 1.0 (never reached, ~13 steps)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Uses &lt;code&gt;W.localReflector&lt;/code&gt; — a handler mixin bootstrapping a self-hosting clock node:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;zeno&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Behaviors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;collect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;n&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;localLt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;_localActive&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="nx"&gt;reflector&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pulse&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pulse&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;zeno&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;W&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;localReflector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tick&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ZENO_INITIAL_DELAY&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;  &lt;span class="c1"&gt;// activate on first __macro&lt;/span&gt;

    &lt;span class="na"&gt;tick&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;delay&lt;/span&gt;     &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;_innerTickDelay&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="nx"&gt;ZENO_INITIAL_DELAY&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;newSum&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;delay&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;nextDelay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;delay&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;nextDelay&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;ZENO_MIN_DELAY&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;localReflector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tick&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;nextDelay&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;              &lt;span class="c1"&gt;// halve and reschedule&lt;/span&gt;
      &lt;span class="k"&gt;else&lt;/span&gt;
        &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;future&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ZENO_CYCLE_TICKS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;restart&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{});&lt;/span&gt;        &lt;span class="c1"&gt;// series done, wait for next&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;localLt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;localLt&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;n&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;newSum&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;

    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;localReflector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tick&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ZENO_INITIAL_DELAY&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;n&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;cycleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cycleId&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All &lt;code&gt;tick&lt;/code&gt; steps fire within the current drain pass (&lt;code&gt;delay &amp;lt; SUBTICK_MS = 1&lt;/code&gt;). Both peers run identical step counts — deterministic consensus on the Zeno series.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example 5: Fractal Heartbeat demo
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/swuy8y8i4t23agg54evs.gif" rel="noopener noreferrer"&gt;hb2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Demo that creates a "symphony" of events where the high-frequency notes are perfectly synchronized and nested within the low-frequency beats, all managed by the deterministic Wavefront algorithm.&lt;/p&gt;

&lt;p&gt;Summary of the "Fractal" Parameters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;FRACTAL_DEPTH (5): How many "generations" of sub-beats are allowed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;FRACTAL_BASE_DELAY (0.5): The starting speed of the "root" beat.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;FRACTAL_DECAY (0.14): How quickly the visual "energy" fades after a pulse passes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;FRACTAL_CYCLE (80): Every 80 logical ticks, the whole system "resets" and starts a fresh cascade.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Fractal Heartbeat is a sophisticated stress test and architectural demonstration of the Wavefront Evaluator. It creates a recursive, self-propagating temporal structure where time "branches" like a tree.&lt;/p&gt;

&lt;p&gt;Instead of one heartbeat, it generates a cascade of heartbeats that get faster and more frequent as they go deeper.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The Core Logic: The "Beat and Split"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The magic happens inside the beat handler in fractalHeartbeatWorldProgram. When a beat occurs, it does two things simultaneously:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Steady Continuity&lt;/strong&gt;: It schedules the next beat at the current depth with the same delay.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Recursive Branching&lt;/strong&gt;: If it hasn't reached the FRACTAL_DEPTH (5 levels), it "spawns" a new beat at the next depth with half the delay (delay * 0.5).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Why it is "Fractal"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In geometry, a fractal is a shape where the small parts look like the whole. In this code, you are creating a Fractal in Time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Level 0&lt;/strong&gt;: Beats every 0.5 sub-ticks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Level 1&lt;/strong&gt;: Beats every 0.25 sub-ticks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Level 2&lt;/strong&gt;: Beats every 0.125 sub-ticks.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...and so on.&lt;/p&gt;

&lt;p&gt;Because each level spawns its own sub-levels, a single initial trigger creates a "shower" of events. This is why the totalBeats counter rises exponentially.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The "Zeno" Connection&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The code uses the Geometric Series. By halving the delay at every depth, the algorithm is attempting to pack a "cascade" of logic into the smallest possible slices of time. The FRACTAL_MIN_DELAY (0.005) acts as the &lt;strong&gt;"Planck Length"&lt;/strong&gt; — the point where the simulation stops because the time slices are too small to process efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. The Visualizer (The Canvas)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The _renderFractal function draws "Energy" on a canvas. Each "Depth" is assigned a different color. The history array tracks the "energy" (activity) at each level.&lt;/p&gt;

&lt;p&gt;When you look at the canvas, you see the Wavefront itself—pulses of activity moving through the sub-tick timeline like ripples in water.&lt;/p&gt;




&lt;h2&gt;
  
  
  Develop and Run
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install
npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That will start local Reflector and server for hosting static files.&lt;/p&gt;

&lt;p&gt;Open web browser:&lt;br&gt;&lt;br&gt;
&lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt; - list demo apps.  &lt;/p&gt;

&lt;p&gt;URL params for demo page:   &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;?app=appName&amp;amp;k=seloID&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Running in Renkon Pad
&lt;/h3&gt;

&lt;p&gt;Load &lt;strong&gt;kwe-index.renkon&lt;/strong&gt; in local/remote running instance of &lt;a href="https://github.com/yoshikiohshima/renkon-pad" rel="noopener noreferrer"&gt;Renkon Pad&lt;/a&gt;, the interactive browser-based environment for Renkon programs. The evaluator runs directly in Renkon Pad with no build step.&lt;/p&gt;




&lt;h2&gt;
  
  
  Related works
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Hardware Description Languages (VHDL / Verilog) where computer chips are simulated.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Macro-tick is the "Clock Signal" of the CPU. The Micro-ticks are called "Delta Cycles." Inside one clock cycle, electricity flows through gates; one gate flipping causes the next to flip. The simulator "drains" these flips until the circuit is stable before moving to the next clock pulse.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parallel Discrete Event Simulation (PDES)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In large-scale military or weather simulations, you can't have one central queue (it’s a bottleneck). They use the Chandy-Misra-Bryant algorithm or Time Warp (Jefferson). These allow different "Islands" of the simulation to process their own local queues and only sync up when they absolutely have to.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Distributed Databases (Vector Clocks)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Systems like Amazon’s Dynamo use logical clocks to determine the order of events across different servers. While they don't usually use "Wavefronts", they rely on the same principle: Local time authority combined with a protocol for global agreement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Contributing
&lt;/h2&gt;

&lt;p&gt;All code is published under the MIT license.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>functionalreactiveprogramming</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Krestianstvo Electric Lazy Reflector for Croquet VM</title>
      <dc:creator>Nikolay Suslov</dc:creator>
      <pubDate>Mon, 20 May 2024 04:04:35 +0000</pubDate>
      <link>https://dev.to/nikolaysuslov/krestianstvo-electric-lazy-reflector-for-croquet-vm-4k93</link>
      <guid>https://dev.to/nikolaysuslov/krestianstvo-electric-lazy-reflector-for-croquet-vm-4k93</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/NikolaySuslov/krestianstvo-electric" rel="noopener noreferrer"&gt;Krestianstvo Electric&lt;/a&gt; introduces the Lazy Reflector for Croquet VM. This becomes possible due to implementing it in &lt;a href="https://github.com/hyperfiddle/electric" rel="noopener noreferrer"&gt;Clojure Electric&lt;/a&gt; programming architecture involving continuous-time signals with lazy sampling and streaming DAGs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzoh755cv65ok215nh81f.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzoh755cv65ok215nh81f.gif" alt="Lazy Reflector" width="480" height="324"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All known Croquet implementations (including the &lt;a href="https://en.wikipedia.org/wiki/Croquet_Project" rel="noopener noreferrer"&gt;Smalltalk&lt;/a&gt;, &lt;a href="https://github.com/virtual-world-framework/vwf" rel="noopener noreferrer"&gt;VWF&lt;/a&gt;, &lt;a href="https://croquet.io/" rel="noopener noreferrer"&gt;Croquet OS&lt;/a&gt; and recent &lt;a href="https://multisynq.io/" rel="noopener noreferrer"&gt;Multisynq protocol&lt;/a&gt;) also OSS &lt;a href="https://play.krestianstvo.org/" rel="noopener noreferrer"&gt;Krestianstvo on Solid JS&lt;/a&gt; are involving discrete timestamp generator (aka Reflector server). The Reflector should produces periodic ticks (~25-50 ms) and also timestamps all external messages coming from the views, then replicates these messages back to all connected peers of some concrete session (Island). If Reflector will not produce any messages, the Croquet VM will be suspended, waiting for any. In simple words, Reflector periodic ticks are needed for any animated in time simulation go forward in Croquet. But, the high frequency Reflector becomes redundant for simulations with slow rates for example or in the applications with no time-animated simulations at all.&lt;/p&gt;

&lt;p&gt;The Lazy Reflector is "ticking" and "time-stamping" only on demand, staying the most time idle and laziness - not producing any work at all! However it guarantees, that all connected peers will get just the same ticks and time stamped messages, without missing a single one! As it is based on backpressured Electric continuous lazy server clock.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight clojure"&gt;&lt;code&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;new&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;actQueue&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;reset!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;!reflectorTime&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;e/server&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;e/system-time-ms&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That perfectly fits Croquet architecture, as in general the most application work is done locally by the clients themselves. That includes involving Future messages with temporal recursion that producing no network traffic at all (future messages never going to the Reflector).&lt;br&gt;&lt;br&gt;
Also Lazy Reflector ticks are now not added to the Croquet VM priority queue. They are only moving local virtual time forward, pulling lazy server clock on demand by the future messages.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1r8gmulxqidt8v4ynj2k.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1r8gmulxqidt8v4ynj2k.gif" alt="Past &amp;amp; Present Virtual Time" width="480" height="318"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To try it in action, there are several example applications in &lt;a href="https://e.krestianstvo.org/" rel="noopener noreferrer"&gt;Krestianstvo Electric&lt;/a&gt;.&lt;br&gt;
Want to mention, that in the &lt;a href="https://e.krestianstvo.org/(krestianstvo.fiddles!%43ounter)/" rel="noopener noreferrer"&gt;Counter example&lt;/a&gt;, the button "Loop" is not triggering Reflector to start ticking periodically. The button send only one external message launching temporal recursion on all connected peers. Then future messages pull the lazy server clock with the sample rate defined in the future step amount (after every virtual 0.5 sec in future do :step).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight clojure"&gt;&lt;code&gt;&lt;span class="n"&gt;step&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;fn&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;swap!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;!objData&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;update-in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;seloID&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;objID&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;:x&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;inc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sendFutureMsg&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="no"&gt;:name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;:step,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;:when&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="n"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="no"&gt;:objid&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;objID&lt;/span&gt;&lt;span class="p"&gt;}))&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The source code is available on &lt;a href="https://github.com/NikolaySuslov/krestianstvo-electric" rel="noopener noreferrer"&gt;Github repository&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>clojure</category>
      <category>webdev</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Answering Common Questions about Krestianstvo SDK 4</title>
      <dc:creator>Nikolay Suslov</dc:creator>
      <pubDate>Wed, 28 Sep 2022 05:26:38 +0000</pubDate>
      <link>https://dev.to/nikolaysuslov/answering-common-questions-about-krestianstvo-sdk-4-1pep</link>
      <guid>https://dev.to/nikolaysuslov/answering-common-questions-about-krestianstvo-sdk-4-1pep</guid>
      <description>&lt;p&gt;Started writing documentation with answering common questions about &lt;a href="https://play.krestianstvo.org"&gt;Krestianstvo SDK 4&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Is it using the Smalltalk version of Croquet: &lt;a href="https://wiki.c2.com/?OpenCroquet"&gt;Squeak Open Croquet&lt;/a&gt; or &lt;a href="https://en.wikipedia.org/wiki/OpenQwaq"&gt;Open Qwaq&lt;/a&gt;?
&lt;/h4&gt;

&lt;p&gt;No. Krestianstvo SDK 4 is entirely written in JavaScript and is running on top of JavaScript VM.&lt;br&gt;
Open Croquet architecture is used in &lt;a href="https://krestianstvo.org/sdk1/"&gt;Krestianstvo SDK 1&lt;/a&gt;. Open Qwaq architecture is used in &lt;a href="https://krestianstvo.org/sdk2/"&gt;Krestianstvo SDK 2&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  2. Is it using &lt;a href="https://croquet.io"&gt;Croquet OS&lt;/a&gt; or any of croquet.io services written in JavaScript?
&lt;/h4&gt;

&lt;p&gt;No. Krestianstvo SDK 4 is introducing its own implementation of Croquet Application Architecture in JavaScript, based on &lt;a href="https://solidjs.com"&gt;Solid JS&lt;/a&gt; &amp;amp; &lt;a href="https://github.com/adamhaile/S"&gt;S.js&lt;/a&gt; using Functional Reactive Programming (FRP). Also, that implementation is not limited just to the JavaScript language. Rust, Swift and Squeak Smalltalk versions are in work.&lt;/p&gt;
&lt;h4&gt;
  
  
  3. Is it using JavaScript version of Croquet known as &lt;a href="https://en.wikipedia.org/wiki/Virtual_world_framework"&gt;Virtual World Framework&lt;/a&gt;?
&lt;/h4&gt;

&lt;p&gt;Only implementations of Reflector server and Virtual Time are used and modified to suit FRP.&lt;br&gt;
Virtual World Framework provides its own unique implementation of Croquet Application Architecture based on prototypes, nodes and drivers. VWF architecture is used in &lt;a href="https://krestianstvo.org/sdk3/"&gt;Krestianstvo SDK 3&lt;/a&gt;. The 4th version of Krestianstvo SDK contains no elements of it.&lt;/p&gt;
&lt;h4&gt;
  
  
  4. Is it compatible with &lt;a href="https://croquet.io"&gt;Croquet OS&lt;/a&gt; or &lt;a href="https://en.wikipedia.org/wiki/Virtual_world_framework"&gt;Virtual World Framework&lt;/a&gt;?
&lt;/h4&gt;

&lt;p&gt;Not out-of-the-box. Although Croquet OS / VWF and Krestianstvo SDK 4 share the same original Open Croquet roots, some effort will be required in porting an application between their different implementations, alongside pros and cons.&lt;br&gt;
The application development (&lt;a href="https://codesandbox.io/s/krestianstvo-helloworld-pnimfu?file=/src/index.js"&gt;code example&lt;/a&gt;) with Krestianstvo SDK 4 is looked quite different, comparing to the  development in Croquet OS or VWF one's. Croquet OS and VWF Application Architecture is based on Model - View pattern, implemented in Class/Instance programming paradigm. In the contrary, Krestianstvo SDK 4 Application Architecture is based just on pure functions in form of Signals and Computations (Effects). Croquet OS uses pub/sub messaging for interconnecting Model/View instances. VWF is using drivers for that interconnection. In the contrary, Krestianstvo SDK 4 is using "glitchless" automatic dependency graph with a synchronous execution engine found in Solid JS and S.js&lt;/p&gt;
&lt;h4&gt;
  
  
  5. Do I need to run my own Reflector server to start developing with Krestianstvo SDK 4?
&lt;/h4&gt;

&lt;p&gt;No. You can use any of publicly available already running reflector servers. Like &lt;a href="https://time.krestianstvo.org"&gt;https://time.krestianstvo.org&lt;/a&gt; or &lt;a href="https://time.livecoding.space"&gt;https://time.livecoding.space&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  6. Can I run my own Reflector server?
&lt;/h4&gt;

&lt;p&gt;Yes, you can host your own &lt;a href="https://github.com/NikolaySuslov/lcs-reflector"&gt;Reflector server&lt;/a&gt; anywhere in LAN or WAN. Just point to it in the &lt;code&gt;&amp;lt;Selo/&amp;gt;&lt;/code&gt; component&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Selo&lt;/span&gt;
    &lt;span class="nx"&gt;nodeID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;simple&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;seloID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;component&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;Simple&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;worlds&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;worlds&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;fallbackWorld&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;EmptyWorld&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;reflectorHost&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://url.to.my.reflector&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or just use directly in Web Browser url with &lt;strong&gt;r&lt;/strong&gt; parameter: &lt;a href="https://play.krestianstvo.org/demo1?r=https://time.krestianstvo.org"&gt;https://play.krestianstvo.org/demo1?r=https://time.krestianstvo.org&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  7. Does Reflector server used in Krestianstvo SDK 4 aware of a client's application logic or store any application state?
&lt;/h4&gt;

&lt;p&gt;No. Reflector server, that is used in Krestianstvo SDK 4 is fully conform the Croquet Application Architecture. Meaning, that Reflector server is used only for initial connection, ticking, stamping and reflecting the messages received from the clients with the data they want to share (e.g. 2D coords from a mouse movement). It knows nothing about application logic, and don't relay any data, that can be generated with a future messages locally on every synced client, running Croquet deterministic computations.&lt;/p&gt;

&lt;h4&gt;
  
  
  8. Can I use different Reflector servers at the same time for different worlds linked by Portals, but existed in one world/web page?
&lt;/h4&gt;

&lt;p&gt;Yes. When creating a Portal, just use url with &lt;strong&gt;r&lt;/strong&gt; parameter pointing to any other running reflector server.&lt;/p&gt;

&lt;h4&gt;
  
  
  9. Are Portals using iFrames to make inter-linked worlds?
&lt;/h4&gt;

&lt;p&gt;No. Portal is just a pure function in form of Solid JS component. Thus, portal can be used inside any other Solid JS component, with no need on creating the new JavaScript context and iFrame. You can freely create a stacks of portals and manipulate them as a single functional component, by passing props and sending messages through it.&lt;/p&gt;

&lt;h4&gt;
  
  
  10. Does Portals support linking to themselves?
&lt;/h4&gt;

&lt;p&gt;Yes. Portals are recursive. By default portal's recursion depth is set to &lt;strong&gt;2&lt;/strong&gt;. Use parameter &lt;strong&gt;d&lt;/strong&gt; in the url to set the depth manually.&lt;/p&gt;

</description>
      <category>solidjs</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Krestianstvo SDK 4 | Implementing Croquet and Recursive Portals on Solid JS</title>
      <dc:creator>Nikolay Suslov</dc:creator>
      <pubDate>Thu, 01 Sep 2022 04:42:02 +0000</pubDate>
      <link>https://dev.to/nikolaysuslov/krestianstvo-sdk-4-implementing-croquet-and-recursive-portals-on-solid-js-54ai</link>
      <guid>https://dev.to/nikolaysuslov/krestianstvo-sdk-4-implementing-croquet-and-recursive-portals-on-solid-js-54ai</guid>
      <description>&lt;p&gt;Let me introduce to you the new &lt;strong&gt;4th&lt;/strong&gt; version of &lt;strong&gt;&lt;a href="https://play.krestianstvo.org/"&gt;Krestianstvo SDK&lt;/a&gt;&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;The main feature of the 4th version is the full-featured implementation of the &lt;a href="https://croquet.io/"&gt;&lt;strong&gt;Croquet Application Architecture&lt;/strong&gt;&lt;/a&gt; in &lt;strong&gt;Functional Reactive Paradigm&lt;/strong&gt; using &lt;strong&gt;&lt;a href="https://www.solidjs.com/"&gt;SolidJS&lt;/a&gt; / &lt;a href="https://github.com/adamhaile/S"&gt;S.JS&lt;/a&gt;&lt;/strong&gt; and introduction of &lt;strong&gt;Recursive Portals&lt;/strong&gt;. The only parts, that stayed the same as in the 3rd version of Krestianstvo SDK are: Reflector and Virtual Time. Their implementations are based on the &lt;a href="https://github.com/virtual-world-framework/vwf"&gt;Virtual World Framework&lt;/a&gt;, thus they were just slightly modified to suit Functional Reactive Paradigm.&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://player.vimeo.com/video/742885266" width="710" height="399"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;The 4th version of Krestianstvo SDK is distributed as a standalone &lt;a href="https://www.npmjs.com/package/krestianstvo"&gt;ESM module&lt;/a&gt; for JavaScript. It could be easily bundled with any &lt;a href="https://www.solidjs.com/"&gt;Solid JS&lt;/a&gt; or &lt;a href="https://astro.build/"&gt;Astro&lt;/a&gt; web application being hosted and running just in the Cloud.&lt;/p&gt;

&lt;p&gt;The work on the 4th version was started in 2019, when I was working on &lt;a href="https://blog.krestianstvo.org/en/krestianstvo-luminary-for-open-croquet-architecutre-and-virtual-world-framework-in-peer-to-peer-web/"&gt;Luminary&lt;/a&gt; and introduced the Functional Reactive Streams into the Croquet application architecture. &lt;a href="https://blog.krestianstvo.org/en/collaborative-robots-rubiks-cube-lego-boost/"&gt;The project with Rubik’s Cube&lt;/a&gt; has shown, how Croquet gets a new look on Virtual Time and Promises inside actions, all backed by FRP. For example, the participants could delay the Virtual Time and observe their actions in virtual world in “slow motion”.&lt;/p&gt;

&lt;p&gt;Then in 2021 I participated in the first &lt;a href="https://browsersound.com/"&gt;Festival for Web based Music&lt;/a&gt;. At the festival me and artist Delia Ramos were creating the web art project — &lt;a href="https://concert.livecoding.space/"&gt;“THIS IS NOT A CONCERT”&lt;/a&gt;. In that project, an audience collaboratively explored the artwork inside virtual canvas space within multi-contextual / conceptual creative layers by touching the virtual objects, interacting or viewing through “filters” in Web Browser. The core object, that I needed to for that project was a Recursive Portal, that should work as a filter, portal to other virtual canvas spaces and also as a portal to itself.&lt;/p&gt;

&lt;p&gt;But, comparable to the original Smalltalk version of the Croquet, as in the Virtual World Framework and in the 3rd version of Krestianstvo SDK there are still lack of Portals, including dependence on global object Window. The &lt;a href="https://croquet.io/"&gt;Croquet.io&lt;/a&gt; has introduced Portals for the Web, by using sandboxed HTML iFrames (&lt;a href="https://davidasmith.medium.com/multiplane-portals-for-the-metaverse-a4b7af913e8e"&gt;Multiplane Portals for the Metaverse&lt;/a&gt;). But in Krestianstvo I wanted to implement Portals the same way as Croquet Smalltalk version does, as pure objects with an ability to make links to themselves, forming a Recursive Portals.&lt;/p&gt;

&lt;p&gt;Finally, I was lucky to do it just in pure JavaScript, thanks to Solid JS! To make these all happen, it demanded of me to implement the Croquet application architecture nearly from scratch using functional reactive paradigm in Solid JS / S.JS.&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://player.vimeo.com/video/745245330" width="710" height="399"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;The typical application in the 4th version of &lt;a href="https://play.krestianstvo.org/"&gt;Krestianstvo SDK&lt;/a&gt; is an application, that will be build up from Solid JS main types of building blocks: Components and Reactive Primitives. Solid’s fine-grained reactivity is built on three core primitives: Signals, Memos, and Effects. Together, they form an auto-tracking synchronization engine. Reactive computations take the form of function-wrapped expressions that execute synchronously (&lt;a href="https://www.solidjs.com/guides/getting-started#learn-solid"&gt;more in SolidJS documentation&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Krestianstvo uses Solid JS reactivity for implementing Croquet’s concept of Model — View interconnection. Croquet Models — are just pure Solid JS Signals, Memos and Stores. Croquet Views — are just Solid JS lightweight Components with no state and no instances. All received external messages from Reflector and all internal Future messages, that responsible for actions are wrapped in a Signals and then dispatched by an Effects accordingly. For example, Smalltalk like “&lt;strong&gt;doesNotUnderstand&lt;/strong&gt;” message is easily realised in Krestianstvo.&lt;/p&gt;

&lt;p&gt;Here is an example of simple working app in Krestianstvo SDK | 4 (run it on &lt;a href="https://codesandbox.io/s/krestianstvo-helloworld-pnimfu"&gt;codesandbox&lt;/a&gt;)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;render&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;solid-js/web&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Selo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;createLocalStore&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;krestianstvo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setLocal&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;createLocalStore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Node&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;nodeID&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nodeID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;properties&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nodeID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;ticking&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;initialized&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="nx"&gt;props&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;inc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;setLocal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;data&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;properties&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;count&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;future&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nodeID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;inc&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;initialize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;inc&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createAction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nodeID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;inc&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;inc&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;selo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createAction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nodeID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;initialize&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;local&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;properties&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Selo&lt;/span&gt;
      &lt;span class="nx"&gt;nodeID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;counter&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="nx"&gt;seloID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sandbox_counter&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="nx"&gt;component&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;Counter&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="nx"&gt;reflectorHost&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://time.krestianstvo.org&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;root&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To be continued…&lt;/p&gt;

&lt;p&gt;Demo playground: &lt;a href="https://play.krestianstvo.org"&gt;https://play.krestianstvo.org&lt;/a&gt;&lt;br&gt;
Glitch demo project: &lt;a href="https://krestianstvo-playground.glitch.me"&gt;https://krestianstvo-playground.glitch.me&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The source code for &lt;strong&gt;Krestianstvo SDK 4&lt;/strong&gt;: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Playground: &lt;a href="https://github.com/NikolaySuslov/krestianstvo-playground"&gt;GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Core library on Solid JS: &lt;a href="https://github.com/NikolaySuslov/krestianstvo"&gt;GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Prototype on S.js: &lt;a href="https://github.com/NikolaySuslov/krestianstvo-s.js"&gt;GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Reflector server: &lt;a href="https://github.com/NikolaySuslov/lcs-reflector"&gt;GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>webxr</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
