File size: 3,632 Bytes
b213f96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0584b8f
 
b213f96
 
4681eb6
 
 
b213f96
 
 
 
 
 
 
 
 
4681eb6
 
 
 
e1f89fe
 
4681eb6
 
b213f96
 
 
 
 
 
 
 
 
 
 
4681eb6
b213f96
 
e1f89fe
 
 
4681eb6
b213f96
 
 
 
 
4681eb6
b213f96
 
e1f89fe
 
 
 
 
 
 
b213f96
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
license: mit
pretty_name: "2048 Solver Benchmark (expectimax depth sweep)"
language:
  - en
tags:
  - "2048"
  - expectimax
  - game-ai
  - search-depth
  - benchmark
task_categories:
  - other
size_categories:
  - n<1K
configs:
  - config_name: depth_sweep
    data_files: data/2048-benchmark.json
---

# 2048 Solver Benchmark — Expectimax Depth Sweep

By **[LK Forge](https://lkforge.com)**: privacy-first browser tools & games, nothing to install, nothing uploaded.

How well the [LK Forge 2048 Solver](https://lkforge.com/games/2048/) plays as a function of
search depth. The shipped engine is an **expectimax search with a corner-snake heuristic**,
plus **probability-threshold pruning and a transposition table** (the pruning/table approach
follows [nneonneo's canonical 2048-ai](https://github.com/nneonneo/2048-ai)). Self-played
headlessly at fixed depths 1–6 plus the shipped adaptive setting.

- **How the solver works:** https://lkforge.com/games/2048/blog-how-the-ai-solver-works.html
- **Full write-up:** https://lkforge.com/blog/2048-expectimax-depth-benchmark/
- **Try it:** https://lkforge.com/games/2048/
- **Producer:** [LK Forge](https://lkforge.com) — client-side AI games, solvers, and tools.

## Headline numbers

- **Below a 3-ply lookahead the solver never reaches 2048** — 0% of games at depth 1 and depth 2.
- **Depth 3 is the threshold:** reach-2048 jumps to **66%**, and the mean score jumps six-fold
  (from ~4,400 to ~29,600) for that one extra ply.
- **Quality climbs to 97% reach at depth 5**, but a depth-6 move costs about **83× more compute**
  than depth 3 for a shrinking gain.
- **The shipped adaptive engine reaches 2048 in 94% of 300 games** (depth 4 on an open board, rising to
  depth 7 when it is nearly full), pushes to 4096 in **70%**, and breaks **8192 in 9%**, at 1.8 ms/move.
  A separate 250-game run of the same engine measured **92.8%** reach-2048 — corroborating within
  sampling error.

## Files

- `data/2048-benchmark.json` — per-depth reach-rates (1024/2048/4096/8192), mean/median score, and
  mean ms/move for fixed depths 1–6, plus the adaptive run and a headline summary.

## Method

- **Engine:** the exact shipped engine (`public/games/2048/solver-core.js`), self-played headlessly —
  the numbers describe the search the game actually runs.
- **Reach-rate** = share of games that reached that tile at least once.
- **Spawns:** standard 90% "2" / 10% "4" tile spawns.
- **Samples:** depths 1–4 and adaptive are 300 games each; depth 5 is 100 games, depth 6 is 30 games
  (each move there is far slower), so those percentages carry wider error bars.
- Tile spawns use a seeded PRNG so the run is re-runnable. The search itself is deterministic — it
  expands every empty cell rather than sampling — so all game-to-game variance comes from the random
  spawns, and reach-rate is a distribution, not a single fixed value.
- Timing is mean milliseconds per move on one laptop. Measured **23 September 2026** (reworked engine).

## Reproduce

```bash
node scripts/benchmark-2048-depth.mjs
# or: GAMES=300,300,300,300,100,30 DEPTHS=1,2,3,4,5,6 node scripts/benchmark-2048-depth.mjs
```

The same engine is published as a standalone, MIT-licensed repo that reproduces the adaptive run:

```bash
git clone https://github.com/lucian-devops/2048-ai-solver && cd 2048-ai-solver
node benchmark.js 250   # ~20 minutes: ~2 ms/move, ~3,000 moves per game
```

## Citation

> LK Forge (2026). *2048 Solver Benchmark — Expectimax Depth Sweep.*
> https://lkforge.com/blog/2048-expectimax-depth-benchmark/

Everything runs client-side, no login, no tracking.