A beach that remembers which waves hit it

Waves move sand. The moved sand bends the next wave. This page runs the same simulation as the ComputingBeachClaude repository, live in your browser. Play a swell and watch it write the floor. Send a faint ping and hear what the floor says back.

New: Beaches as attention, a crossbar of sand basins that stores key-value pairs, and shows why linear attention and the delta rule are what sand with a habit does.

Darker blue is deeper water, where waves run faster. Light swirls are the waves. Magenta marks sand the waves have already moved.

Play a swell

Ping the bay

The ping is heard at the south harbour. A ping is too weak to move sand.

Each swell leaves bars spaced half its wavelength apart: long swells write coarse print, short swells write fine print. On real coasts, bars like these reflect the very wave that made them (Bragg reflection by sandbars). The shortest swell here is at the limit of this 96-cell grid.

Same storms, opposite order

Two identical beaches get the same two storms, in opposite order. Then a third storm hits both (optional). Then both are pinged. In the experiments, the sand tells the orders apart on 98 % of unseen beds, and still 99–100 % after the third storm. Read through a ping, it is 70–75 %.

West storm, then north storm
North storm, then west storm
Where the two beaches differ

Navy: the first beach's echo. Grey: the second's. Magenta: their difference, magnified 50×.

The bed after training. Note the rings: lenses made of sand.

A bay that learned to route

This bed was shaped by gradient descent so that the low note reaches the north harbour and the high note the south harbour. The waves didn't learn this by themselves; that part failed in the experiments.

North harbour
–
South harbour
–

Pick a note. The bars settle after a few seconds.

What held, and what didn't

Held

  • Waves write history into the sand. The order of two storms is stored (sand decoder 0.98), and only because each wave is steered by sand an earlier wave moved. Without that feedback the two beaches end up identical.
  • A later common storm does not erase the order: 0.99–1.00 in the sand.
  • Pings read without writing: below the sand's threshold, nothing moves.
  • The sand floor is a strong enough maze to route swells: +25.5 dB on average by exact gradient.
  • In a lossless bay, sand that scours in place follows the true gradient (cos 0.989) when a teacher wave is sent back from the harbour.

Didn't

  • Reading order through a ping on new beds: 0.70–0.75, not the 0.90 predicted. Sol's repo, with 8 writable wall patches instead of a whole floor, reads at 0.94–1.00.
  • Learning from a teacher wave at this bay's real damping: the teacher's phase is effectively random (alignment 0.24).
  • Learning from a single exposure, even lossless: the teacher tilts each step the right way on 8 of 8 beds, but beats plain scouring on only 3 of 8. The difference between exposures has to be computed outside the sand.
  • Sand that drifts to calm water (conserving sand) does not descend the gradient.

Every number above has a pre-registration, a script and a results file in the repository. The sister repository is ComputingBeachSol; the cavity reader is from WallMemoryLaw. This page's physics is checked against the Python to 5e-13 (tests/check_js.mjs).