☰

Welcome to F97.BE!

Python, Photons, and Predictions.

Zugwunder

Zugwunder is a native chess application for macOS with a chess engine of its own, written from scratch in Swift. It does three things: it solves chess problems, it trains your tactics, and it plays against you.

As a problem solver, it finds mates, helpmates, selfmates and stalemates in any number of moves, shows the complete solution with every defence, and tells you whether a composition has a second, unintended solution. As a tactics trainer, it draws on the puzzle database of Lichess and on your own collection, and it keeps track of which themes you master and which ones still trip you up. As an opponent, it plays at several strength levels, with a chess clock, an opening book and, if you like, spoken move announcements. After the game, it goes through your moves with you and points out where you could have played better.

At full strength, Zugwunder plays at an estimated level of about 3000 Elo, far above almost any human player. Its engine is also available as a stand-alone UCI engine for macOS and Linux, so you can use it in any other chess program, from analysis boards to engine tournaments. And if you just want to try it out, you can play against Zugwunder right in your browser, without installing anything.

Everything in Zugwunder is my own work: the move generator, the search, the neural network that evaluates positions and the way it was trained. No code or data from other engines is included. The network learned chess only by playing against itself, hundreds of thousands of games, night after night.

The name is a play on the German words Zugzwang (the compulsion to move, even when every move makes things worse) and Wunder (miracle, because it compiles). The program speaks German, English, French and Dutch, and it is free of charge.

System requirements

The Zugwunder app requires a Mac with Apple silicon (M1 or later) and macOS 14 Sonoma or later. It is written entirely in Swift and optimised for Apple's own chips; there is no version for Intel Macs, but I can compile one for you if you want it: just send me a mail.

The UCI engine is included in the app and on its disk image for macOS. For Linux, there are two stand-alone versions: one for 64-bit Intel and AMD processors with AVX2 (practically every PC from 2013 onwards) and one for 64-bit ARM, such as the Raspberry Pi 4 and 5. Both are statically linked and run on any distribution without installing anything else. By default, the engine uses 256 MB of memory for its hash table; Syzygy endgame tablebases are optional.

In the browser, Zugwunder runs on any current browser on Windows, macOS, Linux, Android or iOS: Play Zugwunder online. There is no native version for Windows.

What Zugwunder can do

  • Problem solver: mate, helpmate, selfmate and stalemate in n moves. Zugwunder shows the complete solution tree, including every defence, finds all solutions of a helpmate and checks whether a problem has alternative solutions (cooks).
  • Board editor: set up any position by hand or paste a FEN; Zugwunder checks that the position is legal before it starts. From any position you set up, you can solve, analyse or simply play on.
  • Tactics trainer: puzzles from the Lichess puzzle database, a personal library of your own puzzles, progress tracking by theme and difficulty, and repetition of the puzzles that gave you trouble.
  • Playing partner: games against the engine at three strength levels, with a chess clock (with increment), an opening book, move announcements, draw offers and a pause button. Unfinished games are saved and can be resumed later.
  • Other engines: if you like, you can let an external UCI engine such as Stockfish play instead, with an adjustable Elo limit, or sit back and watch Zugwunder play against it.
  • Game analysis: open PGN files, step through games and let the engine point out inaccuracies, mistakes and blunders, with better moves and an evaluation curve. The annotated game can be saved as PGN again.
  • Files and printing: PGN import and export that keeps tags, comments and variations, game collections, diagrams as images, and printable puzzle sheets with the solutions on a separate page.
  • Endgames: Zugwunder computes exact tables for important endgames itself while it starts and can also use Syzygy tablebases with up to five pieces.
  • Easy to use: drag and drop, full keyboard control, VoiceOver support with spoken moves, and four languages: German, English, French and Dutch.
  • UCI engine: the command Install UCI engine in ~/bin puts the engine on your Mac for other chess programs. The disk image also contains it, together with an English guide to all of its options.

Inside the engine

Zugwunder represents the board as bitboards, sixty-four bit numbers with one bit per square, and generates the moves of sliding pieces with magic bitboards, a lookup technique that finds all squares a rook or bishop can reach in a single step. This makes the move generator fast enough to examine millions of positions per second.

The search is a classical alpha-beta searcher with the techniques that strong engines have in common: principal variation search with aspiration windows, a transposition table, null-move pruning, late move reductions, razoring, futility and static-exchange pruning, and move ordering with killer moves, countermoves and a history of moves that worked before. Its time management thinks longer when the best move is unstable and saves time when the choice is clear; its parameters were tuned in thousands of test games. With Lazy SMP it searches on several processor cores at once.

Positions are evaluated by a small neural network, an NNUE (768 inputs, two accumulators of 256 neurons, one output). The network is updated incrementally as moves are made and computed with 16-bit integers and the vector units of the processor, so it costs little more than a hand-written evaluation while understanding chess far better.

In the endgames it knows exactly, Zugwunder plays perfectly: while it starts, it computes exact tables for king and queen, king and rook, king and pawn, and king, bishop and knight against a lone king, and for king and rook against king and bishop. With Syzygy tablebases installed, it plays every endgame with up to five pieces perfectly.

How Zugwunder was made

Zugwunder began its live early 2026 as Mattlotse ("mate pilot"), a solver for chess problems. To solve problems, it needed a fast, correct move generator and search, and from there it was a short step to an engine that plays. The whole program was developed by Erik Schmidt: every line of it is new; no code or data from other engines is included.

The most important rule of the project is: nothing is accepted without measurement. Every change to the engine, however convincing it looks, has to prove itself in thousands of fast games against the previous version. A statistical test (SPRT) decides when enough games have been played; changes that do not make Zugwunder stronger are thrown away.

The neural network learned chess only from Zugwunder itself. The engine played hundreds of thousands of fast games against itself overnight on a Mac Studio, the positions were labelled with its own search results and final game outcomes, and the network was trained in PyTorch on the Mac's GPU. Each new network then had to beat the old one:

  • Network v1: 24.3 million positions from self-play, +225 Elo over the hand-written evaluation.
  • Network v2: 41.4 million positions, partly played by v1, +54 Elo over v1.
  • Network v3: 66.7 million positions, partly played by v2, +104 Elo over v2.
  • Network v4: 113.1 million positions, partly played by v3, +79 Elo over v3.
  • Network v5: 170.1 million positions, partly played by v4, +26 Elo over v4.

To place Zugwunder on a public scale, it played 1000 games against Stockfish 19 at calibrated strength levels (2850, 3000, 3100 and 3190 Elo), under conditions like those of the CCRL rating list: 60 seconds plus 0.6 seconds per move, one core, 256 MB hash, 5-piece Syzygy tables. The result: Zugwunder 1.1.5 plays at about 3006 ± 17 Elo on the CCRL blitz scale. That is an estimate, not an official rating.

One lesson came as a surprise: networks v3, v4 and v5 each beat their predecessor clearly, but against Stockfish they all score the same, at about 3000 Elo. A network that only ever plays against itself learns to beat itself, not necessarily other engines. So Zugwunder now also collects its training data in games against other engines, on a Linux PC that plays around the clock. The next network will show whether that breaks through the 3000 barrier.

What's next

  • Network v6: for the first time, the training data does not come from self-play alone. Since 29 September 2026, a Linux PC has been playing Zugwunder against Stockfish around the clock, and the positions from these games will teach the next network what it cannot learn from itself. As always, v6 only replaces v5 if it proves stronger, this time also in games against Stockfish.
  • A public rating: once the engine has settled, the UCI engine is to be submitted to the rating lists, so that its strength is measured independently. Most of them test under Windows, so a Windows version of the UCI engine is planned for that.
  • More for engine users: pondering, Chess960 and a strength limit (UCI_Elo) for the UCI engine are not supported yet and are candidates for later versions.

Zugwunder updates itself: new versions, including new networks, are offered inside the app as soon as they are available.

Downloads

The current version of the Zugwunder app for Macs with Apple silicon: Zugwunder-1.1.6.dmg

The UCI engine on its own for Linux:
Zugwunder-UCI-1.1.6-linux-x86_64.tar.gz (Intel/AMD with AVX2)
Zugwunder-UCI-1.1.6-linux-aarch64.tar.gz (64-bit ARM)

Or play against Zugwunder right in your browser, without installing anything: Play Zugwunder online

To go with it, there is a lean chess interface for UCI engines called Wolfgang, which can be downloaded here: Wolfgang-1.0.11.dmg

It is named after my cousin Wolfgang, who taught me to play chess, and it is dedicated to him. Chess history knows a few famous Wolfgangs as well, among them the grandmasters Wolfgang Unzicker and Wolfgang Uhlmann.

Everything is free of charge, and the Mac downloads are dutifully notarised by Apple. Have fun!

home | top | rss