r/chessprogramming 9d ago

Technical Chess Engine Development Help Thread (Week 35)

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.

1 Upvotes

2 comments sorted by

View all comments

1

u/Fun-Cable-4849 8d ago

I’m reviewing a move-classification approach built on top of Stockfish and would like some opinions on a few assumptions.

Current setup:

- fixed depth 12

- single PV

- exact PV1 match = `best`

- otherwise classification is based on win-chance loss

- thresholds:

- `< 0.10` good

- `>= 0.10` inaccuracy

- `>= 0.20` mistake

- `>= 0.30` blunder

A few questions:

  1. Is fixed depth 12 generally too unstable for move classification?

  2. Would a fixed node budget be preferable to fixed depth?

  3. Is treating only the exact PV1 move as `best` too strict when several moves are nearly equivalent?

  4. Is MultiPV a good way to detect equivalent strong moves, or is there a better approach?

  5. How do you usually handle moves that land very close to classification thresholds?

Example:

FEN:

`rnbqk2r/ppp2ppp/4pn2/3p4/1b2P3/2NP1N2/PPP2PPP/R1BQKB1R w KQkq - 4 5`

Played: `a3`

Engine first move: `e5`

Eval: `+0.37 → -0.73`

Win-chance loss: `0.2016`

With a `0.20` mistake threshold this gets classified as a mistake, but it’s obviously sitting right on the boundary.

Curious how people here would approach these tradeoffs.

1

u/Burgorit 8d ago

I have very little experience with move classification, but I have a few ideas you could try plus some answers to your questions.
1. I would say depth 12 is generally too little for serious analyis, stockfish on my machine reaches depth 12 in 79ms on startpos.
2. I think a fixed node budget of something like 10 million is probably good.
3. You could have a small threshold of like 0.025 or something where if the played move is within that threshold of the best move then it could be classified as 'best'. Given that evaluations change as well the second best move could become the best move with deeper analysis, so I find it fair to give a small margin to give out best moves.
4. Pretty sure multipv is the current best way.
5. No idea

Keep in mind that analysing from the end and going backwards generally leads to stronger analysis, this is because stockfish can save information about what will happen later in the game and use it, whereas starting from move 0 won't give as much info.

You could try experimenting with lc0 instead of stockfish, since it uses wdl natively it will be more accurate. I'm not sure whether lc0 shows this but mcts engines generate a probability distribution of what it thinks the best move is likely to be, so if you can get that information it will likely be more accurate than using multipv.