Stockfish 2.2.2 issue

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Stockfish 2.2.2 issue

Post by jdart »

I have noticed this code in Stockfish 2.2.2:

Code: Select all

          // Value based pruning
          // We illogically ignore reduction condition depth >= 3*ONE_PLY for predicted depth,
          // but fixing this made program slightly weaker.
          Depth predictedDepth = newDepth - reduction<PvNode>&#40;depth, moveCount&#41;;
          futilityValue =  futilityBase + futility_margin&#40;predictedDepth, moveCount&#41;
                         + H.gain&#40;pos.piece_moved&#40;move&#41;, to_sq&#40;move&#41;);
What this is doing is applying futility pruning based on the depth after LMR. But, not only (as the comment indicates) does the code ignore the depth >= 3*ONE_PLY condition, but also, this code is inside a block that is only executed for non-pv nodes. So I think the term

reduction<PvNode>(depth, moveCount);

should be:

reduction<NonPv>(depth, moveCount);

(It might be cleaner though just to adjust the futility margins so that you don't need to factor in the LMR stuff).

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

Re: Stockfish 2.2.2 issue

Post by mcostalba »

jdart wrote: reduction<PvNode>(depth, moveCount);

should be:

reduction<NonPv>(depth, moveCount);
Thanks for your support, but actually PvNode is a boolean (false in this case):

Code: Select all

const bool PvNode   = &#40;NT == PV || NT == Root || NT == SplitPointPV || NT == SplitPointRoot&#41;;
jdart wrote: (It might be cleaner though just to adjust the futility margins so that you don't need to factor in the LMR stuff).
yes, I agree, but unfortunately futility_margin() is used also elsewhere, so the adjustment cannot be perfect....probably some test will be needed to verify we don't introduce regressions. Anyhow is a good idea. Thanks.