Branched from Cheng Lou's Handwired.
Was sad that his demos didn't directly use the NN's output to drive the UI, instead using it as inputs to hardcoded DOM entrypoints. So I decided to fix that. It's slightly less efficient when not leaning on the browser's DOM, so had to shrink it in size. That said, it's a neat proof of concept.
| Cells | Count | Written by |
|---|---|---|
down.active, down.x, down.y | 3 | host: a press, in canvas pixels on a 1/64 grid |
tick | 1 | host: 1 every 250 ms |
share[0..5] | 6 | host: each of its stages' share of its busy time since the last tick, on a 1/1024 grid |
key.active, key.code | 2 | host: a printable key, code 32–95 |
backspace | 1 | host |
tab[0..2] | 3 | state: one-hot of the shown tab |
springMatrix[0..3] | 4 | host: the spring's step matrix for this evaluation's elapsed time |
settleCheck, snap | 2 | host: timing bits |
monitor.load[0..5] | 6 | state: each stage's smoothed share, 0..1 |
text.chars[0..39] | 40 | state: character codes |
text.length | 1 | state |
pics.focus[0..5] | 6 | state: the open picture, one-hot or all zero |
pics.shown[0..5] | 6 | state: the picture being drawn while the zoom closes |
pics.zoom.{displacement, velocity, destination} | 3 | state: the zoom spring |
The event cells (down.active, tick, key.active, backspace) are 1 only in the evaluation where that event happens.
| Values | Count | Used for |
|---|---|---|
| Next state, one per input cell | 84 | copied back into the input: state cells get their new value, inputs pass through, events become 0 |
active | 1 | 1 while the zoom still moves, so the page keeps requesting frames |
| Grays, row by row | 129,600 | the 360 × 360 raster, 0..1, × 255 into the canvas |
So one evaluation is current state + this moment's events → next state + every pixel of the frame. Outside the net, the page only queues events, looks up the spring matrix, and converts grays to RGBA.