Skip to content

Examples

All examples run live in the browser. Open http://localhost:3000 after running npm start, or visit wavefront.krestianstvo.org.


Example 1 — Counter (Wavefront Integrity Physical Trace)

Section titled “Example 1 — Counter (Wavefront Integrity Physical Trace)”

Demonstrates the Krestianstvo consensus model. Two peers independently run sub-step chains. The view shows each peer’s progress and marks SUCCESS only when both reach the same target — confirming deterministic consensus.

Architecture:

counter.__macro → once (started guard): ctx.future(0, "newCycle", {cycleId:1})
counter.newCycle → ctx.send("subcounter", "startSubCount", {cycleId})
→ ctx.future(COUNTER_CYCLE_MS, "newCycle", {cycleId+1})
subcounter.startSubCount → guard (p.cycleId <= s.currentCycle): drop stale
→ ctx.future(0, "step", cycleId)
subcounter.step → guard (cycleId !== s.currentCycle || stepsDone >= SUB_STEPS): drop
→ if next < SUB_STEPS: ctx.future(STEP_MS, "step", cycleId)

Parameters: STEP_MS=1 tick, SUB_STEPS=50, COUNTER_CYCLE_MS=60 ticks


Example 2 — Fixed-Point Bisection (Feedback Loop Convergence)

Section titled “Example 2 — Fixed-Point Bisection (Feedback Loop Convergence)”

Demonstrates ctx.feedback — a convergence loop that animates step by step. Depth is a first-class observable property of the wavefront.

The initial value for each cycle:

initial = 50 + 49 × sin(lt × 0.0023)

This produces values spread across [1, 99]. Some cycles land very close to an integer (fast convergence, 3–5 iterations), others land near the midpoint (slow convergence, 20+ iterations).

Architecture:

estimator.__macro → every 80 ticks (logicalTime % 80 === 1)
→ ctx.future(0, "sendObserve", {value, cycleId})
corrector.observe → ctx.feedback("respond", correction, MAX_FB_DEPTH)
corrector.respond → ctx.send("estimator", "refine", correction)
estimator.refine → ctx.feedback("continueRefine") if delta > EPSILON
estimator.continueRefine → ctx.send("corrector", "observe", refined)

Parameters: EPSILON=0.01, MAX_FB_DEPTH=64, FB_STEP_MS=1 tick, cycle every 80 ticks


Example 3 — 2D Wavefront (225 Independent W Nodes)

Section titled “Example 3 — 2D Wavefront (225 Independent W Nodes)”

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

Architecture:

clock.userWave → ctx.send("cell_N", "wave", {ox, oy, wt, clientId}) × 225
cell.wave → dist = sqrt((cx-ox)²+(cy-oy)²)
contribution = cos(dist*0.45) * exp(-dist*0.22) * 0.8
ctx.future(max(1, floor(dist * WAVE_STEP_MS)), "activate", {contribution, clientId})
cell.activate → ctx.future(WAVE_DECAY_MS, "decay", {contribution})
amp += contribution, active = true
cell.decay → amp -= contribution (or 0 if _count reaches 0)
active = _count > 0

Overlapping waves: activate accumulates amp and increments _count; decay decrements both. Multiple in-flight waves overlap additively and decay independently.

Parameters: GRID_W=15, GRID_H=15, WAVE_STEP_MS=2 ticks, WAVE_DECAY_MS=28 ticks


Example 4 — Zeno Series (Sub-Tick Futures + Local Reflector)

Section titled “Example 4 — Zeno Series (Sub-Tick Futures + Local Reflector)”

Demonstrates sub-tick scheduling and the W.localReflector primitive. A geometrically decreasing series of futures, all within one logical tick:

future(0.5) → sum = 0.5
future(0.25) → sum = 0.75
future(0.125) → sum = 0.875
... → converges to 1.0 (never reached, ~13 steps)
const zeno = Behaviors.collect(
{ n: 0, sum: 0, _localActive: false },
reflector,
(state, pulse) => W.reduce(state, pulse, "zeno", {
...W.localReflector("tick", ZENO_INITIAL_DELAY),
tick: (s, p, ctx) => {
const delay = p._innerTickDelay ?? ZENO_INITIAL_DELAY;
const newSum = s.sum + delay;
const nextDelay = delay / 2;
if (nextDelay > ZENO_MIN_DELAY)
ctx.localReflector("tick", nextDelay);
else
ctx.future(ZENO_CYCLE_TICKS, "restart", {});
return { ...s, n: s.n + 1, sum: newSum };
},
restart: (s, p, ctx) => {
ctx.localReflector("tick", ZENO_INITIAL_DELAY);
return { ...s, n: 0, sum: 0, cycleId: s.cycleId + 1 };
},
})
);

A “symphony” of events where high-frequency notes are perfectly synchronised and nested within low-frequency beats.

Fractal Parameters:

  • FRACTAL_DEPTH (5) — how many “generations” of sub-beats are allowed
  • FRACTAL_BASE_DELAY (0.5) — the starting speed of the “root” beat
  • FRACTAL_DECAY (0.14) — how quickly the visual “energy” fades after a pulse
  • FRACTAL_CYCLE (80) — every 80 logical ticks, the whole system resets

Why It’s Fractal. Each beat schedules:

  • Its own continuation at the same depth with the same delay (steady continuity)
  • A new beat at the next depth with half the delay (recursive branching)

This creates levels:

Level 0: Beats every 0.5 sub-ticks
Level 1: Beats every 0.25 sub-ticks
Level 2: Beats every 0.125 sub-ticks
...

The FRACTAL_MIN_DELAY (0.005) acts as the “Planck Length” — the simulation stops because the time slices are too small to process efficiently.


Example 6 — Strange Attractors (Lorenz, Rössler)

Section titled “Example 6 — Strange Attractors (Lorenz, Rössler)”

The Lorenz and Rössler strange attractors driven by the fractal IFS clock. The depth layers reveal five simultaneous geometric windows into how the chaotic flow resolves at different scales of temporal magnification:

  • D0 (red/orange) — coarse time steps, broad skeletal structure of the butterfly lobes
  • D4 (grey/white) — fine time steps, intricate spiral structures inside each lobe

Different peers run different ensemble members. The collective visualisation is the ergodic average — the SRB measure.


Example 7 — Holography: Huygens Back-Propagation

Section titled “Example 7 — Holography: Huygens Back-Propagation”

Classical digital holography on a 64×64 plate. IFS beats scatter Huygens wavelets from 192 cube-edge source points (12 edges × 16 points per edge) onto concentric rings of the hologram plate.

After PLATE_DONE_DELAY virtual time, finalizePlate extracts the +1 diffraction order by mixing in a reference carrier wave. A second IFS cascade then performs back-propagation: reconBeat handlers accumulate contributions from plate rings at the corresponding propagation depth, building the reconstruction in row-strips of 4 rows per beat to avoid blocking the UI.

The previous reconstruction is kept frozen while a new emission cycle runs, providing smooth visual continuity on click.


Example 8 — Holography: IFS-Native Wavelet

Section titled “Example 8 — Holography: IFS-Native Wavelet”

A wavelet-native pipeline on a 128×128 grid. The IFS beat cascade partitions the plate field into per-depth sub-band images via _ifsAnalyzeClamp, which samples full ring circumferences isotropically — ceil(2*pi*r) points per ring — to avoid the cross-shaped PSF artifact of 4-point cardinal sampling.

Each band captures one spatial-frequency octave of the scene. Reconstruction is performed by _reconFromBands, a weighted sum of fine bands with unsharp masking: fine bands are weighted exponentially, and coarse bands are subtracted at 0.3x weight to suppress the diffuse halo.

Clicking individual band panels toggles bands in/out of the reconstruction in real time — a capability unavailable in classical Huygens holography.


The 2D focusing nonlinear Schrödinger equation with saturable nonlinearity on a 64×64 complex field ψ. The equation of motion:

i∂ₜψ = −L_IFS·ψ + GAMMA · |ψ|² / (1 + |ψ|²/ISAT) · ψ

Integration uses a Strang-split scheme: exact nonlinear phase-rotation half-steps bracket a linear Fractal Time dispersion step. The effective order s_eff in the range 0.82–0.85 emerges from the IFS contraction geometry rather than being set explicitly — and is displayed live.

Click → inject a soliton (sech-envelope packet). Two-peer split view in nls4.js: soliton crosses the seam between two browser windows — a single continuous field rendered as a distributed display.

Parameters: GAMMA=−0.25, ISAT=20, DT=0.12


The 2D focusing NLS field has distinct topological sectors indexed by conserved charge Q:

  • Vacuum A (Q = 0) — a single bright soliton at center
  • Vacuum B (Q = ±1) — three solitons with 2π/3 relative phase offsets

Controls:

  • Click → inject soliton
  • Right-click → inject vortex (triggers A→B tunneling instanton)
  • Phase A / Phase B buttons → reset the vacuum

The charge Q is computed live from the phase winding and displayed; it changes in integer steps as vortices are injected.


Records and reconstructs a topological tunneling event — not an object, not a static scene.

RECORD: NLS + IFS propagation; plate accumulates |ψ + ψ_ref|² (tilted plane-wave ref)
RECON: plate × conj(ψ_ref) seeds ψ; backward IFS steps refocus the arc

The reconstruction recovers the A → B tunneling arc — the instanton’s worldline through the topological transition.


Example 12 — Holographic Eye (Live Perception)

Section titled “Example 12 — Holographic Eye (Live Perception)”

The live 5-stage perception pipeline:

ψ_obj ──Fᵀ──► ψ_holo ──[H]──► ψ_holo' ──F⁻ᵀ──► ψ_evidence ──relax──► ψ_percept

The [H] transform slot supports multiple modes:

  • identity — exact reconstruction
  • low-pass aperture — suppress high-frequency detail
  • high-pass aperture — suppress low-frequency / suppress diffuse halo
  • phase conjugate — time-reverse the wavefront
  • left-occlusion — block the left half of the hologram domain
  • random-block zero/noise — stochastic occlusion for redundancy testing

Save/load (.kwe): stores ψ_holo' (post-[H]). On load, re-runs the backward leg and settles a fresh soliton from noise toward the loaded evidence — recalled memory is perceived as the medium’s canonical eigenstate.


Load kwe-index.renkon in a local/remote running instance of Renkon Pad. The evaluator runs directly in Renkon Pad with no build step.

npm install
npm start

Open http://localhost:3000 to see the list of demo apps. URL params: ?app=appName&k=seloID