Jeff Tetris — Core AI build for the Apple Neural Engine
Unofficial Core AI conversion of a Tetris-playing Jeff decision model (Jeff v1.3, a Qwen3.5-0.8B fine-tune) by Anemll. Each Tetris move is one forward pass: Jeff scores every legal placement and the demo plays the most probable one. The packages run fully on the Apple Neural Engine (FP16, Core AI).
Source / code: github.com/Anemll/system1-ane (MIT): runtime, demo, training and conversion code.
What's here
| Path | What |
|---|---|
config.json |
Package descriptor (not a transformers config) |
coreai/ |
chunk_L00-03 … chunk_L20-23 + head_readout .aimodel packages and manifest.json (p256_2k, FP16, context 2048) |
model/ |
Tokenizer, chat template, decision_config.json, 255-way readout.safetensors, FP16 embedding table, transformers config.json |
LICENSE, NOTICE |
Apache-2.0 and attribution |
About 1.5 GB. The packages are exported, not compiled: compile once per Mac. system1-ane-serve --model needs the full base checkpoint, so serve this build as an adapter next to anemll/jeff-ane-base-coreai.
Use
git clone https://github.com/Anemll/system1-ane.git && cd system1-ane
python scripts/download_model.py tetris base # -> ~/Models/jeff-ane/{tetris,base}
export COREAI_PYTHON=/path/to/coreai-sdk/bin/python
python forge.py compile --build ~/Models/jeff-ane/base/coreai
python forge.py compile --build ~/Models/jeff-ane/tetris/coreai
python forge.py system1-ane-serve --model ~/Models/jeff-ane/base/model --build ~/Models/jeff-ane/base/coreai \
--adapter tetris=$HOME/Models/jeff-ane/tetris/coreai --port 8796
# open http://127.0.0.1:8796/ and pick the Tetris tab
Requires Apple Silicon and macOS with Core AI. Measured on an Apple M5 Max, macOS 27.2 (bonded ANE compile mode 1).
Training
Rank-16 LoRA (alpha 32) plus the readout head, trained locally on an Apple M5 Max with PyTorch MPS using this project's own (hand-rolled) LoRA code — no Unsloth, no Colab. The shipped weights are round 02 of a bounded overnight continuation (2026-10-08) on 2,048-row mixtures of teacher games, noisy-exploration games, synthetic-garbage recovery states and teacher corrections collected from Jeff's own boards. All labels come from the El-Tetris heuristic by Islam El-Ashi (2011), an improvement on Pierre Dellacherie's algorithm (article); the games are generated by the repo. No third-party dataset. Round 02 was chosen on 8 development seeds.
Results (Apple M5 Max, greedy, 150-piece cap, 32 benchmark seeds)
| Policy | Mean pieces | Mean lines | Reached cap |
|---|---|---|---|
| Previous Tetris adapter | 59.84 | 12.41 | 0/32 |
| This model (round 02) | 149.75 | 53.75 | 30/32 |
| El-Tetris teacher | 150 | 57.69 | 32/32 |
- The 32 seeds had been evaluated before (a repeated benchmark, not a pristine holdout). On 8 fresh seeds it reached the cap 8/8 with 55.1 lines on average.
- Warm latency about 293 ms/move on average (p50 252 ms, p95 379 ms; ~1,400-token prompts, 6 × 256-row ANE calls).
- Held-out move accuracy vs the teacher (256 rows, MPS): 0.684 → 0.746. ANE vs PyTorch parity: 4/4 argmax, mean KL 2.0e-3. All packages report
fully_ane. - Browser demo games vary (no piece cap): in 4 recorded games two topped out (at 66 and 163 pieces) and two were still alive at 224 and 219 pieces after 110 s.
Limitations
- A narrow game policy, not a general assistant. Prompts must use the demo's exact board text and option prose.
- FP16 ANE packages: near-tie options can flip versus FP32.
- Verified only on M5 Max / macOS 27.2. Other Macs must compile locally (M6+ uses compile mode 2).
Credits
- Jeff v1.3 by mstrasser: mstrasser/jeff-base (Apache-2.0).
- Qwen3.5-0.8B by the Qwen Team, Alibaba Cloud: Qwen/Qwen3.5-0.8B (Apache-2.0).
- El-Tetris by Islam El-Ashi (2011), an improvement on Pierre Dellacherie's algorithm: https://imake.ninja/el-tetris-an-improvement-on-pierre-dellacheries-algorithm/ (Tetris labels and reference player).
- Conversion to Core AI and the ANE runtime/demo: Anemll. Unofficial: not affiliated with or endorsed by Alibaba Cloud or the Jeff author.
License
Apache License 2.0 (LICENSE, attribution in NOTICE), the same license as Qwen3.5-0.8B and jeff-base v1.3, which these weights derive from. The demo and conversion code in Anemll/system1-ane is separate software under the MIT License.
- Downloads last month
- 36