手记Garden
EN

Reproducibility comes from a seed, not from luck

Seed Planted 2026-07-20

Certainty: Figured this out while building a toy; I want to reuse it elsewhere

Seed in three sentences:

  1. The first toy in the workshop is a flow-field particle system, and I wanted it to work like this: “copy the link, send it to someone, and what they see is exactly what I see.” Pulling that off takes two things. First, every bit of randomness has to come from a single seed that can be written into the URL (same seed → same stream of pseudo-random numbers), instead of being freshly random each run. Second, particle positions are stored in a normalized 0..1 space and only multiplied by the screen’s width and height at draw time — otherwise the picture shifts the moment the screen size changes.
  2. The key move is to drive both sources of uncertainty — “randomness” and “size” — out of the system: hand randomness over to the seed, and hand size over to normalization. What’s left is a purely deterministic function.
  3. This idea — that “reproducible = removing every hidden, uncertain input” — feels like it reaches well beyond toys. Anything you want other people to be able to reproduce (a piece of analysis, a build) is the same problem.

Home map: Building my own sites