sunfish icon indicating copy to clipboard operation
sunfish copied to clipboard

Tempo

Open thomasahle opened this issue 10 years ago • 8 comments

Sunfish currently doesn't do 'tempo'. A mate in 6 is considered the same as a mate in 1.

thomasahle avatar Mar 07 '14 14:03 thomasahle

I have this solved in my master. d6bb441

Ravenslofty avatar Mar 09 '14 17:03 Ravenslofty

Interesting. Isn't it normally implemented by always subtracting a bit from the score returned in minmax?

thomasahle avatar Mar 13 '14 17:03 thomasahle

Nope. If you always do that then you introduce a bug where a bad move searched shallowly is favoured over a good move searched deeply.

Matthew:out

Ravenslofty avatar Mar 13 '14 17:03 Ravenslofty

But it doesn't have to be a big constant. Otherwise, don't you have to do a lot of 'correcting' in the TT code, like the describe on http://chessprogramming.wikispaces.com/Checkmate ? Another approach I've thought about is to keep the global movenumber in the Position representation. Then we could make MATE_SCORE-global_ply the value of a checkmate. This might give new problems in TT though.

2014-03-13 18:16 GMT+01:00 ZirconiumX [email protected]:

Nope. If you always do that then you introduce a bug where a bad move searched shallowly is favoured over a good move searched deeply.

Matthew:out

— Reply to this email directly or view it on GitHubhttps://github.com/thomasahle/sunfish/issues/11#issuecomment-37559774 .

Mvh. Thomas

thomasahle avatar Mar 13 '14 17:03 thomasahle

Search deep enough and even 1 centipawn can make a difference.

It's better to have to deal with mate scores in the TT than having to deal with false mate scores in the TT.

Matthew:out

Ravenslofty avatar Mar 13 '14 17:03 Ravenslofty

Have you tried testing the engines against each other and compared results?

thomasahle avatar Sep 30 '15 17:09 thomasahle

A mate in 6 is considered the same as a mate in 1.

I "solve" this in my rust engine by exiting the search early on mate found, which while not correct 100% of the time is a good approximation, makes the engine appear faster and can very easily be done by making _search yield the score

Recursing avatar Jun 01 '19 23:06 Recursing

I like the way this is done in Micromax: https://home.hccnet.nl/h.g.muller/delay.html

But I haven't found a position where it matters in the current sunfish, so I can't really test whether it improves anything.

thomasahle avatar Jan 08 '23 02:01 thomasahle