Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Questions to Paul Hunter about the assembly

Author: Robert Hyatt

Date: 14:46:11 08/23/04

Go up one level in this thread


On August 23, 2004 at 14:56:56, Gerd Isenberg wrote:

>On August 23, 2004 at 14:00:44, Lance Perkins wrote:
>
>>Hi Gerd,
>>
>>Can't you see.
>
>No. Some posted C-Code snippets may produce same assembly.
>
>>The NextMove is "identical"? That's the entire move ordering code
>>of Crafty.
>>
>>But that's not the smoking gun. Its EvaluateMate and how it is used. This
>>function is identical to that of Crafty. Plus, its use has a bug. In Evaluate,
>>it calls EvaluateMate and checks for the return value 99999. The funny thing is,
>>EvaluateMate will never return 99999. Why would you copy a bug?
>
>Ok, that looks odd.
>
>OTOH it sounds logical to me that EvaluateMate returns VALUE_MATE but for some
>reason this executable was compiled with other #define switches for instance.
>Wasn't such tautological conditions a former trick to align code and to have
>influence on branch predictions inside this code cache line?

EvaluateMate doesn't return any "mate score".  It's sole function (now) is to
drive the losing king to the edge of the board when there are no pawns left for
either side (ie the old chess 4.x "mopup" type function.  It used to return a
99999 for "this is not a win" but I now do that with EvaluateWinner().  the
99999 is an impossible value.

>
>
>>
>>I have posted how you can disassemble it yourself. Why not try it and see and
>>Bob and Paul are correct.
>>http://www.talkchess.com/forums/1/message.html?383731
>>
>>Cheers...
>>
>
>Such statements might be possible in a lot of other chess programs.
>What secret algorithm is inside the if-body?
>
>if ((TotalBlackPieces==0) && (TotalWhitePieces==6) &&
>      (!WhitePawns) && (!BlackPawns) && WhiteBishops && WhiteKnights) {
>
>Cheers,
>Gerd


That makes sense to check for KBN vs K, but the check for the value 99999 in the
disassembled code did not make any sense.  Nor the exact matches for NextMove,
and other code he produced.




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.