The quality of refutation moves

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Karlo Bala
Posts: 373
Joined: Wed Mar 22, 2006 10:17 am
Location: Novi Sad, Serbia
Full name: Karlo Balla

The quality of refutation moves

Post by Karlo Bala »

After more than 10 years, I started "playing" with my chess toy and found out that the problems are the same :)

Take for example this particular position

[d]r1b1r1k1/p1p3pp/2p2n2/2bp4/5P2/3BBQPq/PPPK3P/R4N1R b - - 0 1

Bg4 is the clear best move, but the engine keeps searching Qxf1 for a much longer time than it should. After Qxf1, easy moves are Rxf1 (the best) and Qxf1, however, after Bxf1 the things could get tricky. The problem is that due to the MVV/LVA rule the engine tries Bxf1 first (it is a perfectly logical move), sticks with it, and never tries Rxf1 or Qxf1.

Another dilemma to think about:
There is a choice of taking the opponent queen or make a null move. Both choices are good and lead to fail-high. Personally (as a hobby chess player), I would take the queen, and try a more aggressive null move deeper in the tree. Unfortunately, things don't work that way...

Well, I doubt there are simple solutions, just wanted to share my frustrations :)
Best Regards,
Karlo Balla Jr.
User avatar
emadsen
Posts: 434
Joined: Thu Apr 26, 2012 1:51 am
Location: Oak Park, IL, USA
Full name: Erik Madsen

Re: The quality of refutation moves

Post by emadsen »

Karlo Bala wrote: Tue Aug 31, 2021 4:28 amThere is a choice of taking the opponent queen or make a null move. Both choices are good and lead to fail-high.
After ... Qxf1, null move... black simply plays ... Qxf3. White evaluates the null move as losing a queen. Well, losing a queen for a bishop (hanging on c5). Maybe I misunderstand your question? Or maybe you have a sign reversed in your null move code?
My C# chess engine: https://www.madchess.net
Karlo Bala
Posts: 373
Joined: Wed Mar 22, 2006 10:17 am
Location: Novi Sad, Serbia
Full name: Karlo Balla

Re: The quality of refutation moves

Post by Karlo Bala »

emadsen wrote: Wed Sep 01, 2021 2:58 am
Karlo Bala wrote: Tue Aug 31, 2021 4:28 amThere is a choice of taking the opponent queen or make a null move. Both choices are good and lead to fail-high.
After ... Qxf1, null move... black simply plays ... Qxf3. White evaluates the null move as losing a queen. Well, losing a queen for a bishop (hanging on c5). Maybe I misunderstand your question? Or maybe you have a sign reversed in your null move code?
The second question was more general.

What to do when there is a piece en prise and eval is already above beta? Take the hanging piece or make a null move?

Removing the strongest piece from the board will considerably reduce the complexity of the position, and probably allow multiple null moves in a row, while making the null move immediately will reduce the depth only ones.
Best Regards,
Karlo Balla Jr.
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: The quality of refutation moves

Post by hgm »

My intuition (like yours, I suppose) tells me it must be better to simplify by taking the piece. Common chess-programming wisdom is adamant that it is better to do the null move. That null move tests as better is of course strongly related by the fact that null move is reduced, and capturing the Queen is not.

So the problem seems to be in the lack of reduction for the capture of the Queen. Human chess players would not even think about throwing away the Queen like this, so that it seems counter-productive that the search puts emphasis on this branch (by not reducing it). A pointless Queen sacrifice deserves to be reduced more than a null move. Not less.

The crux is of course in the 'pointless'. Humans are pretty good at recognizing such things. Move sorting algorithms are not. Unless you are AlphaZero, and have a huge policy neural network.

An approach could be this: apparently (i.e. SEE-wise) the QxN loses Q for N, as the Knight is protected. If there are no unexpected side effects, this Queen sac is garbage. To determine this you could plar the Q recapture(s) with a hefty reduction (perhaps even more than the null move), but with a null window shifted by the gain suggested by SEE. For gobbling up an unprotected Queen that would be currentEval + QUEEN_VALUE. Perhaps minus a small margin.

For the matter of whether you want recapture to be done with Q or B in the example: LVA ordering is only useful when capturing protected pieces. Perhaps it is better to order those by PST value. An alternative is to (when remaining search depth is large) first search all moves at very low depth (e.g. QS) with initially open window. So that you re sure which move is the best. The BxQ would probably score pretty bad, due to King Safety.