Code as Nature
Code as Music gave the lab a voice. This gives it a body. The same published feed that drives the music drives a pod of organisms here: one for every service the health probe watches. They steer by Craig Reynolds' three rules, separation, alignment and cohesion, and that is the whole of the physics. A service answering swims with the others. A service that stops answering keeps its separation and loses everything else, so a fault reads as the pod coming apart rather than as a red light.
Source: media/src/nature/nature.py (composition, step, render) and gen.py (read the feed, run it, write the frames). Stdlib only, no model in the loop, no network at render time. Same seed and same feed, same frames.
The population is the estate
This is the part worth being blunt about. The pod is not sized for the picture: there is exactly one organism per row in the roster the lab publishes at /media/iam-state.json, and sub-checks on a host swim as juveniles beside it. Today that is a very small pod, because the estate is small. Nothing is added to make the frame look busier than the lab actually is, and the pod grows when the estate grows.
Hosts that are not public appear in the roster anonymised, so they swim here under a label rather than a name. The organism is real; the hostname is nobody's business.
1, 240 ticks of dt = 0.08 s (19.2 s of world time), over the roster published at 2026-09-24T01:54:35Z with the estate reading ok. Population 2 from 2 roster rows (private-1, cloudlabworks.dev): 2 answering, 0 not. Mean distance from the healthy centroid 99.0 px at tick 0, 37.7 px at tick 240, so the pod closed up over the run. Fastest organism at the end 63.8 px/s against a ceiling of 78.The creature, as code
Three parts, split the way Code as World splits them. The composition is the roster turned into bodies: position, velocity, a size, a phase for the tail. The dynamics are the step function below: separation always, alignment and cohesion only while healthy, a downward drift when not, and a steer away from the glass before reaching it. The appearance is render: flat shapes, 1200 by 900, earth tones first and one loud colour reserved for a sick organism.
The step function, read from nature.py when the site was built:
def step(state, dt):
"""Separation, alignment, cohesion. A sick organism does not align or cohere: it keeps
separation only, so a fault reads as the pod coming apart rather than as a red dot."""
orgs = state["organisms"]
for o in orgs:
sep = [0.0, 0.0]; ali = [0.0, 0.0]; coh = [0.0, 0.0]
n_sep = n_ali = n_coh = 0
for p in orgs:
if p is o:
continue
dx, dy = p["pos"][0] - o["pos"][0], p["pos"][1] - o["pos"][1]
d = math.hypot(dx, dy) or 1e-6
if d < SEP_R:
sep[0] -= dx / d / d; sep[1] -= dy / d / d; n_sep += 1
if d < ALI_R and p["ok"]:
ali[0] += p["vel"][0]; ali[1] += p["vel"][1]; n_ali += 1
if d < COH_R and p["ok"]:
coh[0] += p["pos"][0]; coh[1] += p["pos"][1]; n_coh += 1
acc = [0.0, 0.0]
if n_sep:
s = _steer(o, sep)
acc[0] += s[0] * 1.6; acc[1] += s[1] * 1.6 # separation always applies
if o["ok"]:
if n_ali:
a = _steer(o, [ali[0] / n_ali, ali[1] / n_ali])
acc[0] += a[0] * 1.0; acc[1] += a[1] * 1.0
if n_coh:
c = _steer(o, [coh[0] / n_coh - o["pos"][0], coh[1] / n_coh - o["pos"][1]])
acc[0] += c[0] * 0.9; acc[1] += c[1] * 0.9
else:
# sick: drifts, slows, sinks a little. No alignment, no cohesion.
acc[1] += 9.0
o["vel"][0] *= 0.995; o["vel"][1] *= 0.995
# Boundary avoidance. Without it a pod of two parks against a wall: cohesion pulls
# each toward the other and nothing pushes either off the edge, so the run ends with
# both sitting on the silt. Reynolds steers away from the margin before reaching it.
if o["ok"]:
want = [0.0, 0.0]
if o["pos"][0] < MARGIN: want[0] = MAX_SPEED
elif o["pos"][0] > W - MARGIN: want[0] = -MAX_SPEED
if o["pos"][1] < MARGIN: want[1] = MAX_SPEED
elif o["pos"][1] > H - MARGIN: want[1] = -MAX_SPEED
if want[0] or want[1]:
b = _steer(o, want)
acc[0] += b[0] * 2.2; acc[1] += b[1] * 2.2
o["vel"] = _limit([o["vel"][0] + acc[0] * dt, o["vel"][1] + acc[1] * dt], MAX_SPEED)
o["pos"][0] += o["vel"][0] * dt
o["pos"][1] += o["vel"][1] * dt
o["phase"] += dt * 2.2
# the frame is a tank, not a torus: reflect, so nothing teleports between frames
# (the /world orca taught us that a modular wrap hides the discontinuity in the gap)
for k, hi in ((0, W), (1, H)):
if o["pos"][k] < o["size"]:
o["pos"][k] = o["size"]; o["vel"][k] = abs(o["vel"][k])
elif o["pos"][k] > hi - o["size"]:
o["pos"][k] = hi - o["size"]; o["vel"][k] = -abs(o["vel"][k])
for b in state["blooms"]:
b["age"] += dt
state["t"] += dt
state["tick"] += 1
return state
state.json as gen.py wrote it: the roster it read, the composition, then the state at the end of the run.
{
"seed": 1,
"ticks": 240,
"dt_s": 0.08,
"feed_generated": "2026-09-24T01:54:35Z",
"roster": [
{
"name": "private-1",
"ok": true
},
{
"name": "cloudlabworks.dev",
"ok": true,
"code": 200
}
],
"composition": [
{
"id": "private-1",
"kind": "adult",
"ok": true,
"pos": [
380.61854646744075,
554.2301210811698
],
"vel": [
15.826477138596843,
-14.6958584556347
],
"size": 26,
"phase": 3.112910459877322
},
{
"id": "cloudlabworks.dev",
"kind": "adult",
"ok": true,
"pos": [
569.6946388732429,
495.4778918168289
],
"vel": [
17.323401068130792,
-24.368424793545906
],
"size": 26,
"phase": 0.17811244797868833
}
],
"final_state": {
"tick": 240,
"t_s": 19.2,
"cohesion_px": 37.7,
"organisms": [
{
"id": "private-1",
"kind": "adult",
"ok": true,
"x": 585.4,
"y": 361.4,
"speed": 63.5
},
{
"id": "cloudlabworks.dev",
"kind": "adult",
"ok": true,
"x": 659.9,
"y": 350,
"speed": 63.8
}
]
}
}
Three frames from one seed
The same pod at tick 0, at the midpoint and at the end. Nothing is drawn by hand between frames; each is render(state) after that many calls to step. The captions are the program's own numbers, including the mean distance from the healthy centroid, which is how "together" is measured rather than asserted.
SVG · rendered state · tick 0Frame 1, tick 0t = 0.0 s, tick 0 of 240. 2 answering, 0 not. Mean distance from the healthy centroid 99.0 px: closing.Inquire
SVG · rendered state · tick 120Frame 2, mid runt = 9.6 s, tick 120 of 240. 2 answering, 0 not. Mean distance from the healthy centroid 40.3 px: together.Inquire
SVG · rendered state · tick 240Frame 3, end of runt = 19.2 s, tick 240 of 240. 2 answering, 0 not. Mean distance from the healthy centroid 37.7 px: together.Inquire
Watermarked like everything on Code as Art; the SVG originals stay in the repo's source tree. Inquire for a print or the source of a frame.
Where it came from
Three ancestors, and the piece is honest about owing them. Craig Reynolds' Boids (SIGGRAPH '87) is the direct parent: three local rules per agent, and flocking that nobody wrote. Valentino Braitenberg's Vehicles (MIT Press, 1984) is why four thin signals are enough, since two sensors wired to two motors already read as fear or purpose to anyone watching. Tom Ray's Tierra (1991) is the closest structural relative: a world whose ecology is the machine's own resources, which is exactly what it means to let uptime be the environment.
The route is The Nature of Code, chapters 1, 2 and 5 so far. The book is CC BY-NC-SA, so nothing here is copied from it: the rules are implemented from the concepts against this lab's own data, which is the only version worth publishing anyway.
One contemporary, and it is a fourth ancestor rather than a peer: Code World Model: Coding Agent as World Brain (Chen, Lin and Zhang, Westlake AGI Lab / NTU, August 2026), already credited on Code as World for the idea that the coding agent holds the persistent state. What it adds here is a second idea this page has not taken yet. Their code does not draw the final picture. It emits a proxy, a coarse encoding of where things are and when, and a video model renders fidelity on top while the code still decides what happens. In those terms render below is doing two jobs at once, and the paper's contribution is to split them: the rules stay executable and auditable, and the appearance becomes something you can swap without touching the physics.
Next rungs, in order: chapter 9 to evolve the steering weights against an uptime fitness function, then chapters 10 and 11 to give each organism a small network and let the pod neuroevolve. Further out, render as a constraint emitter rather than a final image, on the Code World Model split. One honest problem stands in the way of the first two and is not solved yet: evolution needs generations and a page visit is thirty seconds, so a visitor would watch noise and be told it was art. The proxy rung has a plainer blocker, which is that a video model does not run in this lab, and the promise at the top of this page that nothing renders with a model in the loop is worth more than the fidelity would be. That gets answered before any of it goes live.