]> git.sesse.net Git - stockfish/commit
Better document null search window
authorLucas Braesch <lucas.braesch@gmail.com>
Tue, 4 Feb 2014 07:18:19 +0000 (08:18 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 4 Feb 2014 07:24:46 +0000 (08:24 +0100)
commite5c3effdb1fee10a694e493773e62f433e642406
tree2286899acd3949c3f9b0e4c668a27ae39608284a
parente88ef801af3ac5400c1b82d009666fb082c24a16
Better document null search window

Hopefully this patch makes the code more:

* Self-documenting: Null search is always a zero window search,
  because it is testing for a fail high. It should never be done
  on a full window! The current code only works because we don't
  do it at PV nodes, and therefore (alpha, beta) = (beta-1, beta):
  that's the kind of "clever" trick we should avoid.

* Idiot-proof: If we want to enable null search at PV nodes, all we
  need to do now is comment out the !PvNode condition. It's that simple!

In theory, null search should not be done at PV nodes, because PV nodes
should never fail high. But in practice, they DO fail high, because of
aspiration windows, and search inconsistencies, for example. So it makes
sense to keep that flexibility in the code.

No functional change.
src/search.cpp