Play Inside a World Model
There is no game engine on this page. Every frame is hallucinated by a small neural world model running in your browser, conditioned on your keystrokes. Red triangle is you. Find the key, open the door. The locked door will not open without the key; the model learned that rule, and making its own imagination respect it took ten gated training runs. The story · how it works · code.
What this is. A ~33M-parameter residual world model of MiniGrid DoorKey (conv encoder, action-conditioned GRU, skip-connected delta decoder, palette-snapped output), trained with noise-augmented and deployment-matched self-feeding so it survives eating its own frames. It ships through five automated gates scored against the game's exact internal state: a frozen dream, an action-deaf dream, a dream whose pickups don't render, or a door that opens without the key cannot ship.
The door logic is the interesting part. The model provably learned the key-then-door rule early, but its own renders dimmed the key sprite whenever the agent came near, a learned superstition, and it then acted logically on its own hallucination. Data, loss, and architecture fixes cut the violation from 54 to 18 on the gate's scale; doubling model width took it to exactly zero. The model downloads once (~66 MB, cached after that) and every frame is computed locally via ONNX Runtime Web.