Author: Bas Hamstra
Date: 15:19:24 01/12/03
Go up one level in this thread
On January 12, 2003 at 17:59:45, Uri Blass wrote:
>On January 12, 2003 at 17:14:18, Bas Hamstra wrote:
>
>>I am playing with a 0x88 implementation, that is supposed to be faster than my
>>rotated BitBoard program. Just for fun. However I am a little disappointed about
>>the speed gains so far. I have learned in the past that there are a couple of
>>very speed critical functions:
>>
>>- make/unmake
>>- gencaptures
>>- squareattacked
>>- SEE
>>
>>So far my 0x88 make/unmake is about the same speed as in my BB program Tao. The
>>second function I tested was bool SquareAttacked(int Sq, int ByColor). I was a
>>little disappointed to see it is more than 2x slower than my rotated BitBoard
>>version.
>> rot BB 0x88
>>Makes/Unmakes per sec: 4237288 4.25M
>>GenCaptures per sec: 1915709 ?
>>GenCapturesChecks per sec: 1569859 ?
>>SquareAttacked per sec: 18181818 8M !!!
>>SwapValue[c1e3] per sec: 6756757 ?
>>GetBishopAttacks[26] per sec: 45454545 ?
>>
>>Below the 0x88 function used for SquareAttacked, which for the moment is the
>>fastest I can think of:
>>
>>bool TBoard::SquareAttacked(int To, int ByColor)
>>
>>{ int n,
>> D,
>> From,
>> Type,
>> Sq,
>> Count = PieceCount[ByColor];
>>
>> if(ByColor==WHITE && Bord[To-17] == 13) return true;
>> if(ByColor==WHITE && Bord[To-15] == 13) return true;
>> if(ByColor==BLACK && Bord[To+17] == 12) return true;
>> if(ByColor==BLACK && Bord[To+15] == 12) return true;
>>
>> for(n=0; n<Count; n++)
>> { From=PieceList[ByColor][n];
>> Type=Bord[From]>>1;
>> if(Type==PAWN) break;
>> if(PseudoAtt[127+To-From] & (1<<Type) )
>> { if(Type==KING || Type==KNIGHT) return true;
>> D = Dir[127+To-From];
>> for(Sq=From+D; Sq!=To; Sq+=D)
>> if(Bord[Sq]) break;
>> if(Sq==To) return true;
>> }
>> }
>>
>> return false;
>>}
>
>I do not understand why do you need to look at all the piece list.
>I think it may be more logical to look only at list of other pieces.
>
>I see no logical reason to have a piece list that include all the pieces
>and all the pawns.
The idea was to generate qsearch captures one at a time in MVV/LVA order. So I
do not intend to generate all captures at once, just the one "best" capture and
play it before generating the nextbest capture. For that purpose (I think) I
need such a piecelist. I keep it fully sorted at any time, at only a small cost.
>I have seperate piece list for every piece except the king when one varaible is
>enough.
>I also think that it is better not to have this function and to have attack
>tables that are updated after every move.
You might be right. I have done such a thing in a previous program and the
overall speed was about the same. It IS a lot of overhead of course, but you
also have a lot of profit from it, for movegeneration, SEE, InCheck detection
etc. But if you want to break the nps speed limit (with good sorting, and not
playing illegal moves, otherwise it's meaningless), I am not convinced
incremental attacktables is the way to go.
Bas.
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.