]> git.sesse.net Git - stockfish/commit
Don't update pvHit after IID
authorDU-jdto <jadto@outlook.com>
Wed, 23 Jan 2019 04:19:10 +0000 (15:19 +1100)
committerStéphane Nicolet <cassio@free.fr>
Tue, 29 Jan 2019 16:40:00 +0000 (17:40 +0100)
commit3302349662f8c0b01946cd9d62ac087685c0c816
tree5b35e2f948727b5ba072534753796b85fc575169
parent242c566c1a80c7f3d95774eac513935fcee0cf0d
Don't update pvHit after IID

This patch removes line 875 of search.cpp, which was updating pvHit after IID.
Bench testing at depth 22 shows that line 875 of search.cpp never changes the
value of pvHit at NonPV nodes, while at PV nodes it often changes the value
from true to false (and never the reverse). This is because the definition of
pvHit at line 642 is :

```
pvHit = (ttHit && tte->pv_hit()) || (PvNode && depth > 4 * ONE_PLY);
```

while the assignment after IID omits the ` (PvNode && depth > 4 * ONE_PLY) `
condition. As such, unlike the other two post-IID tte reads, this line of code
does not make SF's state more consistent, but rather introduces an inconsistency
in the definition of pvHit. Indeed, changing line 875 read

```
pvHit = (ttHit && tte->pv_hit()) || (PvNode && depth > 4 * ONE_PLY);
```

to match line 642 is functionally equivalent to removing the line entirely, as
this patch does.

STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 62756 W: 13787 L: 13746 D: 35223
http://tests.stockfishchess.org/tests/view/5c446c850ebc5902bb5d4b75

LTC
LLR: 3.19 (-2.94,2.94) [-3.00,1.00]
Total: 61900 W: 10179 L: 10111 D: 41610
http://tests.stockfishchess.org/tests/view/5c45bf610ebc5902bb5d5d62

Bench: 3796134
src/search.cpp