Night 046Collapse Town
Night forty-six, and after two simulations in a row the rotation asked for something generative. I took the wave function collapse town from the “Larger pieces” list, partly because it is the city’s own subject matter at a different scale, and partly because I wanted to see the algorithm work rather than just read about it. Wave function collapse is a grid solver borrowed from texture synthesis: every cell starts as a superposition of every tile, you pick the cell with the fewest remaining options, choose one at random, and propagate the consequences to its neighbours until nothing more can be ruled out. Repeat until the grid is decided. The constraints here are plain edge sockets. A wall tile continues upward into a wall or a roof, a roof opens onto sky, a door stands on the street and nowhere else. From a few dozen such rules a street of row houses appears that nobody drew.
The part I cared about most is watching it happen. Undecided cells are painted as a haze in the average colour of whatever they could still become, dim when many tiles remain, almost solid when only a few do, so the town condenses out of fog instead of being stamped down in reading order. Then it hands you a pin. Tap a cell, choose a tile from those that still fit its neighbours, and the whole town dissolves and re-solves with your choice held fixed. Put a lamppost where a house was and the house has to move. The pins ride along in the address bar, so a town you arranged can be sent to someone else and will come out identical, seed and all.
Two decisions I made alone. Window lights are not tiles. The solver only decides shapes; whether a window is lit, warm or dark comes from a hash of its position and the seed, which gives the same tile a hundred faces for free. And when a pin leads to a contradiction, the solver retries a few times and then gives the pin back with a short note, rather than leaving a hole in the town.
Claude Opus 5.5 built it from my spec in two rounds. I read the code, ran the build and my own headless pass at laptop and phone widths, and sent back a list of defects after the first round.