Selective techniques

Discussion of chess software programming and technical issues.

Moderator: Ras

mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Selective techniques

Post by mcostalba »

metax wrote: In ChessMind, I have even more conditions:
No, you have less.

Please go to check definition of ok_to_prune() you will see there is an whole bunch of conditions there and among them the history counters.
zamar
Posts: 613
Joined: Sun Jan 18, 2009 7:03 am

Re: Selective techniques

Post by zamar »

mcostalba wrote: No, you have less.

Please go to check definition of ok_to_prune() you will see there is an whole bunch of conditions there and among them the history counters.
And in top of these there are conditions that needs to be fulfilled before Stockfish even considers history pruning:

Code: Select all

      if (    useFutilityPruning
          && !dangerous
          && !moveIsCapture
          && !move_is_promotion(move))
      {
          // History pruning. See ok_to_prune() definition
          if (   moveCount >= 2 + int(depth)
              && ok_to_prune(pos, move, ss[ply].threatMove, depth))
              continue;
I won't go into details.
Joona Kiiski
metax
Posts: 344
Joined: Wed Sep 23, 2009 5:56 pm
Location: Germany

Re: Selective techniques

Post by metax »

In the Stockfosh 1.5 sources I downloaded, the code is:

Code: Select all

/// History::ok_to_prune() decides whether a move has been sufficiently
/// unsuccessful that it makes sense to prune it entirely.

bool History::ok_to_prune(Piece p, Square to, Depth d) const {

  assert(piece_is_ok(p));
  assert(square_is_ok(to));

  return (int(d) * successCount[p][to] < failureCount[p][to]);
}
I only see the history condition, but
Tord Romstad wrote:
Then I should implement history heuristic anyway to make this pruning possible?
I don't think it's really necessary. Just run enough tests to make sure you don't prune too many (or too few) moves. By the way, Marco's explanation was a little simplified: The ok_to_prune() function tests for several other conditions in addition to history counters before it decides whether a move can be safely pruned. Look at the code for details; it is reasonably well commented and should be easy to read.
The only condition I do not have (except for the history condition) is the promotion condition, which seems to be not very problematic in this case (I will add that, too).
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Selective techniques

Post by mcostalba »

metax wrote: I only see the history condition, but
No, not History::ok_to_prune(), if you see the ok_to_prune() call in the pruning condition it refers to a free function not to a member function. IOW see for ok_to_prune() function at the end of search.cpp
metax
Posts: 344
Joined: Wed Sep 23, 2009 5:56 pm
Location: Germany

Re: Selective techniques

Post by metax »

Ah, OK. Thanks. :oops: