Spaces:
Paused
Paused
Commit History
17 days ago
-
feat(web): add view-only mode and a Hugging Face Space deployment
Hosting the dashboard publicly means every visitor shares one game, and control commands are unauthenticated POSTs. --view-only rejects /api/cmd/* with 403 and the page disables the shared controls, while per-viewer view options (view mode, time of day, grid, camera follow) keep working. The Dockerfile builds the binary, bakes the root checkpoint into the image and serves on port 7860 with --view-only, sized for the free CPU tier (LAYA_THREADS=2). The README gains the Space config header and the deploy steps. The event stream sends X-Accel-Buffering: no so proxies pass it through unbuffered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>634fb2d
20 days ago
-
Add obstacles, multiple foods and a real-time 3D (Three.js) view
Game rules: - Several foods on the board at once (5 by default, 1-12, `foods/<n>` command); eating one spawns a replacement so the count stays constant. - Rock obstacles on ~5% of cells each round, generated so every free cell stays connected, two cells off the fence, apart from each other, and clear of the spawn lane. Hitting a rock ends the round ("rock" cause, counted separately). `obstacles` command / `O` key toggles them. - "Closer to the food" in the model prompt now means a shorter path to the nearest food around rocks and the body, not straight-line distance. Default board is 32x20. Browser dashboard: - Page split into index.html, css/dashboard.css and ES modules under js/, compiled into the binary; web.rs serves them plus optional /assets/* (GLB models) read from disk. - 3D and Realistic views render a WebGL miniature garden with Three.js r170 (vendored, MIT): a skinned, rigged snake whose bones are laid along the server's smoothed path each frame, sleeping rabb…38cd66a -
Merge pull request #1 from D9-cell/claude/rust-app-web-ui-xx6e05
Unverified signatureAdd a browser dashboard (--web) with live stats, charts and history662141c
21 days ago
-
Add a browser dashboard (--web) with live stats, charts and history
Claude +1: Claude Opus 5.5Unverified signature- web.rs: std-only HTTP server; the page, a Server-Sent Events state stream, and POST commands (pause, speed, board size, shield, auto-restart, reset) - src/web/index.html: board canvas, model probabilities, safety heuristics, engine info, session KPIs, latency/confidence/score charts, round history and a per-decision log; light and dark themes, works at phone width - app.rs: record every executed move, finished rounds and session totals; run() takes any decision function so the terminal and web UIs share it - mock.rs + --mock: a clearly labelled heuristic stand-in for UI work without the checkpoint; it never touches saved best scores Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HL2VAA2cPZNwuqZhZbaCgKf40724f -
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
23 days ago
-
Add laya-snake: watch the Laya model play Snake live
Live curses TUI showing the Laya model's real per-tick move probabilities, inference timing, a safety shield, and runtime-adjustable board scale. Includes a documented fix for a model bias found during development (literal "down" key bias drowning out food-seeking signal) and a cross-platform play.py bootstrap so it runs from one command with no manual setup. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014j59b9uHEfN1h76pAP2Nny81e650e