Zaraki Engine written in Zig

Discussion of chess software programming and technical issues.

Moderator: Ras

Timojanne
Posts: 2
Joined: Sat Mar 07, 2026 10:44 am
Full name: Timo Jokinen

Zaraki Engine written in Zig

Post by Timojanne »

Hi :)

A while ago I started getting into chess programming, writing a legal move generator in JS as my final project for school. Recently I started to pick up chess programming again and decided to write a full engine in Zig. I'm very much a beginner and I haven't worked with lower-level languages before, so this project is a challenge for me both in respect to the language and to chess programming. Nevertheless I'm at a point where I want to post about it here. All of the source code is based on the chess programming wiki, there is no novelty in regards to heuristics or algorithms but the source code is handwritten by myself.

I haven't identified the engine's current elo rating yet but it manages to win a bit more than half of games out of 1000 against Stockfish 1800 Elo.

What's included:

Board Representation
- Bitboards for piece sets
- Incremental make/unmake
- Null move make/unmake
- Incremental Zobrist hashing
- FEN parsing
- Compact 16-bit move encoding

Search
- Negamax alpha-beta
- Iterative deepening
- Aspiration windows
- Principal variation tracking
- Quiescence search with SEE Pruning, standpat
- Transposition table
- TT exact / lower-bound / upper-bound node types, always replace
- Hash move ordering
- Null move pruning
- Late move reductions
- PVS-style zero-window search on later moves
- Check extension
- Mate score normalization for TT storage
- Basic time-based stop check during node polling

Move Ordering
- Hash move
- Queen promotions prioritized
- Capture ordering with MVV-LVA
- SEE-based capture discrimination
- Killer heuristic
- History heuristic
- Selection-sort style pick-next move loop

Evaluation
- PeSTO-style tapered PST evaluation
- Middlegame / endgame interpolation by phase

You can find the source code here:
https://github.com/timojokinen/haraki-zig

I would be happy to hear the community's thoughts.
syzygy
Posts: 6030
Joined: Tue Feb 28, 2012 11:56 pm

Re: Zaraki Engine written in Zig

Post by syzygy »

Timojanne wrote: Mon Jun 22, 2026 3:34 pmbut the source code is handwritten by myself.
If that is what you did, why did you let an LLM generate this post?
Timojanne
Posts: 2
Joined: Sat Mar 07, 2026 10:44 am
Full name: Timo Jokinen

Re: Zaraki Engine written in Zig

Post by Timojanne »

I don't know what to say, I wrote the intro text myself and had the techniques and heuristics be enumerated by an llm because I was lazy. I also used AI to understand concepts better and write a README. Believe what you want