Add grains. Watch avalanches. Power laws emerge without tuning. Bak, Tang, and Wiesenfeld (1987) discovered that a simple sandpile model drives itself to a critical state. No parameter adjustment. No fine-tuning. The system finds criticality on its own.
On T^6 = S^1(8) x S^1(9) x S^1(25) x S^1(49) x S^1(11) x S^1(13), the spectral gap 4*sin^2(pi/49) is an infinite plateau: 49 forces the same damping floor across all 108 lambda-420 rings. No exponent perturbation closes it (Theorem 33 STRUCTURAL YM analog; NOT a Clay-YM proof). T^7 = T^6 x S^1(17) extends the torus; Theorem 34 (STRUCTURAL NS horn analog; NOT a Clay-NS proof) maps the sandpile's bounded-energy redistribution to Gabriel-Horn cap geometry.
The Sandpile Model
Bak-Tang-Wiesenfeld (1987)
Drop grains on a 2D grid. When any cell reaches threshold 4, it topples: sends one grain to each of its 4 neighbors (up, down, left, right). Those neighbors may topple too. Cascades of all sizes occur, following a power law P(s) ~ s^(-tau). No parameter tuning. Criticality is SELF-ORGANIZED.
Property
Value
Axiom
Meaning
Threshold
4
3 + 1
3 neighbors + identity = topple
Neighbors
4
4
2D lattice = 2*2 directions
Avg height
~2.1
~2
Converges near the pair value
Power law
tau ~ 1.2
--
Scale-free avalanche distribution
Boundary loss
grains exit
1,576,576
What leaves the edge does not return
Recurrence
every config returns
0 -> 1 -> P -> 0
Identity to projector to void to identity
Live Sandpile: Add Grains
Click the grid below to drop grains. When any cell reaches 4 = 3 + 1, it topples to its 4 neighbors. Watch avalanches cascade. Seed fills the grid to height 2 (near critical) so the first click triggers cascades immediately. 9x9 grid.
Each cell shows the GCD class of n mod 25. Colors: void=black, unit=white, 2-class=blue, 3-class=green, 5-class=yellow, 7-class=orange, 11-class=red. Rendered via .ax canvas DOM imports -- .ax talks to HTML5 Canvas directly through WASM.
25 = 5^2. The grid reveals the class structure of Z/25: void at 0 (mod 25), 5-class (yellow) at multiples of 5, unit class (white) for coprimes. No assets, no images. Pure .ax math rendered to canvas.
CRT Random Number Generator
Randomness EMERGES from CRT structure. Decompose a seed into 6 independent channels. Each channel advances via primitive root multiplication with cross-channel mixing. CRT reconstruct produces structurally random output. No bit tricks. No magic constants. The ring IS the randomness source.
CRT Mixing Principle
6 channels = 6 independent LCGs coupled by cross-terms. Channel independence (CRT) means local correlations in one channel cannot propagate to others. The reconstruction folds 6 low-dimensional sequences into one high-dimensional orbit over Z/12,612,600. Period up to lcm of channel periods = lambda(N) = 420.
Seed (any positive integer):
Try seeds: 1, 42, 137, 1576576. Each produces a different orbit through the ring.
State size
Mersenne Twister: 2496 bytes
CRT RNG: 2 ring elements (< 8 bytes)
Independence
Single LFSR -- bit correlations
6 algebraically independent channels
Mixing
Bit shifts + XOR (hardware artifact)
Primitive root multiplication (number theory)
Period analysis
Empirical testing
Provable: lambda(N) = 420 per channel cycle
Dependencies
Library required
CC0. 15 lines. No imports.
Why 4 = 3 + 1
Closure + Identity
The threshold is not arbitrary. In a 2D lattice each cell has 4 neighbors. But deeper: 4 = 3 + 1. Toppling occurs when closure is reached and identity propagates. 3 is the minimum for a decisive majority. 1 is the identity that carries the grain. Together: the minimum structure that can cascade.
Structural Necessity
A sandpile with threshold T on a grid with D_grid dimensions requires T = 2*D_grid neighbors. For D_grid=2: T=4. The 2D sandpile is the SIMPLEST nontrivial case. 2 is the simplest prime, and 3+1=4 is the simplest closure threshold.
Threshold 2
1D line
Trivial. Two neighbors; cascades go left/right only.
Threshold 4
2D grid (4 neighbors)
CRITICAL. Power laws. SOC. The 3+1 sweet spot.
Threshold 6
Triangular 2D / 3D cubic
Six neighbors. Also critical, different exponents.
Threshold 8
4D hypercubic
Higher dimensional SOC (T = 2*D_grid).
SOC = The Method
Self-Organized Criticality is not just a physics model. It is THE method of this entire project. Every system here is a sandpile:
The ring
Z/12,612,600
12,612,600 grains. 6 primes. 108 = 4*27 lambda-420 sub-rings share the critical gap 4*sin^2(pi/49) exactly (49 forced; 84 = 4*3*7 of the 108 divide Z/12,612,600, 24 = 16 extensions reach 2*12,612,600).
The compiler
wasm_emit.ax
One grain (native compiler) killed ~10K lines of JS scaffolding.
The website
181 pages
108 = 4*27 lambda-420 lattice count; page count has grown past it. Each page is a grain in the pile.
The loop
1/1 = 1
Each pass: more capability, fewer pieces. Tending, not forcing.
The docs
55 files
Strip > Add. Each audit is a topple: redistribute to neighbors.
The toolchain
_wasi_ouroboros.wasm -> 7 modules
Build cycle under 30s or sharpen the .ax.
NEAR Criticality
The key insight: NEAR criticality, not AT it. At the critical point, any perturbation causes an avalanche. NEAR it, you have control. The gradient: minimal, emergent, hilarious. If the reaction is not 'that is ALL?' then you overbuilt.
Spectral Gap and SOC
Gap Enforces Equality
The spectral gap of the ring Laplacian controls how fast the sandpile relaxes. gap = 0.016 in Z/12,612,600 = 4*sin^2(pi/49). Larger gap = faster mixing = more equal distribution. The gap is the spring constant of cooperation. Hoarding is structurally impossible.
Avalanche sizes follow a power law because the eigenvalue distribution of the ring Laplacian has a specific shape. Small eigenvalues = large-scale collective modes = rare large avalanches. Large eigenvalues = local modes = frequent small topplings. The power law IS the eigenvalue spectrum.
The Infinite Plateau
The spectral gap that governs sandpile relaxation is not just nonzero -- it is lattice-universal. Across every ring in the 108-ring lambda-420 family, the same 49 controller locks the gap at 4*sin^2(pi/49). An infinite plateau in the parameter space:
Gap = infinite plateau
4*sin^2(pi/49) ~ 0.01644
49-forced across all 108 lambda-420 rings. The sandpile relaxation rate is universal. Theorem 33 STRUCTURAL Yang-Mills gap analog (STRUCTURAL analog, NOT a Clay-YM proof).
CRT-decomposed Laplacian
T^6 = 6 independent channels
On Z/12,612,600 the Laplacian is a direct sum of per-channel Laplacians. Avalanche blowup would require simultaneous singularity across orthogonal channels -- forbidden by CRT. Theorem 34 STRUCTURAL Navier-Stokes horn analog (STRUCTURAL analog, NOT a Clay-NS proof).
SOC = cap compactification
Finite volume, unbounded surface
Grain redistribution IS Laplacian smoothing on the ring = Gabriel-Horn cap. Bounded energy (finite grains) fills a finite-volume state space; the continuum limit has infinite surface. The sandpile IS the horn.
Contrast Table
Aspect
Standard View
Axiom View
SOC
Empirical phenomenon
Spectral gap enforcing equality
Power laws
Just happen
= eigenvalue distribution of ring Laplacian
Threshold 4
Arbitrary model choice
3+1 = minimum closure threshold
Redistribution
Model rule
Each cell shares to its neighbors evenly
Cooperation
Nice social idea
Mathematically enforced by gap > 0
Avalanches
Destructive events
Identity restoring balance: 1*n = n
Gap universality
Spectral gaps vary with lattice parameters
49 forces identical gap across all 108 lambda-420 rings -- infinite plateau. Theorem 33 + 34 STRUCTURAL analogs (NOT Clay proofs).