]> git.sesse.net Git - stockfish/commit
Refactor final stats updates.
authorJoost VandeVondele <Joost.VandeVondele@gmail.com>
Wed, 23 Oct 2019 06:26:47 +0000 (08:26 +0200)
committerStéphane Nicolet <cassio@free.fr>
Fri, 25 Oct 2019 23:10:55 +0000 (01:10 +0200)
commit648c7ec25db2040c0af34dd846dfa3f57af5ad0a
tree8aa31e0554dbb5337c89a10a55757ce066e42283
parent90c0385724a0d9b6c0737bc2711ad77e315d17ac
Refactor final stats updates.

This PR refactors update_quiet_stats, update_capture_stats and search to more clearly reflect what is actually done.

Effectively, all stat updates that need to be done after search is finished and a bestmove is found,
are collected in a new function ```final_stats_update()```. This shortens our main search routine, and simplifies ```update_quiet_stats```.
The latter function is now more easily reusable with fewer arguments, as the handling of ```quietsSearched``` is only needed in ```final_stats_update```.
```update_capture_stats```, which was only called once is now integrated in ```final_stats_update```, which allows for removing a branch and reusing some ```stat_bonus``` calls. The need for refactoring was also suggested by the fact that the comments of ```update_quiet_stats``` and ```update_capture_stats``` were incorrect (e.g. ```update_capture_stats``` was called, correctly, also when the bestmove was a quiet and not a capture).

passed non-regression STC:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 75196 W: 16364 L: 16347 D: 42485
http://tests.stockfishchess.org/tests/view/5db004ec0ebc5902c06db9e1

The diff is most easily readable as ```git diff master --patience```

No functional change
src/search.cpp