<?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>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;h2&gt;
  
  
  Krestianstvo Wavefront Evaluator
&lt;/h2&gt;

&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;br&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;/blockquote&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;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%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;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 the queues are empty, the system has reached Stability (Equilibrium). The "Stable" flag in code is literally the signal that the system has settled into its lowest "energy" state for that tick.&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;blockquote&gt;
&lt;p&gt;&lt;strong&gt;S(t+1) = (Stability (Drain (Pulse(t) + S(t))))&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&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;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 ctx.localReflector(0.1).&lt;/li&gt;
&lt;li&gt;Step 2: The Evaluator puts a message in the queue for T + 0.1.&lt;/li&gt;
&lt;li&gt;Step 3: When the clock hits 0.1, the node receives a __local_tick message.&lt;/li&gt;
&lt;li&gt;Step 4: The node's logic immediately calls ctx.localReflector(0.1) again.&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;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;Your 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;
  
  
  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 javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;logicalTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;lt        &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tick&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;increments&lt;/span&gt; &lt;span class="nx"&gt;by&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="nx"&gt;per&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;wallTime&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;lt        &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pure&lt;/span&gt; &lt;span class="nx"&gt;tick&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="err"&gt;—&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="nx"&gt;logical&lt;/span&gt; &lt;span class="nx"&gt;unit&lt;/span&gt; &lt;span class="nx"&gt;per&lt;/span&gt; &lt;span class="nx"&gt;tick&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;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 javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;future&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="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt; &lt;span class="nx"&gt;reflector&lt;/span&gt; &lt;span class="nx"&gt;tick&lt;/span&gt;
&lt;span class="nf"&gt;future&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;sub&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;tick&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;fires&lt;/span&gt; &lt;span class="nx"&gt;within&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="nx"&gt;tick&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;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;/span&gt;&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;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. Condition: stop when &lt;code&gt;_worldNextAt &amp;gt;= wallTime + SUBTICK_MS&lt;/code&gt; — the next future is in the next tick or later. After the drain, an outbox flush delivers 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;Conditions 1 and 2 are checked by &lt;code&gt;W.stable()&lt;/code&gt; generically across all nodes. 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;Order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;WARP&lt;/strong&gt; — fires only when &lt;code&gt;logicalTime &amp;gt; lastLT + 1&lt;/code&gt; (peer missed pulses). Drains world synchronously via &lt;code&gt;_worldNextAt&lt;/code&gt; until stable. Catches up a lagged peer to authoritative state.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DRAIN&lt;/strong&gt; — fires all futures with &lt;code&gt;fireAt &amp;lt; wallTime + SUBTICK_MS&lt;/code&gt;. Stops when next future is in the next tick.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Outbox flush&lt;/strong&gt; — one extra evaluate to deliver pending &lt;code&gt;ctx.send()&lt;/code&gt; messages.&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;Collects inbound outbox messages written by a &lt;em&gt;previous&lt;/em&gt; evalGen — same-gen messages are deferred to the next evaluate pass, preventing a node from consuming a message written by another node in the same pass&lt;/li&gt;
&lt;li&gt;Collects inbound &lt;code&gt;send()&lt;/code&gt; messages for this node from the outbox&lt;/li&gt;
&lt;li&gt;Splits the node's own queue into ready (fireAt ≤ wallTime) and later entries&lt;/li&gt;
&lt;li&gt;Injects &lt;code&gt;__macro&lt;/code&gt; at the front of the ready list on non-sub-tick pulses — &lt;strong&gt;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; (the last &lt;code&gt;logicalTime&lt;/code&gt; for which &lt;code&gt;__macro&lt;/code&gt; was injected) as infrastructure state alongside &lt;code&gt;_queue&lt;/code&gt; and &lt;code&gt;_nextAt&lt;/code&gt;. If &lt;code&gt;_lt === logicalTime&lt;/code&gt;, &lt;code&gt;__macro&lt;/code&gt; is skipped — preventing double-firing under warp replay. This makes incremental &lt;code&gt;__macro&lt;/code&gt; the default: the handler is guaranteed to be called at most once per logical tick, and can freely choose to do nothing when its inputs haven't changed&lt;/li&gt;
&lt;li&gt;Runs each ready entry through its handler, collecting &lt;code&gt;future&lt;/code&gt; and &lt;code&gt;send&lt;/code&gt; effects&lt;/li&gt;
&lt;li&gt;Enqueues futures into the node's new queue; deposits sends into the outbox&lt;/li&gt;
&lt;li&gt;Returns the new state with updated &lt;code&gt;_queue&lt;/code&gt;, &lt;code&gt;_nextAt&lt;/code&gt;, &lt;code&gt;_depth&lt;/code&gt;, and &lt;code&gt;_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 left for the next pass. This ensures that a &lt;code&gt;ctx.send()&lt;/code&gt; message written by node A is not destroyed before node B reads it, even when both nodes evaluate in the same &lt;code&gt;evaluate()&lt;/code&gt; call.&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 all node queues have only future-dated entries, no node is mid-feedback, and the outbox is empty. 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 same-tick future (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&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ctx.localReflector(tickMsg, delay)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sub-tick self-hosting clock step&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&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;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 javascript"&gt;&lt;code&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="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;fireAt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;wallTime&lt;/span&gt;      &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;drains&lt;/span&gt; &lt;span class="nf"&gt;now &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;same&lt;/span&gt; &lt;span class="nx"&gt;drain&lt;/span&gt; &lt;span class="nx"&gt;pass&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="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;fireAt&lt;/span&gt; &lt;span class="o"&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.5&lt;/span&gt;  &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;drains&lt;/span&gt; &lt;span class="nf"&gt;now &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;SUBTICK_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="nf"&gt;future&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="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;fireAt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;wallTime&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;    &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;waits&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt; &lt;span class="nx"&gt;tick&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;60&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;fireAt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;wallTime&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;   &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;waits&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="nx"&gt;ticks&lt;/span&gt;
&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 the same &lt;code&gt;wallTime&lt;/code&gt; (like &lt;code&gt;ctx.future(0, ...)&lt;/code&gt;), but increments the wave's depth counter by 1. 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   __macro fires → 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; ε → send back to corrector
              ├── depth 2   ...loop continues...
              └── depth N   delta &amp;lt; ε → no re-send → 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="mi"&gt;80&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="c1"&gt;// new cycle every 80 ticks&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.13&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="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="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="nx"&gt;EPSILON&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="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;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="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="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;/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 uses a deterministic XOROSHIRO128+ Pseudo-Random Number Generator (PRNG) to ensure that all peers in a distributed simulation arrive at the exact same state, even when "random" events occur. The PRNG is implemented as a core utility that can be seeded and restored to a specific state. &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;h2&gt;
  
  
  &lt;strong&gt;WARNING&lt;/strong&gt;: never use the default web browser internal Math.random() — non-deterministic PRNG inside nodes. As that will entail peers desync.
&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 (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;// fire every drain pass (capped at 10000)&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 javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;outer&lt;/span&gt; &lt;span class="nx"&gt;tick&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;network&lt;/span&gt; &lt;span class="nx"&gt;synchronisation&lt;/span&gt; &lt;span class="nf"&gt;boundary  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;every&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="nx"&gt;ms&lt;/span&gt; &lt;span class="nx"&gt;real&lt;/span&gt; &lt;span class="nx"&gt;time&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;inner&lt;/span&gt; &lt;span class="nx"&gt;tick&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;simulation&lt;/span&gt; &lt;span class="nx"&gt;integration&lt;/span&gt; &lt;span class="nf"&gt;step       &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;every&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;N&lt;/span&gt; &lt;span class="nx"&gt;logical&lt;/span&gt; &lt;span class="nx"&gt;units&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nx"&gt;ratio&lt;/span&gt; &lt;span class="nx"&gt;N&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;inner_ticks_per_outer_tick&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;innerTickDelay&lt;/span&gt;
&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 javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;__macro&lt;/span&gt;  &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="nf"&gt;once &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;started&lt;/span&gt; &lt;span class="nx"&gt;guard&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;newCycle&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="nx"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;newCycle&lt;/span&gt; &lt;span class="err"&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;subcounter&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;startSubCount&lt;/span&gt;&lt;span class="dl"&gt;"&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="err"&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;60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;newCycle&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;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="c1"&gt;// 60 ticks&lt;/span&gt;
&lt;span class="nx"&gt;subcounter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;step&lt;/span&gt;  &lt;span class="err"&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;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;step&lt;/span&gt;&lt;span class="dl"&gt;"&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;// 1 tick/step × 50 steps&lt;/span&gt;
&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 javascript"&gt;&lt;code&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="err"&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;lt&lt;/span&gt; &lt;span class="err"&gt;×&lt;/span&gt; &lt;span class="mf"&gt;0.0023&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&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 javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;estimator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;__macro&lt;/span&gt;     &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;every&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt; &lt;span class="nf"&gt;ticks &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;80&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="err"&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="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="nx"&gt;corrector&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;observe&lt;/span&gt;     &lt;span class="err"&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="nx"&gt;correction&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="nx"&gt;corrector&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;respond&lt;/span&gt;     &lt;span class="err"&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="nx"&gt;correction&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;estimator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;refine&lt;/span&gt;      &lt;span class="err"&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="k"&gt;if&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="nx"&gt;EPSILON&lt;/span&gt;
&lt;span class="nx"&gt;estimator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;continueRefine&lt;/span&gt; &lt;span class="err"&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="nx"&gt;refined&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&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 (100 independent W nodes, zero inter-node communication)
&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 2" width="480" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This example is the purest demonstration of the local-queue-of-futures architecture: 100 fully autonomous cell nodes arranged in a 10×10 grid, each receiving the reflector pulse directly, each computing its own wave timing independently. There is no coordinator, no broadcast, no &lt;code&gt;ctx.send&lt;/code&gt; between nodes (in auto simulation without mouse events).&lt;/p&gt;

&lt;h3&gt;
  
  
  Architecture
&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;clock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;__macro&lt;/span&gt;    &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;once&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;startWave&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;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="nx"&gt;clock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;startWave&lt;/span&gt;  &lt;span class="err"&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;cell_N&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;wave&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;ox&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;oy&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;wt&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="err"&gt;×&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
                 &lt;span class="err"&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;80&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;startWave&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;wt&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;    &lt;span class="c1"&gt;// 80 ticks&lt;/span&gt;
&lt;span class="nx"&gt;cell&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;wave&lt;/span&gt;        &lt;span class="err"&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;dist&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;activate&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;wt&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;   &lt;span class="c1"&gt;// 2 ticks/unit&lt;/span&gt;
&lt;span class="nx"&gt;cell&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;activate&lt;/span&gt;    &lt;span class="err"&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;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;decay&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;wt&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;            &lt;span class="c1"&gt;// 12 ticks&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each cell permanently captures its grid position &lt;code&gt;(cx, cy)&lt;/code&gt; in a closure at construction time (&lt;code&gt;cx = id % 10&lt;/code&gt;, &lt;code&gt;cy = floor(id / 10)&lt;/code&gt;). On every macro pulse each cell independently computes the same deterministic origin — a pure function of &lt;code&gt;logicalTime&lt;/code&gt; — and derives its own propagation delay. No two cells share any computation or communicate in any way.&lt;/p&gt;

&lt;h3&gt;
  
  
  Zero inter-node communication
&lt;/h3&gt;

&lt;p&gt;Wave origin evolves over logical time: &lt;code&gt;ox = sin(wt * 0.07)&lt;/code&gt;, &lt;code&gt;oy = sin(wt * 0.05)&lt;/code&gt;. Cells guard with &lt;code&gt;wt&lt;/code&gt; (the &lt;code&gt;wallTime&lt;/code&gt; of their wave) not &lt;code&gt;logicalTime&lt;/code&gt; — correctly ignoring stale futures from previous waves. The origin formula is a pure deterministic function of &lt;code&gt;logicalTime&lt;/code&gt; — every cell computes it independently and gets the same result. All worlds share the single main reflector — no separate shim.&lt;/p&gt;

&lt;p&gt;The wave propagation delay &lt;code&gt;floor(dist × 80ms)&lt;/code&gt; is scheduled as a &lt;code&gt;ctx.future&lt;/code&gt; entry in each cell's own local queue. Cell 0 (at the origin) schedules &lt;code&gt;activate&lt;/code&gt; at &lt;code&gt;wallTime + 0ms&lt;/code&gt;. A corner cell at distance 8 schedules at &lt;code&gt;wallTime + 640ms&lt;/code&gt;. These 100 different &lt;code&gt;fireAt&lt;/code&gt; values live in 100 independent queues — there is no central structure holding all of them. The heartbeat advances &lt;code&gt;wallTime&lt;/code&gt; and &lt;code&gt;_worldNextAt&lt;/code&gt; finds the minimum across all 100 &lt;code&gt;_nextAt&lt;/code&gt; values to know when to fire next. Propagation timing is genuinely distributed across 100 independent queues.&lt;/p&gt;

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

&lt;p&gt;&lt;code&gt;W.stable([cell_0, ..., cell_99], reflector)&lt;/code&gt; checks all 100 node queues on every evaluate call. The world is stable only when every cell has both fired its &lt;code&gt;activate&lt;/code&gt; and its &lt;code&gt;decay&lt;/code&gt; — all 100 queues are empty and all &lt;code&gt;_depth&lt;/code&gt; values are 0. This is a genuine distributed fixed point, not a flag set by a central node.&lt;/p&gt;

&lt;h3&gt;
  
  
  Node generation via &lt;code&gt;updateProgram&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The 100 cell declarations cannot be written as a static list in the source — that would require hardcoded &lt;code&gt;const cell_0 = ...&lt;/code&gt; through &lt;code&gt;const cell_99 = ...&lt;/code&gt;. Instead, &lt;code&gt;_waveScript2&lt;/code&gt; is a JavaScript string built at load time by &lt;code&gt;Array.from({ length: GRID_W * GRID_H }, ...)&lt;/code&gt;, and injected into the world's program via &lt;code&gt;updateProgram([script1, script2])&lt;/code&gt;. This is the correct call site: outside any evaluation cycle, no mid-evaluation conflict.&lt;/p&gt;

&lt;p&gt;Parameters: &lt;code&gt;GRID_W=10&lt;/code&gt;, &lt;code&gt;WAVE_STEP_MS=2 ticks&lt;/code&gt;, &lt;code&gt;WAVE_DECAY_MS=12 ticks&lt;/code&gt;, &lt;code&gt;WAVE_CYCLE_MS=80 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 javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;future&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;
&lt;span class="nf"&gt;future&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.25&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.75&lt;/span&gt;
&lt;span class="nf"&gt;future&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.125&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.875&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;            &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="nx"&gt;converges&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;never&lt;/span&gt; &lt;span class="nx"&gt;reached&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt; &lt;span class="nx"&gt;steps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&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;_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="mf"&gt;0.5&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;nextDelay&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="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;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;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;// new series&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="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;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;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="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="mf"&gt;0.5&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="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://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;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 in your code 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;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;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install
&lt;/span&gt;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>
