GOL-026 · technical companion
Density Layers
Local crowding chooses the law: two nested neighborhood counts select among three Life rules. Compose the radii, thresholds, births and survival.
At a glance
- geometry
- Square lattice
- neighborhood
- Two cumulative Moore radii, 1–3; immediate Life counts
- states
- Dead / alive + density and applied-level evidence
- update
- Frozen density selection, synchronous Life
- renderer
- Canvas 2D
What to explore
Let density change the local law without adding another occupancy field, temporal phase, forecast, or global coordination. Make both nested tests and the chosen birth/survival clause directly inspectable. Higher levels may be rare in sparse fields; preserve that consequence rather than artificially forcing promotion.
Rules, update order and replay
Binary square lattice, 80/120/160 square, default torus; bounded exterior is dead. Count living cells within Chebyshev radii r1 and r2, excluding the center. Allowed pairs are (1,2), (1,3), (2,3), with capacities 8, 24 and 48. If small count <= threshold 1, use level 1. Otherwise, if large count <= threshold 2, use level 2. Otherwise use level 3. Both gates must pass for level 3. All three B/S masks count the same eight immediate neighbors (0–8). A dead cell uses birth, a live cell survival. All reads use the frozen previous board and one Step commits synchronously. No randomness occurs during evolution. Minimum engine dimension seven avoids duplicate wrapped samples at radius three.
Occupancy determines the future. Full replay includes occupancy, generation, previous occupancy, immediate/small/large counts, applied level, evidence validity, configuration, dimensions and topology. Reset rebuilds the selected seeded or composed opening and clears generation/evidence. Clear empties the field. Painting, rule and topology edits pause, preserve generation, and invalidate old evidence. Seed/density changes take effect on Reset. Colors describe the rule that produced living cells in the last Step; initial cells have no applied level yet.
Reading the simulation
Canvas 2D. Initial living cells are neutral cream; last-Step level 1 lime, level 2 cyan, level 3 violet. Dead cells remain background. Color off shows binary life. Paused selected-cell inspection reports immediate count, both cumulative counts, both gate results, chosen level and B/S rule, exact next state, and prior evidence. Small-neighborhood inputs have solid cyan outlines; the remaining larger inputs have dashed violet outlines. Text labels preserve the distinction without color. Arrow keys select, Enter paints, P plays/pauses, S steps. All randomizers live in the Randomizer section, alongside the rule controls.
Reproduce an opening
Download the example above, open the simulation, expand the controls, then use Share & reproduce → Import JSON. The example uses authored rules and a fixed seeded starting field; it is independent of the site’s editable default composition. Import starts paused at Step zero.
Share links and JSON reproduce the configured starting conditions, including hidden layers rebuilt by Reset. They do not save an evolved board, hand-painted cells, speed or display preferences. Determinism applies to the same rule version and Step sequence; real-time playback rates vary by device.
Larger fields and more involved rules can reduce playback speed. Read the configuration format and automated-access guide for compatibility details.