Spaces:
Paused
Paused
Commit History
21 days ago
-
Replace the Python implementation with a Rust port and a fast CPU inference engine
The Python package (laya_snake/, play.py) is removed; the game is now a single native Rust binary with no Python, PyTorch or virtualenv. The Python version remains available in history at 81e650e. Inference: the Laya model and weights are unchanged. A purpose-built CPU engine (src/engine) keeps the f16 checkpoint memory-mapped and widens to f32 inside an AVX2/FMA/F16C matmul, with fused attention, layer-norm and GeGLU kernels and an exact pruning of the last decision-head layer to the option-marker rows. Measured on an i5-1235U: ~2.1x faster per decision (1.7x once thermally throttled), 2.8x less memory, ~20x faster model load. `--verify` checks it against the stock laya crate: 24/24 identical moves, probabilities within 0.0001. Game and UI: Dir enum and flat-grid BFS/flood-fill (tested against the original algorithms); the next decision is requested as soon as a move lands so model time overlaps the pacing delay; redraw only on change, in one synchronized write; the request queue ke…92eac91