When I build a chess engine I want this experience to be also transferable to other games or programs.
Such algorithms as Minimax, Alpha Beta Pruning, Iterative Deepening, Principle Variation, Killer Moves and Search Killers are not chess specific and therefore they are transferable.
The problem of the Horizon effect is not chess-specific as well. But the solution - Quiescence - is a chess-specific heuristic.
Is it possible to create a solid engine without it?
Is it possible to create a good engine without Quiescence?
Moderator: Ras
-
jaroslav.tavgen
- Posts: 24
- Joined: Fri Oct 25, 2019 2:51 pm
- Full name: Jaroslav Tavgen
-
lithander
- Posts: 924
- Joined: Sun Dec 27, 2020 2:40 am
- Location: Bremen, Germany
- Full name: Thomas Jahn
Re: Is it possible to create a good engine without Quiescence?
It probably depends on your definition of solid. If you want a strong engine you want to explore the game tree selectively: stop hopeless lines early and explore lines that could be the PV deeper. At the end of such a line you have to assign a score to a leaf-node somehow with a suitable heuristic. Otherwise not even Minimax would work. It's hard to come up with a good heuristic for positions that are not quiet e.g. where exchanges are possible because these exchanges can be an absolute game changers but their outcome isn't obvious without search. So a straight forward solution is to just not make such a node a leaf node yet and selectively search tactical moves some more until no winning or losing exchanges are possible.
This is not much different to how selectivity works outside of Q-Search in a strong engine: You typically explore captures first in MVV-LVA order. You apply SEE (Static Exchange Evaluation) to prune bad captures. You would reduce late moves which are usually quiets that are not known to be promising (indicated from Killer, Continuation, History) which means you chose to not search them or search them less deep: Exactly the same thing that Q-Search does...
Imho Quiescence isn't any more chess specific than the idea of reductions and expansions and limiting static evaluation to certain types of leaf nodes.
This is not much different to how selectivity works outside of Q-Search in a strong engine: You typically explore captures first in MVV-LVA order. You apply SEE (Static Exchange Evaluation) to prune bad captures. You would reduce late moves which are usually quiets that are not known to be promising (indicated from Killer, Continuation, History) which means you chose to not search them or search them less deep: Exactly the same thing that Q-Search does...
Imho Quiescence isn't any more chess specific than the idea of reductions and expansions and limiting static evaluation to certain types of leaf nodes.
-
ericlangedijk
- Posts: 51
- Joined: Thu Aug 08, 2013 5:13 pm
Re: Is it possible to create a good engine without Quiescence?
Interesting question. With a good SEE function it is maybe possible.
-
hgm
- Posts: 28441
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Is it possible to create a good engine without Quiescence?
There exists a version of LeelaChess Zero that 'searches' only a single node. So definitely no queiescence search, it just plays the move the neural net recommends. And it scores ~50% against Fairy-Max, virtually always after reaching a huge advantage (+3 or +5). But in half the cases it blunders that away by missing a tactical shot.
This goes even beyond evaluation; an engine that plays by evaluation alone would have to search a node for any legal move, to evaluate there, and then play the one it likes best. In this case the NN directly recommends the move.
So yes, it is deffinitely possible to replace conventional QS by something else in a chess engine. QS was just a smart work-around for the problem that a simplistic evaluation function that only counts material that is now on the board fails miserably when some of that material is hanging. Such an evaluation function only works in 'quiet' positions. If no captures are possible, this is a guarantee no pieces are hanging. And by searching captures indefinitely is a guarantee you eventually run out of these. So without significant effort of the programmer it solves the problem.
But one can of course design a smarter static evaluation than just adding up piece values. E.g. by counting number of attackers and protectors, and testing for attacks of low-valued pieces on higher valued, you can try to make a reasonable guess on whether the side to move will immediately grab some material without repercussions, and correct the current material counts for that. Neural nets are smart, and might pick this up during their training.
Micro-Max (and the Jocly AI) have a simplified QS: only consider capture of the last-moved piece. This is enough to avoid most pf the ridiculous play you would get from minimax without QS (where the engine tries to manouevre such that on the last ply it can sacrifice its Queen for the highest piece it can get). I can add that in some chess variants, in particular those with many very powerful pieces, conventional QS (MVV/LVA, SEE, pruning of bad captures) completely explodes, and to get any depth in the full-width search up to QS one has to restict move choice and / or QS depth.
In fact one should reverse the definition: a game position is quiet when the static evaluation does a good job on it. It entirely depends on the game how hard it is to evaluate positions. Chess is a very easy game for computers, because the evaluation is for 90% material, and in most positions it is hard to change the material balance to your advantage. Games like Go are extremely hard to evaluate. Shogi is already much more difficult than chess, because King safety is much more important than material, and conventional capture search tends to make the positon less quiet, as piece in hand offer a much larger threat to the Kings than the pieces this removes from the board. So basically there are no quiet positions. In games like Reversi/Othello this is even more clear; all legal moves are captures there!
This goes even beyond evaluation; an engine that plays by evaluation alone would have to search a node for any legal move, to evaluate there, and then play the one it likes best. In this case the NN directly recommends the move.
So yes, it is deffinitely possible to replace conventional QS by something else in a chess engine. QS was just a smart work-around for the problem that a simplistic evaluation function that only counts material that is now on the board fails miserably when some of that material is hanging. Such an evaluation function only works in 'quiet' positions. If no captures are possible, this is a guarantee no pieces are hanging. And by searching captures indefinitely is a guarantee you eventually run out of these. So without significant effort of the programmer it solves the problem.
But one can of course design a smarter static evaluation than just adding up piece values. E.g. by counting number of attackers and protectors, and testing for attacks of low-valued pieces on higher valued, you can try to make a reasonable guess on whether the side to move will immediately grab some material without repercussions, and correct the current material counts for that. Neural nets are smart, and might pick this up during their training.
Micro-Max (and the Jocly AI) have a simplified QS: only consider capture of the last-moved piece. This is enough to avoid most pf the ridiculous play you would get from minimax without QS (where the engine tries to manouevre such that on the last ply it can sacrifice its Queen for the highest piece it can get). I can add that in some chess variants, in particular those with many very powerful pieces, conventional QS (MVV/LVA, SEE, pruning of bad captures) completely explodes, and to get any depth in the full-width search up to QS one has to restict move choice and / or QS depth.
In fact one should reverse the definition: a game position is quiet when the static evaluation does a good job on it. It entirely depends on the game how hard it is to evaluate positions. Chess is a very easy game for computers, because the evaluation is for 90% material, and in most positions it is hard to change the material balance to your advantage. Games like Go are extremely hard to evaluate. Shogi is already much more difficult than chess, because King safety is much more important than material, and conventional capture search tends to make the positon less quiet, as piece in hand offer a much larger threat to the Kings than the pieces this removes from the board. So basically there are no quiet positions. In games like Reversi/Othello this is even more clear; all legal moves are captures there!