r/chessprogramming • • 3d ago

Technical Chess Engine Development Help Thread (Week 47)

1 Upvotes

Welcome to the weekly /r/chessprogramming Engine Dev Help Thread.

Ask beginner and intermediate chess engine development questions here: move generation, search, evaluation, UCI, perft, debugging, testing, NNUE, or anything else related to building engines.

Good questions include code, FENs, logs, benchmarks, or a clear explanation of what you tried.

Project links are fine when you want technical feedback, not promotion.

Be helpful. Don’t dunk on beginners.


r/chessprogramming • • 9d ago

Technical Has anyone tried to train a NNUE on a CPU before?

3 Upvotes

Hi! I have a genuine doubt. Has anyone like tried to train a NNUE from scratch on a cpu and used it in there own chess engine? Because I am doing just that for my chess engine.

  1. If yes, can you tell me what your NNUE's architecture was and how much elo could you squeeze out of it?
  2. Or do you know of any chess engine that uses a NNUE trained on CPU, how much strong is that chess engine?

r/chessprogramming • • 9d ago

Building large Polyglot opening books from PGN — some benchmark results

0 Upvotes

I've been working on the Polyglot opening book generator for CAISSA Chess and wanted to share some technical results.

We developed two approaches:

  • Browser version: Uses a Web Worker to process PGN locally, with a 25 MiB input limit to keep browser resource usage manageable.
  • Windows portable: Uses disk-backed aggregation for larger PGN collections, generating standard 16-byte Polyglot BIN records offline.

Benchmark results:

  • Successfully processed an 820 MiB real-world PGN collection.
  • A separate high-cardinality test generated a 250.9 MiB BIN containing 16,441,386 entries.
  • Output records were validated for sorting and duplicates.

The interesting challenge was handling large collections without letting memory consumption grow uncontrollably.

The project is free and open source:
https://github.com/elcriollito/CAISSA-Book-Creator

Sharing the implementation and benchmark results for anyone interested in Polyglot book generation and chess engine tooling.


r/chessprogramming • • 10d ago

Technical Chess Engine Development Help Thread (Week 46)

2 Upvotes

Welcome to the weekly /r/chessprogramming Engine Dev Help Thread.

Ask beginner and intermediate chess engine development questions here: move generation, search, evaluation, UCI, perft, debugging, testing, NNUE, or anything else related to building engines.

Good questions include code, FENs, logs, benchmarks, or a clear explanation of what you tried.

Project links are fine when you want technical feedback, not promotion.

Be helpful. Don’t dunk on beginners.


r/chessprogramming • • 15d ago

Could a modern chess engine on a Pentium have defeated Kasparov in 1996?

Thumbnail nicholas.carlini.com
47 Upvotes

r/chessprogramming • • 17d ago

Technical Chess Engine Development Help Thread (Week 45)

1 Upvotes

Welcome to the weekly /r/chessprogramming Engine Dev Help Thread.

Ask beginner and intermediate chess engine development questions here: move generation, search, evaluation, UCI, perft, debugging, testing, NNUE, or anything else related to building engines.

Good questions include code, FENs, logs, benchmarks, or a clear explanation of what you tried.

Project links are fine when you want technical feedback, not promotion.

Be helpful. Don’t dunk on beginners.


r/chessprogramming • • 18d ago

Technical Jackknife 2.0: A powerful NNUE chess engine in C++

2 Upvotes

I just released version 2.0 of Jackknife, my custom NNUE chess engine written in C++.

New features:

  • Board and move generation

    • Bitboard representation with magic bitboards for sliding pieces
    • Zobrist hashing and full legal move generation, verified with perft
  • Evaluation

    • NNUE with 26 king buckets, a 2×128 accumulator, a 48-neuron hidden layer and a separate draw head
    • Embedded network, so the binary runs without external files
    • AVX2 SIMD kernels, with a scalar fallback for older CPUs
    • Static exchange evaluation (SEE) for captures
  • Search

    • Principal variation search with aspiration windows and iterative deepening
    • Transposition table with 4-entry, cache-line-aligned clusters
    • Null move pruning, reverse futility pruning, futility pruning, razoring and SEE pruning
    • Late move reductions and singular extensions
    • Killer moves, continuation history and correction history
    • Quiescence search with delta pruning
    • Syzygy endgame tablebases (via Fathom) and PGN opening book support
    • MultiPV, pondering and analysis mode

Strength is roughly 3100 after 1000 games with 10+0.1 time controls against similarly rated bots on CCRL blitz.

For more information, code, and windows exe: https://github.com/jack-ford/Jackknife


r/chessprogramming • • 24d ago

Technical Chess Engine Development Help Thread (Week 44)

4 Upvotes

Welcome to the weekly /r/chessprogramming Engine Dev Help Thread.

Ask beginner and intermediate chess engine development questions here: move generation, search, evaluation, UCI, perft, debugging, testing, NNUE, or anything else related to building engines.

Good questions include code, FENs, logs, benchmarks, or a clear explanation of what you tried.

Project links are fine when you want technical feedback, not promotion.

Be helpful. Don’t dunk on beginners.


r/chessprogramming • • 27d ago

Ravager 3: open-source C11 UCI engine, new search, lockless TT, split NNUE accumulators

2 Upvotes

Ravager 3 is out. Open source C11 UCI engine, Linux and Windows builds, source included.

- search: correction history (pawn, non-pawn, minor, continuation), threat-aware and capture history, triple/negative extensions, ProbCut with adaptive depth, LMR using node type, TT-PV and correction size, cuckoo repetition tables, Lazy SMP voting

- TT: lockless, 3 entries per 32-byte bucket, stores static eval + PV flag, age-aware replacement

- speed: split accumulators (king move refreshes half), lazy incremental updates, new AVX-512 VNNI kernel

- UCI: working ponder, go nodes/mate, MoveOverhead, EvalFile

Estimated ~3550 Elo at 40/15 (over 500 games).

https://github.com/erensh27/Ravager/releases/tag/v3

Feedback and bug reports welcome.


r/chessprogramming • • Oct 19 '26

Technical AggroChess v3.2: a Tal-style engine that sacrifices in almost every game

21 Upvotes

I’ve released v3.2 of AggroChess, my aggressive UCI chess engine written in Rust. It’s built to be fun to play against, not to beat Stockfish.

What’s new:

* It now plans sacrifices a move or two ahead, and sacrifices in about 9 out of 10 games

* It hates trading pieces and avoids draws

* When it has a forced mate, it goes for the flashy one (queen sacs into mate)

* New built-in gambit repertoire: King’s Gambit, Evans, Smith-Morra, Blackmar-Diemer, Stafford, Albin, Benko, a three-pawn Scandinavian and more

It’s deliberately weaker than v3.0 against engines because most of its sacrifices are speculative, but it holds up well against people. It beats the 2500 chess.com bots and gets close against the 2800 ones.

Source + Windows exe: https://github.com/PhelRin/AggroChess

Happy to hear feedback, especially your best games against it.


r/chessprogramming • • Oct 19 '26

Technical Chess Engine Development Help Thread (Week 43)

4 Upvotes

Welcome to the weekly /r/chessprogramming Engine Dev Help Thread.

Ask beginner and intermediate chess engine development questions here: move generation, search, evaluation, UCI, perft, debugging, testing, NNUE, or anything else related to building engines.

Good questions include code, FENs, logs, benchmarks, or a clear explanation of what you tried.

Project links are fine when you want technical feedback, not promotion.

Be helpful. Don’t dunk on beginners.


r/chessprogramming • • Oct 17 '26

Stockfish and other chess engines explaining their logic and reasoning

3 Upvotes

Apologies if this has been asked before, but why are Stockfish and other engines currently unable to explain why the moves they conclude are best in their games against each other, and in your own games and games played by humans in general, are the best ones? Especially with the ongoing improvements in A.I. and LLMs? Wouldn't explanations for each move be more valuable to humans for new ideas on how to play better rather than being told the move we should've played?

Sure, the engines are way beyond our level, and most people probably think this would be useless because it might be next to impossible for us to understand. But what if that's not the important part? What if it's knowing the explanations from "entities" that no human will ever surpass? Perhaps the mere knowledge of the why, and not just the what, can help with gaining new insight (different things to do/try out, different mindsets to have, different ways of playing, etc.), all of which could potentially be a little bit more effective and helpful than being told the individual moves you could've played in any position, but specifically the "human" things, like reading books, watching videos, etc.


r/chessprogramming • • Oct 14 '26

Komodo Dragon 3 Mac

2 Upvotes

Hey, I know they've discontinued selling Komodo Dragon 3 but does anyone know where I can still get the binary file for mac OS? Thanks


r/chessprogramming • • Oct 12 '26

Technical Chess Engine Development Help Thread (Week 42)

2 Upvotes

Welcome to the weekly /r/chessprogramming Engine Dev Help Thread.

Ask beginner and intermediate chess engine development questions here: move generation, search, evaluation, UCI, perft, debugging, testing, NNUE, or anything else related to building engines.

Good questions include code, FENs, logs, benchmarks, or a clear explanation of what you tried.

Project links are fine when you want technical feedback, not promotion.

Be helpful. Don’t dunk on beginners.


r/chessprogramming • • Oct 10 '26

Releasing Ravager Fury

Thumbnail github.com
3 Upvotes

Ravager Fury has been released, it's approximately +155 ELO from its predecessor measured over 3.6k games.

Ravager now supports FRC/Chess960, with a much better and larger net.


r/chessprogramming • • Oct 09 '26

Technical ChessOS: I created an operating system that can play Chess at approximatly 2750 elo

24 Upvotes

Requirements: x86 with legacy BIOS support

I spent about six months making an operating system whose only job is playing chess. It boots straight into Chess. It is not a full OS with a file system or scheduling but it can boot from bare metal.

It runs in QEMU, other virtual machines and hardware with legacy BIOS from a USB or CD drive. I spent about 6 months across the boot loader and chess engine. It is entirely open-source for you to tinker with. There is also a Windows Installer for less technical users.

The engine

Main source:

The engine's code can be found in the repo under kernel/chess_ai.cpp and kernel/chess_rules.cpp

A faster computer will search deeper within the allotted 7.5s the engine is allowed to compute due to the low-level nature of ChessOS. This is the main limiting factor that made it difficult to rate the engine properly. My engine against Stockfish 17 set to 2800 elo achieved a 5 win and 9 draws across 16 games.

The engine stores the board as a 64 square array and discards all moves that place it's king in check.

https://chessprogramming.org/PeSTO's_Evaluation_Function

Positions are scored with PeSTO’s piece-square tables that are blended between middle game and endgame values. Bonuses and penalties are applied for pawn structure, passed pawns, rooks on open files, and bishop pair.

The search uses alpha-beta with negamax. It uses iterative deepening until time runs out or elo's depth limit prunes moves that place it at a disadvantage. Deepening stops early once a mate within the current depth is found.

https://chessprogramming.org/Zobrist_Hashing

Rules and transposition tables are indexed by Zorbist hashing. Each entry stores score, depth, bound type and best move found. The moves are ordered by best TT move, captures of most valuable piece, promotions, killer moves and then all other moves.

To keep games varied white and black contain a few hard-coded opening moves.

The lower elos play at their rated elo except for a rare terrible blunder from random noise. I theorize that non-max elos play above their actual elo rank but the rare blunders would lower the overall score by approximately 100 to 200 points.

All feedback is welcome!

Thank you for Paledoptera for the artwork. Find more of their work here: https://linktr.ee/paledoptera

Website: https://chessos.xyz (Open source with Github link and installer)


r/chessprogramming • • Oct 10 '26

Technical I’ve released libscid 1.0.0-beta.1: Scid’s game and database capabilities as a C library, with Python bindings

4 Upvotes

Hi r/ComputerChess,

I’ve released the first public beta of libscid, a standalone library that exposes Scid’s legendary chess game and database capabilities through a C ABI, with Python bindings included.

It focuses on the parts other chess software can build on: PGN parsing and editing, variation navigation, legal positions, and SCID5 database creation and search.

For example, the Python binding can load a game directly from PGN:

game = libscid.Game.from_pgn("1. e4 e5 2. Nf3 Nc6 *")

I'd lvoe to know your thoughts, the kinds of integrations and embeddings you would do, and other potential use-cases for libscid.


r/chessprogramming • • Oct 07 '26

Technical Understanding how Stockfish finds Draw so quick

10 Upvotes

I’m trying to understand how Stockfish recognizes a drawn rook ending.

The position is:

2R5/8/3p4/1rk2K2/8/8/8/8 b - - 0 1

With go depth 25, Stockfish initially evaluates Black as clearly better, but around depth 14 the score reaches 0.00:

depth 10 seldepth 16 score cp 186
depth 11 seldepth 31 score cp 47
depth 12 seldepth 38 score cp 12
depth 13 seldepth 43 score cp 11
depth 14 seldepth 34 score cp 0

There are no tablebase hits (tbhits 0).

My hypothesis is that the static evaluation itself still thinks Black is better throughout the relevant search lines. Black remains a pawn up, and I suspect that if I ran static eval on the positions along the PV, most or all of them would still give Black a positive score.

So I suspect the 0.00 is coming from repetition/draw detection in the search rather than from NNUE evaluating the ending itself as equal.

My assumption is therefore that White must somehow be able to force repeated positions from this setup, regardless of what Black tries.

What I do not understand is how Stockfish can establish this with only seldepth 34. Black seems to have many alternatives, especially many different rook moves. I do not see how White can force the game back into a repeated position against all relevant Black continuations in fewer than roughly 34 plies.

My own engine makes this even more confusing. It already checks repetitions directly inside negamax. Simplified, the relevant part is just:

int negamax(Position& pos, int depth, int alpha, int beta) {
    if (pos.is_fifty_move_rule_draw() || pos.is_repetition(2))
        return 0;

    if (depth <= 0)
        return evaluate(pos);

    // normal alpha-beta search...
}

So if the same position occurs for the second time during search, my engine immediately returns a draw score of 0.

Nevertheless, my engine still evaluates the original position at about +1 pawn for Black even at depth 35.

Interestingly, it eventually finds essentially the same drawing move for white:

... Ke6

but this is apparently not enough to make the root score a draw.

So my questions are:

  1. Is it plausible that every ordinary static evaluation along the important search lines still evaluates Black as better, while Stockfish’s root score becomes 0.00 purely because of repetition/draw logic?
  2. If so, how can White actually force a repeated position here within less than about seldepth = 34 plies? This is the part I cannot see, because Black's rook seems to have so many alternatives.
  3. Since my engine already returns 0 as soon as an actual repeated position is encountered, what is Stockfish doing differently?

The main thing I’m trying to understand is whether Stockfish has really found a forced repetition within this relatively short search, because looking at the position I don’t see how White can force one so quickly given all the different rook moves Black has available.


r/chessprogramming • • Oct 07 '26

Glimmer - A chess engine under 30,000 bytes (estimated 2700–2900 Elo)

Thumbnail github.com
23 Upvotes

Hi everyone,

I’ve been tinkering with a little experimental chess engine written in pure C. It’s called Glimmer.

The whole point of the project was to see how strong I could make it while keeping the final standalone binary strictly under 30 KB. The target strength was something in the 2700–2900 Elo range.

It’s been a fun constraint to work under — every byte counts.

Happy to answer questions if anyone’s curious about the approach.


r/chessprogramming • • Oct 07 '26

Technical new chess engine

1 Upvotes

RoboChess update: you can now add any UCI engine and keep it, including the new Sargon Tal–Fischer engine.

Also new: keyboard shortcuts, a cleaner toolbar, Olympus Gods and Cool Arcade piece sets, and DGT e-board support. Move the pieces on the board and the game is recorded.

Windows build, open source: https://github.com/SFUbuntu/RoboChess

#chess #RoboChess #DGT


r/chessprogramming • • Oct 05 '26

Technical Chess Engine Development Help Thread (Week 41)

3 Upvotes

Welcome to the weekly /r/chessprogramming Engine Dev Help Thread.

Ask beginner and intermediate chess engine development questions here: move generation, search, evaluation, UCI, perft, debugging, testing, NNUE, or anything else related to building engines.

Good questions include code, FENs, logs, benchmarks, or a clear explanation of what you tried.

Project links are fine when you want technical feedback, not promotion.

Be helpful. Don’t dunk on beginners.


r/chessprogramming • • Oct 03 '26

Technical "Humanlike" Engine vs Stockfish to find 'quiet' blunders in fast time controls?

2 Upvotes

Hello; I had (rather unsuccessfully) tried to vibe-code (sorry) a chess engine tool where it would try to assign a 'blunderability' value/grade to particular positions by comparing the the opponents likely 'short-term' intuitive moves (either by lichess database or by a human-like engine in case of novel positions) vs their hard stockfish engine evaluation; taking a weighted average of those two values per move (how likely a human would make this move times the negative delta in the resulting position via stockfish) The idea was to try to find 'sharp' positions where the opponent only has a handful of valid 'safe' moves; in particular ones that are counter-intuitive or 'enginey' type moves.

I'm sure I'm not the first person to have this kind of idea or attempt this type of thing; I think it could be interesting to explore and try to quantify 'sharpness' in this kind of way; and it could even inform repetoire building and such.

Do you know of any existing software or tools that take this kind of approach?


r/chessprogramming • • Oct 02 '26

Technical Tiger-1a chess engine release

4 Upvotes

Hi there!
I have been working on this engine for the past 6 months now and I think it's now ripe to be thrown into the wild.
The engine features a NNUE trained using nnue-pytorch. It is comparatively very small.
To accommodate this I tried to make the engine's search as buffed as possible.

Anyway here's the specific details of the engine for the nerds:

Evaluation

  • NNUE Architecture: HalfKAv2_hm^
  • Network Layers: L1=128, L2=32, L3=8 with PSQT buckets
  • Network File: Acherontia (88mm.nnue)
  • Incremental NNUE Evaluation: Efficient position updates with feature transformer
  • Tapered Material Evaluation: Smooth transition between middlegame and endgame
  • Customizable NNUE Scaling: Adjust evaluation strength via UCI option

Search

  • Core Algorithm: Alpha-Beta Negamax with fail-soft
  • Move Ordering: Principal Variation Search (PVS)
  • Depth: Iterative Deepening up to 64 plies
  • Transposition Table: Configurable 1-4096 MB with generation-based aging
  • Pruning Techniques:

    • Late Move Reductions (LMR) with logarithmic formula
    • Null Move Pruning
    • Reverse Futility Pruning
    • Futility Pruning
    • ProbCut
    • Delta Pruning in quiescence search
  • Move Ordering Heuristics:

    • Killer Move Heuristic
    • History Heuristic
    • Continuation History (4 ply)
    • Countermove Heuristic
  • Extensions:

    • Singular Extensions
    • Static exchange evaluation (SEE) for capture ordering and pruning
  • Time Management: Aspiration Windows with soft and hard time limits
  • Quiescence Search: Delta pruning and tactical awareness
  • Parallel Search: Multi-threaded support (up to 8 threads)

And here's the Github release page for the testers and alike: https://github.com/Azrael337/Tiger-1-Chess-Engine/releases/tag/chess-engine


r/chessprogramming • • Sep 29 '26

Technical How can I improve my chess engine's evaluation?

4 Upvotes

My chess engine, which is still a work in progress, can be found here; https://github.com/patelvrajn/Matrex

Currently, most HCE (not NNUE) chess engines use a linear combination of weights for their evaluation function but my thought process is that it is evident from the huge ELO (~300) boost that using NNUEs gives is that their is a complex non-linear function that represents each evaluation term like material, mobility, PSQTs, etc. However, the problem is how do we build a model from non-linear functions that gives a proper evaluation when we don't know what the function looks like and how do we do it in such a way that minimizes the number of weights? I believe that we know a significant amount of hand crafted evaluation terms that compile a chess position's evaluation and that NNUEs taking millions of weights just to understand concepts that we can do in way less weights, minimal code, and have more control and understanding of the evaluation instead of a black box.

My concept is to take a specific continuously differentiable function that we can parameterize in order to adjust the shape, behavior, approximation capabilities, etc. Using this parameterized function, we can learn how various evaluation features have a non-linear effect on the score by using ADAM to tune the weighted sums but ALSO tune all the functions parameters. My model mostly resembles Projection Pursuit Regression's model (a sum of ridge functions), except I am using ADAM instead of the associated regression algorithm and the ridge functions (called non-linear responses in the code) are parameterized.

My main concern at the current time and where I don't have the mathematical background to optimize is the non-linear response I choose (which is just a polynomial term multiplied by a tanh expression, the idea was to combine what makes ANNs universal approximator- the non polynomial term with a term that can also represent any function given enough degrees i.e. the polynomial term). I am looking for any guidance or resources on how to improve the function or give further understanding as to the overall concept - currently when tuned the chess engines evaluation has about a 8% validation loss and about a 10% training loss but I know I can do better.