Moderator: Andres Valverde
Note that I thought that attack tables are needed for fast legal move generation but after seeing Smirf results I guess that I was wrong.
1)About pinned pieces,I know that one if may be enough to check if a piece is pinned in most cases but I still think that having if for every move in the move generator is not so cheap.
I do not understand the post of Reinhard Scharnagl from Wed Oct 06, 2004 6:03 pm
...As an example a king is able to threat like a pawn into two matching directions."
I do not understand what it means and it may be good to have some example in diagram.
FEN: 8/p7/8/1P6/4B3/P6p/5K1k/8 w - - 0 1
+-a--b--c--d--e--f--g--h-+ MS Visual Studio C++ Version 13.10
8 | ::: ::: ::: :::|
7 |[p] ::: ::: ::: | Testscenario searching for:
6 | ::: ::: ::: :::| undirected chess threats
5 |:::<P>::: ::: ::: |
4 | ::: :::<B>::: :::| Test #: 04
3 |<P> ::: ::: :::[p]|
2 | ::: ::: <K> [k]| Test Count: 750000*64
1 |::: ::: ::: ::: | per Second: 146341463
=>+-a--b--c--d--e--f--g--h-+ Time: 0.328 sec
-- -- -- -- -- -- -- --
-- -- -- -- -- -- -- --
-- bP -- -- -- -- -- --
-- -- -- -- -- -- -- --
-- -- -- -- -- -- -- --
-- -- -- -- -- -- bK bK
-- -- -- -- -- -- bP --
-- -- -- -- -- -- bP bK
1)If you want to generate legal king moves without attack tables you need to have a function that caluclates if the king go to safe square or to attacked square and it seems to me slow to check all the possible direction in every move.
You can see that 94.4% of the time was used for the perft function.
74.6% of the time, that means only 74.6/94.4 of the time that was used for the perft function, was used for generating moves and not for making moves or undoing moves
17.8% of the time was used for undoing moves and the rest of the time for other tasks
updating the attack tables happen during makemove and undomove so it seems that it is not something that cost me too much.
FEN: r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 25
+-*--b--c--d--*--f--g--*-+ Perft Testseries
8 |[r]::: :::[k]::: [r]|
7 |[p] [p][p][q][p][b] | (without caching)
6 |[b][n] :::[p][n][p]:::|
5 |::: :::<P><N> ::: | Test #: 01
4 | [p] :::<P>::: :::|
3 |::: <N> :::<Q>:::[p]| Break Time 75 Sec.
2 |<P><P><P><B><B><P><P><P>|
1 |<R> ::: <K> :::<R>|
=>+-*--b--c--d--*--f--g--*-+
Ply Nodes all (x) (e.p.) 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 1 0 3162 0
4 4085603 757163 1929 25523 43 15172 128013 0
5 193690690 35043416 73365 3309887 30171 8392 4993637 10
6 8031647685 1558445089 3577504 92238050 360003 56627920 184513607 420
-------------------------------------------------------------------------------
perft is clearly relevant here because I compated movei with smirf.
Reinhard Scharnagl has a fast perft function without attack tables and this surprised me.
It seems that smirf is even slightly faster than movei inspite of calculating more information.
In my case it seems that updating the attack tables is not expensive even when I use them to calculate perft.
In normal search I do things like evaluation and alhabeta so updating the attack tables even happens less time in normal search so it is not a problem.
You could not tell me that generating moves is more expensive than making them without seeing my profile and if updating the attack table is slow enough then it means that making one move is slower than generating 30 moves.
FEN: r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 25
+-*--b--c--d--*--f--g--*-+ Perft Testseries
8 |[r]::: :::[k]::: [r]|
7 |[p] [p][p][q][p][b] | (With TT Caching)
6 |[b][n] :::[p][n][p]:::|
5 |::: :::<P><N> ::: | Test #: 01
4 | [p] :::<P>::: :::|
3 |::: <N> :::<Q>:::[p]| Break Time 400.0 Sec.
2 |<P><P><P><B><B><P><P><P>|
1 |<R> ::: <K> :::<R>|
=>+-*--b--c--d--*--f--g--*-+
Ply Nodes all (x) all (+) Seconds
------------------------------------------------------------
01 48 8 0 0
02 2039 351 3 0
03 97862 17102 993 0
04 4085603 757163 25523 0.2
05 193690690 35043416 3309887 4.1
06 8031647685 1558445089 92238050 97.5
07 374190009323 69479646226 8418124031 2693.9
------------------------------------------------------------
Return to Programming and Technical Discussions
Users browsing this forum: No registered users and 2 guests