Dev runs a neural network entirely in CSS to play Flappy Bird — 20 inferences per second
JumpAppropriate714 · reddit · 2026-10-10
A developer open-sourced flappynn: a Flappy Bird clone whose "brain" is a neural network running entirely in CSS — no TensorFlow.js, no WebGPU, no hidden JS inference.
How it works: JavaScript only runs the game and feeds in state; the network itself uses CSS calc(), max() and exp() for weighted sums, ReLU activations and a sigmoid output. The latest actor is a 6→16→1 MLP (129 trainable parameters) whose inputs include bird position, velocity, pipe distance, gap position, pipe speed, and the next pipe's gap position — letting it see two pipes ahead.
Training & verification: trained with PPO across up to 512 parallel CPU environments; one 5-minute run processed 7.9M transitions over 121 PPO updates, reaching a 104.82 average score and a best episode of 514. After training, actor weights are exported to CSS and inference runs at 20 Hz (2,240 weight multiplications/sec). Comparing the browser CSS model against Python across 4,680 input states yielded zero decision mismatches with max probability error around 1.1e-16.
More from coding & agent
- DuckDB v2.0 CLI agent mode cuts agent-read tokens by 59% on TPC-H benchmarks — josh_wills · 2026-10-10
- Claude Code agents beat torch.compile on CUDA kernels: 2.5x fused GELU, 1.57x matmul via fp32-splitting trick — lmoroney · 2026-10-10
- Roadie: open-source Go USB KVM gives AI agents hands via HTTP — hugs · 2026-10-10
- VirusTotal: fastest-growing AI agent ecosystem OpenClaw becomes a malware delivery channel — Bedrovelsen · 2026-10-10
- Nuwa.skill hits 33.9k GitHub stars distilling anyone's thinking into agent skills — AlchainHust · 2026-10-10
- Microsoft launches Database Hub in Fabric: one place to detect, investigate and automate database ops — adnan_hashmi · 2026-10-10