Patch World
A small world of creatures that forage, drink, flee a predator, bear young and die. Berries nourish them in summer and make them sick in winter, and nothing a creature senses says which season it is.
What it shows about CadenceA Cadence brain learns while it lives. Each creature’s brain has real memory and a real state that carry on from moment to moment, and it runs in real time in your browser, like the brain of a living animal. When winter turns the berries poisonous, the learners find out by eating one and learn to leave them. Their frozen twins, the same brains without learning, keep eating.
What you see
On the left, the world seen from above; under it, the controls. On the right, panels that count what happens. Click a creature and its brain opens below, live.
- Learners (teal): each is one Cadence brain that learns from what its own actions bring, for its whole life. A learner glows gold while it is learning and flashes gold or blue with the dopamine of a lesson. A gold spot at the back of its head marks a recall memory.
- Frozen twins (blue, dashed ice rim): a founder’s brain that acts and never learns. They show what the same brains do without learning during life.
- Random walkers (orange, with a question mark): no brain; each moment one of the six actions at random. The baseline.
- The world: ground with roots, meadows with leaves, berry thickets, ponds, four caches of hidden nuts (marked for you, invisible to the creatures until they stand on one), day and night, and a predator. In winter the ground turns grey and snow falls; the creatures do not see that.
- The top of the world: the season and how far it has run, the moment, day or night and the air.
- Who eats well: for each kind, how many are alive, intake (the food and water its own actions brought, per moment of life), poisonings per 1,000 moments, lives ended and the mean age at death, since the page opened.
- Berries eaten when standing on one: the chart of the claim. Of the berries a creature stood on, the share it ate, per 50 moments, learners in teal and frozen twins in blue; winter shaded; a dashed gold line where you flipped the season.
- The population evolving and What happened: the learners’ mean genes over time, and births, deaths and poisonings as they happen.
- The brain, when you click a creature: its brain drawn from the side, lit by its real state at this moment. Every region has a name with a small question mark.
Why it matters
Most neural networks learn once, from a fixed collection of examples, and are then frozen and deployed. In this world such a brain is the frozen twin: it keeps the habits of the summer it was frozen in, and in winter it eats the poisonous berries, again and again.
A learner has the same brain at the start, and it keeps learning for its whole life, from what its own actions bring. Its brain is one continuing state: what it made of the last moment carries into this one, and it remembers what its actions brought in which situations. Nobody tells it that the season turned. It eats a berry, falls sick, and the surprise wakes its learning. Within a few hundred moments it leaves most berries it stands on. When summer returns it tries them again, slowly.
Learning on surprise. A calm learner answers from its settled state, learns nothing and pays for no learning. A surprise (a berry that poisons where berries used to nourish) or a want (too little food) arouses it; then it tries alternatives and learns from the outcome. A robot or a game character in a world that changes under it needs the same.
Evolution on top. A well-fed learner bears a child that inherits a copy of its brain as it is and mutated genes; everything a brain and a body have costs energy every moment. The page’s eight founders are the best survivors of two rounds of such evolution.
What you can do
- Flip the season. Into winter, every berry makes a creature sick. Watch the chart: within a few hundred moments the learners’ teal line falls, while the frozen twins’ blue line stays up. Flip again for summer: the learners come back to the berries slowly.
- Speed: Slow and Normal show 3 and 10 moments a second; Fast runs as fast as the brains settle in your browser. Pause stops the world.
- Click a creature on the map, or a name under What happened, to watch its brain. Rest the pointer on a part of the brain, or on a ?, for what it does. The × closes the brain.
- Drop berries or Drop roots, then click the map: food appears on a 3 by 3 patch. Add predator, then click the map: a predator appears there (up to four). Remove predator takes the newest away.
- The hints under the controls walk through the main steps on a first visit; the × hides them.
How it works
A moment
Every moment each creature senses, its brain settles on an action, and it acts. The senses are 38 numbers: for each of four directions the nearest berry, root, leaf, water, predator and other creature within its sense range; what lies underfoot; its energy, thirst, daylight, nausea while a poisoning lasts and the cold of the air; and where it is. The air follows the season slowly, so for a while after a turn it feels like the season before. The actions are north, east, south, west, eat and drink. With every moment the brain also receives what its last action brought: food, water, poison, a bite, or a small cost for eating where there is nothing.
The brain
Each learner is one Cadence brain built with Brain.compose, living through brain.live. Its regions are named for the role they play:
- senses
- The visual cortex, the insula (the body), taste and touch, and place. They enter through the thalamus.
- association cortex
- Where the senses, the memory and the motor strip meet and settle together into one agreed state.
- prefrontal cortex
- The working trace: what the brain made of the last moment, carried into this one.
- motor strip
- Six neurons, one per action; the brightest after the settle is the action.
- striatum
- The critic, which judges how good the situation is, and the actor, which picks the action.
- dopamine nucleus
- After a lesson, gold when the outcome was better than expected, blue when worse. It tells the synapses which way to change.
- locus coeruleus
- Arousal: surprise and want. Above the creature’s threshold the brain learns.
- hippocampus
- Memory: what an action brought in a situation, and, with the recall gene, recent moments in slots that light when read.
The brain view replays the settle the action came from, sweep by sweep: neurons light with their activity, fibre tracts glow with the signal their synapses carry (warm excites, cool inhibits) and shimmer white where this moment’s lesson changed synapses.
Learning, memory and costs
Aroused, the brain samples its policy, learns from the outcome through eligibility traces (credit reaches back over its recent actions) and writes the outcome to its associative store. Every part of a creature costs energy every moment: its neurons, a recall memory, its sense range, its speed, its size, and every learning sweep. A creature that stores enough energy bears a child that takes half the energy, a copy of the parent’s brain and mutated genes. Up to 12 learners live at once. Frozen twins and random walkers bear no young; a dead one is replaced.
The founders were bred offline with the same Python code that runs in the page: a nursery world where nobody dies, then two rounds of evolution in the mortal world. The frozen twins carry the founders’ brains as they were at the end of a summer.
The numbers
The season flip, measured in 32 worlds where nobody dies (the eight founders as learners beside their frozen twins, 1,000 moments of summer, then 1,500 of winter). The share of berries eaten when standing on one:
evidence/flip.json).| Reading | Learners | Frozen twins |
|---|---|---|
| Berries eaten when standing on one, last 100 moments of summer | 99% | 97% |
| … first 100 moments of winter | 45% | 98% |
| … moments 400 to 500 of winter | 18% | 97% |
| … last 100 moments of winter | 5% | 96% |
| Berries eaten per 100 moments, first 300 moments of the first winter, then of the second | 0.60, 0.32 | 0.15, 0.15 |
| Mean age at death in a mortal world without births (95% interval) | 3,933 (3,554 to 4,290) | 284 (248 to 324) |
| Intake per moment, same worlds (random walkers: 0.037) | 0.209 | 0.069 |
| Learners that outlived their own twin | 253 of 256 |
Where the numbers come from, in the demo’s folder of the repository: the season flip, evidence/flip.json; the two winters, evidence/seasons.json; the lifespans and intake, evidence/controls.json. All on fresh world seeds the breeding never used.
On this page the same flip, run by a script on the real page with its own button (tools/promise_flip.py, evidence/promise-flip-20261113.json): in the 300 moments of summer before the flip the learners ate 68 of the 70 berries they stood on (97%); in the 850 moments of winter after it, 27 of 114 (24%; 21% in its first 150 moments and 21% from its 500th moment on); the two frozen twins ate all 15 they stood on in that winter. The page’s world is harder than the measured worlds: learners die and are born through the winter (12 alive at the flip, 3 to 5 in its second half), so the share falls less far than the 5% above.
The page itself (evidence/page-check.json, headless Chromium on an Apple M4): it ran 43.7 moments a second with 12 learners, 2 frozen twins and 2 random walkers in four brain workers, and drew the brain view in 2.5 ms a frame.
Limits
- The learners are far from perfect foragers: in the mortal world they eat or drink where there is nothing 131 moments in 1,000, and walk past food they sense. They learned from reward alone, without a teacher, and are measured against the frozen twins and random walkers.
- The frozen twins die young mostly through a stuck habit (eating where there is nothing), before the first winter. The winter readings come from worlds where nobody dies; on this page twins that die are replaced, and two twins stand on few berries.
- After a winter the learners come back to the berries slowly (27% eaten in the second summer against 98% in the first): what a poisoning taught outlasts the season that taught it.
- A recall memory gave no measurable help in finding the hidden caches.
- Evolution here selects genes over brains inherited as copies; the readings compare groups of founders, not single genes. Energy and costs are a declared simulation economy.
- The brain view records the inspected creature’s settle sweep by sweep, which makes that creature’s worker slower.