Moderator: Andres Valverde
Zach Wegner wrote:That is an impressive speed. Your make and unmake functions are very elegant, although I would not like to have 4 bitboards for each piecetype, and no board[] array.
Regards,
Zach
Zach Wegner wrote:That is an impressive speed.
Uri Blass wrote:I think that with king captures 16M nodes in perft are not a lot.
Movei in perft mode with only legal move get the result 309478263 in 8.188 seconds on A3000(2.001 ghz).
Uri
Dann Corbit wrote:Not yet, of course.
But ultra-compact and very strong. Maybe there can be a contest of Elo/Kb of binary.
I got 5202 KNps on 64 bit Athlon, but with a 32 bit compile.
I suspect that you can get a very large increase with a true 64 bit compiler on a 64 bit OS.
OliverBr wrote:Movei is based on bitboards, right? And the A3000 is 64bit?
Ok, but your 37 Mnps is astonishing, did I miss a trick doing perft?Uri Blass wrote:I think that with king captures 16M nodes in perft are not a lot.
Movei in perft mode with only legal move get the result 309478263 in 8.188 seconds on A3000(2.001 ghz).
Uri
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: Oct 27 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 75.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.8
7 3195901860 108329926 319617 33103848 1628 0 883453 122
-------------------------------------------------------------------------------
100 nodes: 10565822, Time: 2793, knps: 3782
100 nodes: 10565822, Time: 2529, knps: 4177
Reinhard Scharnagl wrote:Hi Uri,
well, the lines of my C++ code (containing about 1/3 comments) mostly are broken not to extend 50 to 60 chars a line. Having such lines the move generator has about 2000 lines, the move and remove part about 700 lines (because a lot of additional calculations is added there as: keeping my double linked piece lists actual, updating hash key and verification code, material balance, handling special moves like e.p. and castling (FRC also), being aware for 8x8 and 10x8 boards).
Regards, Reinhard.
P.S.: handling FRC castling rights during move and remove is a lot more of work than in traditional chess game because the positions of king and rook being able to castle are dynamicly defined then.
It seems that you also have a big move generator.
I have in most cases less than 50-60 chars in a line and it could be even less than it in case of choosing smaller names for my varaibles
Tord Romstad wrote:Hi Oliver,
The 64-bit executable was very slightly faster:
Tord Romstad wrote:Thanks a lot for the new version. The source code looks really neat, as always in OliThink.
Tord
OliverBr wrote:Ok, but your 37 Mnps is astonishing, did I miss a trick doing perft?
Michael Yee wrote:One trick you can use for perft() is to not make/undo the last ply of moves. That is, instead of the base case for perft() being :
when depth == 0, return 1
it becomes
when depth == 1, return number of legal moves
This could save a lot if your make/unmake are complex.
OliverBr wrote:Compiled for 64bit there should be half instructions, so half time, thus double speed. Have you looked to the compiled code, if it is done correctly?
_getShiftMask:
cmpwi cr7,r3,1
mflr r2
bcl 20,31,"L00000000006$pb"
"L00000000006$pb":
mflr r10
mtlr r2
beq- cr7,L788
bgt- cr7,L795
cmpwi cr0,r3,0
rlwinm r3,r4,0,26,28
beqlr- cr0
b L786
L795:
cmpwi cr1,r3,2
beq- cr1,L789
cmpwi cr6,r3,3
beq- cr6,L791
b L786
L788:
addis r3,r10,ha16(_r045shift-"L00000000006$pb")
slwi r6,r4,2
la r5,lo16(_r045shift-"L00000000006$pb")(r3)
lwzx r3,r6,r5
blr
L789:
nor r2,r4,r4
rlwinm r3,r2,3,26,28
blr
L791:
nor r12,r4,r4
rlwinm r11,r4,0,26,28
rlwinm r9,r12,0,29,31
addis r8,r10,ha16(_r045shift-"L00000000006$pb")
add r7,r11,r9
la r4,lo16(_r045shift-"L00000000006$pb")(r8)
slwi r0,r7,2
lwzx r3,r4,r0
blr
L786:
li r3,0
blr
_getShiftMask:
cmpwi cr7,r3,1
beq cr7,L20
bgt cr7,L27
cmpwi cr0,r3,0
rlwinm r3,r4,0,26,28
beqlr cr0
b L18
.p2align 4,,15
L27:
cmpwi cr0,r3,2
beq cr0,L21
cmpwi cr1,r3,3
beq cr1,L23
b L18
.p2align 4,,15
L20:
lis r3,ha16(_r045shift)
slwi r5,r4,2
la r4,lo16(_r045shift)(r3)
lwzx r3,r5,r4
blr
.p2align 4,,15
L21:
nor r2,r4,r4
rldicl r8,r4,61,61
rlwinm r7,r2,3,26,28
add r6,r7,r8
rlwinm r3,r6,0,26,28
blr
L23:
nor r5,r4,r4
rlwinm r9,r4,0,26,28
lis r12,ha16(_r045shift)
rlwinm r4,r5,0,29,31
la r10,lo16(_r045shift)(r12)
add r11,r9,r4
slwi r0,r11,2
lwzx r3,r10,r0
blr
.p2align 4,,15
L18:
li r3,0
blr
addis r3,r10,ha16(_r045shift-"L00000000006$pb")
Return to Programming and Technical Discussions
Users browsing this forum: No registered users and 31 guests