Page 1 of 1

Interior node recognizer and capture / stalemate

Posted: Thu May 30, 2019 7:00 pm
by xr_a_y
I'm struggling to understand when the result of an interior node recognizer can be used.

There are 3 ways (at least) of using interior node recognizer :
- score a draw (like don't reward KBK with +3, verify if KPK is winning or not, ...)
- use at helper for a endgame win (like in KRK, KBNK)
- scale an endgame score (don't reward KRNKR +3, verify KBPPKB promotion square color, ... )

But ! for all of those things, it feels like some precaution must be taken :
- winning or strong side must not lose a piece/pawn immediately
- loosing or weak side, must not be stalemate

In Minic, I was using the interior node recognizer only at qsearch leaves where no capture exists anymore but (I may be wrong), it seems to me that stockfish is using endgame scale factor, endgame helpers and draw recognition everywhere and without any kind of special verification (just in KXK there is something for stalemate).

How are you dealing with these things ?

Re: Interior node recognizer and capture / stalemate

Posted: Thu May 30, 2019 9:56 pm
by hgm
It depends on how you define 'immediately'. The scaling of end-games is part of the static evaluation, used during stand-pat. If the side to move is not happy that KRKN doesn't get it the 'expected' +2, but he can capture the Knight, he will try that in QS. If he can skewer the Knight and win it that way, QS probably wouldn't see it (let alone static eval). But then you are talking about things beyond the horizon. No matter what you do, there will always be such things. Static eval is just a heuristic to guess what most probably will ly beyond that horizon, perhaps with a small disccount depending on the risk.

Re: Interior node recognizer and capture / stalemate

Posted: Thu May 30, 2019 10:38 pm
by xr_a_y
Ok I get the point for static eval, it is just an approximation, and capture shall be evaluated later anyway

How to deal with "real" draw detection? just use 50rule and 3rep or also try to consider KNK, KBK, ...

Re: Interior node recognizer and capture / stalemate

Posted: Thu May 30, 2019 11:08 pm
by hgm
Real draws get a zero score, and are not searched any deeper (like checkmate or stalemate). For 'dead draws', suck as KNNK or KBKN you cannot do that, because there could be mate-in-1. A trick that is possible here is to do it only after a few moves, i.e. e.g. when the 50-move counter hits 2 or 3. Or decrease the multiplier as a function of the 50-move counter, and stop searching when it hits zero. The statistics of most end-games is heavily dominated by tactical positions, which force a conversion within a few moves. Especially if there are super-pieces involved. Delaying the judgement is a good way to give the search an opportunity to opt out of the end-game by tactics, which leaves the genuine positions of that end-game. E.g. KQKRN would normally be a draw, but there are many positions that quickly gain a Knight or Rook. If that cannot be done very quickly it either wasn't possible to start with (because all pieces were already protected), or the opponent will have been able to organize its forces in such a way. (Perhaps it would be an idea to not count King moves out of check, as these do not contribute much to building a fortress.)

Re: Interior node recognizer and capture / stalemate

Posted: Fri May 31, 2019 1:14 am
by Michael Sherwin
In those drawish positions that are really drawish after say the first 12 or so initial iterations show no immediate gain of material the draw detection could be turned on for deeper iterations.

Re: Interior node recognizer and capture / stalemate

Posted: Fri May 31, 2019 8:36 am
by xr_a_y
Ok i love the idea to decrease score of drawish or hard to win position with fifty counter. Thanks

Re: Interior node recognizer and capture / stalemate

Posted: Fri May 31, 2019 10:57 am
by PK
With king + minor versus king + minor you can safely claim a draw as long as neither king stands on the rim. The idea of tweaking 50 move rule is great BTW.