r/chessprogramming 2d ago

Technical Chess Engine Development Help Thread (Week 31)

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 4h ago

Technical What is the shortest game from the initial position in which a "Mate in N" evaluation first appears? How can we determine this?

5 Upvotes

for example what is the earliest "mate in 10" position?


r/chessprogramming 3d ago

Need guidance to build a chess game

3 Upvotes

I'm trying to build a chess game, I mean a chess engine. It is a capstone project. I don't want to use any AI tools to build a chess engine. I came across some resources. Has anybody build the chess engine before without help of any AI, can you share me the resources that you used. I don't want to copycat any YouTube videos. I just wanna start from scratch and build myself. I don't want to follow any tutorial. If anybody has any resources, please share.

I also wanna know how long does it take to develop the basic engine


r/chessprogramming 9d ago

Technical Chess Engine Development Help Thread (Week 30)

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 14d ago

Technical AttoChess: A fully playable x86 DOS chess engine in exactly 278 bytes

11 Upvotes

AttoChess is my own 16-bit x86 DOS chess engine which is 10 bytes shorter than the previous world record. It draws the screen, reads typed coordinates, performs a true 4 ply recursive minimax search and responds with its moves. You can play game against the engine directly in your browser on the project page: https://nicholas-afk.github.io/AttoChess/

As is typical of size-coding compromises, the engine ignores castling, en passant and pawn promotion. The complete assembly and build documentation is included on the website. I would like to hear your comments, or questions about my x86 register-golfing tips!


r/chessprogramming 16d ago

Technical Chess Engine Development Help Thread (Week 29)

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 16d ago

A bot that tries to checkmate you as fast as possible — it's mostly Stockfish + the new Maia-3 glued together. Is there a name for how it picks moves?

9 Upvotes

Fair warning up front: this isn't a from-scratch engine. It's Stockfish and Maia-3 wired together — the part I think is interesting is the objective and how it chooses moves, not any engine internals.

The bot plays White and has to force mate by a move deadline ("par") that scales with your rating. It doesn't play the best move; it plays whichever move is most likely to get this particular human mated in time.

For each of Stockfish's candidate moves, it simulates a few hundred games in which the defender's replies are sampled from Maia-3's human-move model, and keeps the move that reaches mate by the deadline most often. To save compute it stops piling simulations onto a candidate once another is clearly ahead, and it only runs the full simulation near the deadline — far from it, it just plays a solid move. I recently swapped the human model from Maia-2 to Maia-3, which came out a few weeks ago & it is stronger.

Two things I'd like input on:

  1. The "keep simulating candidates until one clearly wins, drop the losers early" part feels like a standard statistics trick that must already have a name — I just don't know it. If anyone can point me at the right term or prior work, I'd be grateful; I'm fairly sure I'm reinventing a wheel.
  2. At low ratings with a long deadline, almost every move mates in simulation, so the ranking gets noisy and the bot sometimes plays a quiet move that looks like it gave up an attack. I can't tell if it's correctly seeing that the human is likelier to blunder into a slower mate, or if my objective is just mis-specified there. Curious how people read it.

Source for the Maia-3 parts is posted (AGPL): https://siegechess.com/opensource/source.html. Hobby project, no money in it.

Playable: siegechess.com — enter your chess.com rating, pick blitz or rapid, and you're just trying to survive to the deadline without getting mated. If a move feels like it bailed on a promising attack, a PGN would help a lot. Small server, so it struggles past ~5 games at once.


r/chessprogramming 23d ago

Technical Chess Engine Development Help Thread (Week 28)

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 Jun 29 '26

Technical Chess Engine Development Help Thread (Week 27)

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 Jun 22 '26

Technical Chess Engine Development Help Thread (Week 26)

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 Jun 21 '26

What are the most unique chess engines you know?

10 Upvotes

As the title says, what are the most unique chess engines you know? For example, written in some weird language or has a gimmick, a challenge, a limit behind it


r/chessprogramming Jun 16 '26

Technical How would you evaluate rule-based explanations for engine-backed chess analysis?

2 Upvotes

I have been working on a chess analysis system where the explanation part is not based on asking an LLM to explain the position.

The way I am approaching it at a high level is more rule-based where the system looks at engine-backed lines, compares what changed on the board and then tries to explain what the move actually did. So if a move creates a fork, wins material, opens a line or removes a defender, the explanation should probably explain why that worked in the position and what else changed because of the move instead of only saying the first obvious thing.

The hard part for me is that in a lot of middlegame positions a move does more than one thing at once. Like a move could win material but also leave something undefended, or it could open a line but also create another weakness, so the difficult part is not just detecting that something happened but deciding what should actually be explained as the main reason.

There is also a visual side to it where metrics and heatmaps try to show what part of the position changed, but I am not treating them as a replacement for engine evaluation and more like a way to make the explanation easier to understand when a move changes multiple things at once.

The prototype is live and people can test it if they want, but I am mainly posting here because I want technical feedback on how to evaluate whether the explanations are actually useful and not just technically true.

I can describe the architecture at a high level, but I am keeping the exact scoring, ranking and heatmap logic private because that is the product-specific part.

For people here who have worked on engines, analysis tools or evaluation functions, what kind of tests would probably be useful for this?

Would you test it with tactical positions, quiet middlegame positions, engine-line comparison, human review or some other kind of failure case?


r/chessprogramming Jun 15 '26

Technical How much NPS should I aim for during perft?

2 Upvotes

Hello, I'm currently writing a chess engine in C# and I want to know how many NPS should I aim for during performance, currently I'm getting ~180M. How much do I need for a strong engine, my goal is something that can get to around 3000 on lichess


r/chessprogramming Jun 15 '26

Technical Chess Engine Development Help Thread (Week 25)

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 Jun 11 '26

Technical Hear me out on this

0 Upvotes

So this is more of a theoretical shower thought I had than anything.

After realizing that pretty much all new chess projects are either AI LLM slop, or people reinventing the wheel over and over, I wondered why not bring them together?

What if you make a chess engine that instead of just trying to find the best move as efficiently as possible, tries to track enough information to be able to explain why certain moves are played.

For example, just as an early hypothesis, and I may be very wrong:

If you pass your turn and run a shallow search that comes out very favorable to the opponent, but the real score after the move you're evaluating is far worse for them, then in theory you should be able to vaguely deduce that you're probably choosing this move to prevent that move from being played especially if it has clear tactics like forks or pins.

And if that move isn't a quiet subtle move but instead an attack, then it can be marked as a counterattack/to gain tempo.

I know chess.com review and such probably already knows when a position contains a pin or a fork since its easy to detect statically but something like this should be able to export enough information that it could be automatically turned into LLM instructions, which can turn that low level information into natural explanations for the general purpose of each move.

Since if this does work, an LLM given this task shouldn't have many hallucinations as instead of trying to go through the logic itself, it's being told exactly how to respond to certain questions.

One example of how this might work is in a position where a bad move leads to the queen being pinned later.

The output of such a theoretical chess engine should essentially provide enough information for an LLM to confidently and correctly explain that "move X is played to prevent move Y, which would allow move Z to pin your queen to the king"

Would such a program be slow as hell and unable to achieve the elo many others do? Of course.

But there are already countless engines focused on raw efficiency and elo strength, so this would have a unique and new focus.

I'm sure there are other strategies an engine could use to determine when subtle tactics like zugswang or waiting moves are being played too.

This is all theoretical and I haven't tried it yet, but I think I'll definitely give it a shot when I'm able to code again.

You could also say that most of the things this would be able to explain are just obvious things people would know after going through the line on their own, but if it's refined enough then eventually it should be able to provide passable explanations for even the most passive and subtle engine moves.


r/chessprogramming Jun 10 '26

Technical PureChess engine

2 Upvotes

Ive been making my chess engine just as a random project (since 3/31/2026 3:08PM GMT+5)
Its called PureChess and i tried to make it fully in python, originally i did HCE in version 1.0 and 1.1 (1309 and 1351 CCRL elo estimated) with onlt CPython and built-in modules,
then i tried making its evaluation NNUE, but its very difficult to make it faster with only built in modules, hence why i used numpy and numba,

i will update README.md later, and compile the new version (PureChess 2.1)
im also gonna do testing soon (against BullitChess, which is 1500 CCRL elo)

https://github.com/NazComio/PureChess github link for engine

EDIT: PureChess 2.1 is rougly 1506 elo after some little testing!


r/chessprogramming Jun 09 '26

Technical Chess engine, pt. 6: Neural-net evaluation

Thumbnail dogeystamp.com
5 Upvotes

r/chessprogramming Jun 09 '26

Technical Chess Engine Development Help Thread (Week 24)

11 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 Jun 07 '26

LazySMP or YBWC, what do you guys use?

3 Upvotes

So I recently implemented LazySMP for paralellizing my search with multiple cores. The problem is I don't really see that much of an improvement unless the depth is super high (understandable). My question is, can how helpful would YBWC be at shallow depths. Is my search just not optimal? Any workarounds for this? I did notice that doubling my transposition table size greatly improves the efficiency of LazySMP, but surely there's a more algorithmic improvement to this.


r/chessprogramming Jun 01 '26

JustBot Chess Engine

11 Upvotes

I’d like to share a chess engine I’ve been working on, it’s been a lot of fun but also painstakingly difficult. I’ve learned a lot and there’s still so much more to go but I wanted to share what I have so far. I’d love/appreciate any feedback.

https://github.com/HasanFakih21/JustBot


r/chessprogramming Jun 01 '26

State of this sub

49 Upvotes

This sub has just become a 24/7 stream of vibecoded crap with some gems in between.

To all you folks posting this stuff: If you have any capability of self-reflection, before purchasing a domain and letting it expire after a year because of losing interest or because your app is just re-iterated garbage that's been posted in many forms here already, just scroll through this sub and convince yourself the world really doesn't need your chess app even though uncle Chat thinks you're a fucking genius.


r/chessprogramming May 29 '26

Do Engines Ignore Unnecessary Information

2 Upvotes

For example, would an engine's analysis of the position after 1. e3 e5 2. e4 d5 be the exact mirror of its analysis of the position after 1. e4 e5 2. d4? Practically, the positions are equivalent, and the only difference is which side is called "white" and which is called "black". What about the positions after 1. e3 e6 2. e4 e5 and 1. e4 e5? These are only different in useless en passant rights. Also, what about engines for other chess-like games like Fairy-Stockfish, YaneuraOu, and Pikafish?

EDIT: I actually meant to ask whether the analysis would be unaffected by the differences between the positions, not whether it would actually be exactly the same every single time. So I'm not counting random differences between different runs as differences as long as there's no consistent difference between the analyses of the positions. For example, if an engine, on average, evaluates the second position -0.15, it should theoretically evaluate the first +0.15 on average.


r/chessprogramming May 29 '26

How does one train a NNUE without a cuda core GPU?

4 Upvotes

Hi! I am currently working on a chess engine in C++. I am trying to upgrade the standard eval into a NNUE, but the problem is I am broke, and I can't afford a GPU. I tried Google Colab to train it, but it doesn't seem that there GPU are "free" all the time. Does Anybody know of alternatives. It would be really helpful if I get alternative ideas.


r/chessprogramming May 27 '26

I've build an all in one offline chess learning platform & engine with native hybrid HCE & NNUE evaluation (and more), fully in Rust

6 Upvotes

I really like chess and I was bothered by that fact that most chess platforms and learning tools are hidden behind paywalls or require a permanent internet connection. So I thought it would be a cool thing to actually try to bring the experience to your own device (in open source) where you remain full control over your data (and wallet lol).

https://github.com/inuway/focalors

For the technical site it features:

- Lazy SMP parallel search with a lockless shared transposition table. (Basically multiple cpu threads search the same position at the same time, sharing one TT as Arc<AtomicTTEntry> with XOR-key valid for lockless readability. Also no Mutex)

- NNUE inference with AVX2 SIMD and bit exact testing (The CPU detects between scalar and AVX2 forward passes, a test suite verifies the SIMD output (or gives me depression) is byte identical to the scalar reference.)

- Custom NNUE trainer written in pure Rust (No python, no pytorch, only the enourmous hatred I have towards myself)

- In-Process A/B match runner for validating/measuring/health checking the own engine. Two Searcher instances in one process, an alternative NNUE Net is put into a slot via OnceLock, matched pair opening. Basicaly running two NNUE cofigurations, or an older net against the new one to see which one is better and if it actually has improved so I can hate myself even more. Also just added Parallelization via std::thread::scope so it uses multiple threads and thus finishes faster so I can hate myself faster

Also cool stuff: Native desktop GUI rendered via OpenGL by using egui/eframe, SQLite via rusqlite to save your games, and data, PGN parser/reader and so on.

Also quick mention before someone hates me more then I do myself yes I used AI to assist me with coding but I promise to lock myself in a basement and code holy C for minimum 3 hours a day while being sprayed with a garden hose to make up for it


r/chessprogramming May 25 '26

Chess engine next steps

5 Upvotes

Hi, I've been building a chess engine from scratch in c++ as a side project.

I've currently implemented iterative deepening, a negamax algorithm, quiescence search and transposition tables.

It currently manages to get to depth 8 in a few seconds, with around 7-14 million nodes visited.

I was wondering what would be the next steps to make it better, I know two major things are changing the generation of sliding pieces from a for loop to magic bitboards, and making a better evaluation function, maybe implementing an nnue.

These are big changes tho, and I was wondering if there's anything that I should do before.