Moderator: Andres Valverde
FEN: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
+-*--b--c--d--*--f--g--*-+ MS Vis. Studio C++ Vers. 13.10
8 |[r][n][b][q][k][b][n][r]| (Compilation: Nov 7 2004)
7 |[p][p][p][p][p][p][p][p]|
6 | ::: ::: ::: :::| Perft Testseries
5 |::: ::: ::: ::: |
4 | ::: ::: ::: :::| (without caching)
3 |::: ::: ::: ::: |
2 |<P><P><P><P><P><P><P><P>| Smirf Test No.: 00
1 |<R><N><B><Q><K><B><N><R>|
=>+-*--b--c--d--*--f--g--*-+ Break Time 250.0 Sec.
Ply Nodes all (x) (e.p.) all (+) all (++) Promot. Castl. Sec.
-------------------------------------------------------------------------------
1 20 0 0 0 0 0 0 0
2 400 0 0 0 0 0 0 0
3 8902 34 0 12 0 0 0 0
4 197281 1576 0 469 0 0 0 0
5 4865609 82719 258 27351 0 0 0 0.2
6 119060324 2812008 5248 809099 46 0 0 4.5
7 3195901860 108329926 319617 33103848 1628 0 883453 116
8 84998978956 3523740106 7187977 968981593 147215 0 23605205 3116
-------------------------------------------------------------------------------
FEN: r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 25
+-*--b--c--d--*--f--g--*-+ MS Vis. Studio C++ Vers. 13.10
8 |[r]::: :::[k]::: [r]| (Compilation: Nov 7 2004)
7 |[p] [p][p][q][p][b] |
6 |[b][n] :::[p][n][p]:::| Perft Testseries
5 |::: :::<P><N> ::: |
4 | [p] :::<P>::: :::| (without caching)
3 |::: <N> :::<Q>:::[p]|
2 |<P><P><P><B><B><P><P><P>| Smirf Test No.: 01
1 |<R> ::: <K> :::<R>|
=>+-*--b--c--d--*--f--g--*-+ Break Time 250.0 Sec.
Ply Nodes all (x) (e.p.) all (+) all (++) Promot. Castl. Sec.
-------------------------------------------------------------------------------
1 48 8 0 0 0 0 2 0
2 2039 351 1 3 0 0 91 0
3 97862 17102 45 993 0 0 3162 0
4 4085603 757163 1929 25523 6 15172 128013 0.2
5 193690690 35043416 73365 3309887 2645 8392 4993637 7.4
6 8031647685 1558445089 3577504 92238050 55014 56627920 184513607 321
-------------------------------------------------------------------------------
Ochazuke wrote:I am interested in trying to make a very fast perft engine. I have been making a bitboard engine for a while now, and it is an excellent board representation for analyzing positions, but it seems that if you are just after mindless speed, bitboards aren't the way to go. I know almost nothing about other kinds of board representations, and could use some suggestions if you have any :) . I would definitely post the code if it gets up to an interesting speed.
If you do not know it already, you should take a look at the 0x88 board representation.
Ochazuke wrote:I am interested in trying to make a very fast perft engine.
Dieter B?r?ner wrote:Anthony:
>so the loop ends up being:
>for(index = 0; square[index] >= 0; index += 1) {
>if(occupied) index += skip[index];
>
>if(!friendly) add_move(square[index]);
>}
Hmmm, what exectly are "occupied" and "friendly". Seems some function/macro/array-access, that needs some additional info.
if (occupied(index)) or if (occupied[index]) or more indirections I might understand. Like given, I am not smart enough, to even understand the pseudo code (which I think it is - yes?).
>And with a trick you can remove the first branch (mask) so that it ends
> up being only 1 branch, which is just about optimal.
So, how would the code look like, with this trick applied?
Dieter
Anthony Cozzie wrote:Vincent's move generator is in Dutch
The way it works (for sliders) is that for each square there is just a list of squares that a slider could attack, and a skip to the end of the ray value.
so the loop ends up being:
for(index = 0; square[index] >= 0; index += 1) {
if(occupied) index += skip[index];
if(!friendly) add_move(square[index]);
}
And with a trick you can remove the first branch (mask) so that it ends up being only 1 branch, which is just about optimal.
anthony
It seems to me bitboards are better suited to find the moves you need in the order you need them.
And with a trick you can remove the first branch (mask) so that it ends up being only 1 branch, which is just about optimal.
Sune Fischer wrote:... It seems to me bitboards are better suited to find the moves you need in the order you need them.
Tony van Roon-Werten wrote:Dieter B?r?ner wrote:Anthony:
>so the loop ends up being:
>for(index = 0; square[index] >= 0; index += 1) {
>if(occupied) index += skip[index];
>
>if(!friendly) add_move(square[index]);
>}
Hmmm, what exectly are "occupied" and "friendly". Seems some function/macro/array-access, that needs some additional info.
if (occupied(index)) or if (occupied[index]) or more indirections I might understand. Like given, I am not smart enough, to even understand the pseudo code (which I think it is - yes?).
>And with a trick you can remove the first branch (mask) so that it ends
> up being only 1 branch, which is just about optimal.
So, how would the code look like, with this trick applied?
Dieter
At the end of each row of squares, add the from square.
idx=0;
while (1)
if (occupied){
if !(sq[idx]==friendly) AddCaptureMove;
else if (sq[idx]==fromsq) break;
ixd+=skip[idx];
} else AddNonCaptureMove;
idx++;
wend;
Reinhard Scharnagl wrote:Moreover I am convinced, that a decision towards bitboards has a more philosophical nature. If you feel well with your data structure, your decision will be ok, whether it will be bitboards or not (as for me).
Tord wrote:It is surprising how many beginners seem to believe that the speed of the move generator is one of the main factors deciding the strength of the engine.
Return to Programming and Technical Discussions
Users browsing this forum: No registered users and 14 guests