I'm debugging my new Freccia engine and i have some problem in finding bug in some positions. My program reports a number of moves lesser than those given by quick perft, in some middle-game positions. I suspect problem in castling or check testing but simpler positions doesn't help me to find the problem.
It would be usefull if quick perft (or other programs) can output to a file the list of correct moves that it counts or the list of valid fen positions reached. This can help very much for debugging any new engine.
Somebody knows a way to get a list of valid moves from quick perft or similar programs? (speedness is not important).
PS: a list of moves could be in the form: ply source destination, source destination etc., as in:
0 a2a3 1 a7a6 a7a5... 0 a2a4 1 a7a6... 2 a3a4... 1... 0 b2b3 b2b4...
perft moves list
Moderator: Ras
-
- Posts: 859
- Joined: Mon Aug 10, 2009 10:05 pm
- Location: Italy
- Full name: Stefano Gemma
-
- Posts: 28391
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: perft moves list
Isn't the split option of qperft what you want?
Code: Select all
$ qperft 6 -4
...
4. b1c3 b8c6 a1b1 moves = 11056 ( 0.000 sec)
3. b1c3 b8c6 moves = 274487 ( 0.015 sec)
4. b1c3 b8a6 h2h3 moves = 9369 ( 0.000 sec)
4. b1c3 b8a6 h2h4 moves = 10249 ( 0.000 sec)
4. b1c3 b8a6 g2g3 moves = 10265 ( 0.000 sec)
4. b1c3 b8a6 g2g4 moves = 10246 ( 0.000 sec)
4. b1c3 b8a6 f2f3 moves = 9369 ( 0.000 sec)
4. b1c3 b8a6 f2f4 moves = 9847 ( 0.000 sec)
4. b1c3 b8a6 e2e3 moves = 14516 ( 0.000 sec)
4. b1c3 b8a6 e2e4 moves = 14092 ( 0.000 sec)
4. b1c3 b8a6 d2d3 moves = 12454 ( 0.000 sec)
4. b1c3 b8a6 d2d4 moves = 12956 ( 0.000 sec)
4. b1c3 b8a6 b2b3 moves = 10265 ( 0.000 sec)
4. b1c3 b8a6 b2b4 moves = 10229 ( 0.000 sec)
4. b1c3 b8a6 a2a3 moves = 10286 ( 0.000 sec)
4. b1c3 b8a6 a2a4 moves = 10303 ( 0.000 sec)
4. b1c3 b8a6 g1f3 moves = 10672 ( 0.000 sec)
4. b1c3 b8a6 g1h3 moves = 9797 ( 0.000 sec)
4. b1c3 b8a6 c3a4 moves = 9392 ( 0.000 sec)
4. b1c3 b8a6 c3b5 moves = 9598 ( 0.000 sec)
4. b1c3 b8a6 c3d5 moves = 10273 ( 0.000 sec)
4. b1c3 b8a6 c3e4 moves = 9926 ( 0.000 sec)
4. b1c3 b8a6 c3b1 moves = 8957 ( 0.000 sec)
4. b1c3 b8a6 a1b1 moves = 9369 ( 0.000 sec)
3. b1c3 b8a6 moves = 232430 ( 0.000 sec)
2. b1c3 moves = 5708064 ( 0.312 sec)
perft( 6)= 119060324 ( 6.281 sec)
-
- Posts: 859
- Joined: Mon Aug 10, 2009 10:05 pm
- Location: Italy
- Full name: Stefano Gemma
Re: perft moves list
I think yes. Thanks... i'll try it but it seems to be the right solution.
-
- Posts: 2949
- Joined: Mon May 05, 2008 12:16 pm
- Location: Bordeaux (France)
- Full name: Julien Marcel
Re: perft moves list
You can do that with my engine, too. First you either enter "ucinewgame", to get the starting position, OR you enter "position fen <fen string>" to get another position, then you type "perft <plies>". For instance :
("Nombre de noeuds" = "number of nodes"; "temps" = "time"; "vitesse" = "speed".)
Code: Select all
iMac-de-Julien-Marcel:Desktop julienmarcel$ ./Predateur
Predateur EvS3 ¸2011-07-03 by Julien MARCEL
position fen 2b1rk2/5p2/p1P5/2p2P2/2p5/7B/P7/2KR4 w - - 0 1
perft 5
c6c7 : 160011
f5f6 : 156252
a2a3 : 139828
a2a4 : 138349
h3g2 : 191423
h3f1 : 151291
h3g4 : 172018
d1e1 : 129983
d1f1 : 112917
d1g1 : 126542
d1h1 : 105033
d1d2 : 171078
d1d3 : 183699
d1d4 : 173797
d1d5 : 139498
d1d6 : 151138
d1d7 : 117153
d1d8 : 64861
c1b1 : 151073
c1b2 : 189075
c1c2 : 177524
c1d2 : 101845
Nombre de noeuds : 3204388 ; Temps : 0.965s ; vitesse : 3320609 nps
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
-
- Posts: 859
- Joined: Mon Aug 10, 2009 10:05 pm
- Location: Italy
- Full name: Stefano Gemma
Re: perft moves list
Thanks, i try your engine too.
Maibe we can consider to define a perft standard, for such kind of output?
I think that it could help very much to have some kind of standard, because using that standard we can automate the engine perft testing, comparing our software with other stable engines.
Maibe we can consider to define a perft standard, for such kind of output?
I think that it could help very much to have some kind of standard, because using that standard we can automate the engine perft testing, comparing our software with other stable engines.
-
- Posts: 859
- Joined: Mon Aug 10, 2009 10:05 pm
- Location: Italy
- Full name: Stefano Gemma
Re: perft moves list
I've try ucinewgame and then pert 5 commands (even position fen <string>) but it does nothing: the engine doesn't starts working and doesn't report any moves list at all. It doesn't freeze, the command prompt is working but nothing happens.
The try was done at "dos prompt" in Windows XP (used in VirtualBox under mac os x).
Maybe i've missed some configuration?
The try was done at "dos prompt" in Windows XP (used in VirtualBox under mac os x).
Maybe i've missed some configuration?
-
- Posts: 2949
- Joined: Mon May 05, 2008 12:16 pm
- Location: Bordeaux (France)
- Full name: Julien Marcel
Re: perft moves list
Sorry, Stefano, my bad: I commented out the perft (not "pert") function (and a lot of other undocumented debugging commands) in the 2.1 version, but I just tried with Prédateur 2.0 and perft is still public, so you can try with it
(The move generator might be slightly slower, as I think I improved it between 2.0 and 2.1). AFAIK, Pred's move generator is rock solid and always report the good pert results.
Other undocumented functions that work with 2.0 :
- "i" (for info) prints out (in french) a few informations on your configuration
- "t" (for test) 45 test positions you can chose from and that Pred will try to solve in ten seconds (the list only includes the solution move, but before starting to search, Pred will also print out the respective fen string).
- "b": prints out the board.
- "lc" (= liste coups): displays the list of all legal moves in the current position
- "g" (= go): force Pred to move (after a 10-seconds long search)
All those commands are not public anymore starting from version 2.1.
And "q" (quit) to quit, works with all versions.

Other undocumented functions that work with 2.0 :
- "i" (for info) prints out (in french) a few informations on your configuration
- "t" (for test) 45 test positions you can chose from and that Pred will try to solve in ten seconds (the list only includes the solution move, but before starting to search, Pred will also print out the respective fen string).
- "b": prints out the board.
- "lc" (= liste coups): displays the list of all legal moves in the current position
- "g" (= go): force Pred to move (after a 10-seconds long search)
All those commands are not public anymore starting from version 2.1.
And "q" (quit) to quit, works with all versions.
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
-
- Posts: 859
- Joined: Mon Aug 10, 2009 10:05 pm
- Location: Italy
- Full name: Stefano Gemma
Re: perft moves list
Ok, this one works.
Merci beaucoup!
Merci beaucoup!

-
- Posts: 859
- Joined: Mon Aug 10, 2009 10:05 pm
- Location: Italy
- Full name: Stefano Gemma
Re: perft moves list
Thanks to Muller and Marcel that have helped me to find the bug, using their perct functions. The Muller's output is fast, for many depths testing while the Marcel one is good to refines the bug search.
The bug itself was on promotions with capture: the captured piece were disappear after that moves.
Now my perfect seems to works fine... until the next bug
The bug itself was on promotions with capture: the captured piece were disappear after that moves.
Now my perfect seems to works fine... until the next bug

-
- Posts: 2949
- Joined: Mon May 05, 2008 12:16 pm
- Location: Bordeaux (France)
- Full name: Julien Marcel
Re: perft moves list
Congrats!
I'm glad I could help. I remember those days when I was working on the move generator, with the most bizarre bugs producing weird results...
You probably know them yet, but here are good perft positions to catch bugs, with their correct results:
http://www.albert.nu/programs/sharper/perft.asp
http://chessprogramming.wikispaces.com/Perft+Results

You probably know them yet, but here are good perft positions to catch bugs, with their correct results:
http://www.albert.nu/programs/sharper/perft.asp
http://chessprogramming.wikispaces.com/Perft+Results
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]