Since you’re here...

... we have a small favour to ask. More people, like you, are reading and supporting our blog: "Chess Engines Diary". And unlike many other sites and blogs, we made the choice to keep our articles open for all, regardless of where they live or what they can afford to pay.

We hope you will consider supporting us today. We need your support to continue to exist, because good entries are more and more work time. Every reader contribution, however big or small, is so valuable. Support "Chess Engines Diary" even a small amount– and it only takes a minute. Thank you.

============================== My email: jotes@go2.pl



Stockfish 17091710 - new version!

Stockfish, chess engine UCI

Rating JCER = 3427
🔬 Author: Syzygy 

More:
Timestamp: 1505637850 

Let ss->ply denote the number of plies from the root to the current node 

This patch lets ss->ply be equal to 0 at the root of the search. 

Currently, the root has ss->ply == 1, which is less intuitive: 

- Setting the rootNode bool has to check (ss-1)->ply == 0. 

- All mate values are off by one: the code seems to assume that mated-in-0 
is -VALUE_MATE, mate-1-in-ply is VALUE_MATE-1, mated-in-2-ply is VALUE_MATE+2, etc. 
But the mate_in() and mated_in() functions are called with ss->ply, which is 1 in 
at the root. 

- The is_draw() function currently needs to explain why it has "ply - 1 > i" instead 
of simply "ply > i". 

- The ss->ply >= MAX_PLY tests in search() and qsearch() already assume that 
ss->ply == 0 at the root. If we start at ss->ply == 1, it would make more sense to 
go up to and including ss->ply == MAX_PLY, so stop at ss->ply > MAX_PLY. See also 
the asserts testing for 0 <= ss->ply && ss->ply < MAX_PLY. 

The reason for ss->ply == 1 at the root is the line "ss->ply = (ss-1)->ply + 1" at 
the start for search() and qsearch(). By replacing this with "(ss+1)->ply = ss->ply + 1" 
we keep ss->ply == 0 at the root. Note that search() already clears killers in (ss+2), 
so there is no danger in accessing ss+1. 

I have NOT changed pv[MAX_PLY + 1] to pv[MAX_PLY + 2] in search() and qsearch(). 
It seems to me that MAX_PLY + 1 is exactly right: 

- MAX_PLY entries for ss->ply running from 0 to MAX_PLY-1, and 1 entry for the 
final MOVE_NONE. 

I have verified that mate scores are reported correctly. (They were already reported 
correctly due to the extra ply being rounded down when converting to moves.) 

The value of seldepth output to the user should probably not change, so I add 1 to it. 
(Humans count from 1, computers from 0.) 

A small optimisation I did not include: instead of setting ss->ply in every invocation 
of search() and qsearch(), it could be set once for all plies at the start of 
Thread::search(). This saves a couple of instructions per node. 

No functional change (unless the search searches a branch MAX_PLY deep), so bench 
does not change. 

⭐⭐⭐   Stockfish 17091710 - download


Comments

Popular posts from this blog

New chess engine: HypnoS 190324 (derived from Stockfish)

New version chess engine: Lc0 BT4

SF-PRO 23.02.2024 wins Strong Engines Tournament (Tests by Jörn Gronemann, Heide, 2024.03.01)

INCOGNITO 7 and Killfish 130324 wins Strong Engines Tournament (Tests by Jörn Gronemann, Heide, 2024.03.15)

SF-PRO 08.03.2024 wins New Engines Test, 09-10.03.2024

Chess engine: SF 16.1 MPV

Chess Engines Diary Rating (Stockfish and clones) - 03.03.2024