hi all!
I try to debug my program since long time lol
I would like to know if my movegen is bug free (!) I ran some perft positions from wiki with nodes by type moves ( castle , ep etc ..)
Strange thing , I have the good number of nodes but many erros with nodes number by type moves...
I built my perft function on the wiki pseudo code , I think is bugfree...lol
Do you know a program who give all nodes (by type moves) for every positions setup by the user ?
I'm so disapointed when I saw that my genmove (and maybe make and unmake too) function is all buggy , some help is welcome
bye all!
perft
Moderators: hgm, Rebel, chrisw
-
- Posts: 5566
- Joined: Tue Feb 28, 2012 11:56 pm
Re: perft
You might just be counting the various types of moves differently, so ignore that.Daniel Anulliero wrote:I would like to know if my movegen is bug free (!) I ran some perft positions from wiki with nodes by type moves ( castle , ep etc ..)
Strange thing , I have the good number of nodes but many erros with nodes number by type moves...
Concentrate on the perft counts and test more positions. If there is one count that deviates from the correct count as reported by the various perft implementations around, then find and fix the bug in your code.
Re: perft
Am I right that those perft-values not always follow the correct rules, e.g. that occasionally when using the validation of the moves is too strict, that different values are returned?syzygy wrote:Concentrate on the perft counts and test more positions. If there is one count that deviates from the correct count as reported by the various perft implementations around, then find and fix the bug in your code.
For example:
Code: Select all
8/3K4/2p5/p2b2r1/5k2/8/8/1q6 b - -
-
- Posts: 759
- Joined: Fri Jan 04, 2013 4:55 pm
- Location: Nice
Re: perft
hi
thx for your reply ronald
But can you explain better why I can ignore the results for each type of moves ? My program have not the same number of captures too for example , it must be the same no ?
folkert , welcome to the "perft brain break" !
thx for your reply ronald
But can you explain better why I can ignore the results for each type of moves ? My program have not the same number of captures too for example , it must be the same no ?
folkert , welcome to the "perft brain break" !
Isa download :
-
- Posts: 2559
- Joined: Fri Nov 26, 2010 2:00 pm
- Location: Czech Republic
- Full name: Martin Sedlak
Re: perft
There was a thread about some artificial test positions that should help to find many pitfalls: http://talkchess.com/forum/viewtopic.ph ... t&start=15
It might help you.
It might help you.
-
- Posts: 102
- Joined: Sun Sep 09, 2007 6:32 am
Re: perft
Perft is like a calculator. If your calculator says 2+2=5 then it has a bug.flok wrote:Am I right that those perft-values not always follow the correct rules, e.g. that occasionally when using the validation of the moves is too strict, that different values are returned?syzygy wrote:Concentrate on the perft counts and test more positions. If there is one count that deviates from the correct count as reported by the various perft implementations around, then find and fix the bug in your code.
For example:With my program it finds 6 nodes, while the webpage I got this perft from says it should be 50.Code: Select all
8/3K4/2p5/p2b2r1/5k2/8/8/1q6 b - -
Perft is always an exact calculation. If it's different by even 1 then you have a bug somewhere.
-
- Posts: 5566
- Joined: Tue Feb 28, 2012 11:56 pm
Re: perft
I'm afraid even your FEN parsing code is full of bugs.flok wrote:Am I right that those perft-values not always follow the correct rules, e.g. that occasionally when using the validation of the moves is too strict, that different values are returned?syzygy wrote:Concentrate on the perft counts and test more positions. If there is one count that deviates from the correct count as reported by the various perft implementations around, then find and fix the bug in your code.
For example:With my program it finds 6 nodes, while the webpage I got this perft from says it should be 50.Code: Select all
8/3K4/2p5/p2b2r1/5k2/8/8/1q6 b - -
-
- Posts: 2559
- Joined: Fri Nov 26, 2010 2:00 pm
- Location: Czech Republic
- Full name: Martin Sedlak
Re: perft
Check your FEN parser. It's possible that it swaps side to move (or even black and white piecesflok wrote:With my program it finds 6 nodes, while the webpage I got this perft from says it should be 50.
-
- Posts: 5566
- Joined: Tue Feb 28, 2012 11:56 pm
Re: perft
Only if you count them in exactly the same way. If your total perft results are always correct, then you can be pretty sure that your move generator is correct. (Of course it is difficult to know that it is *always* correct, so be sure to test it on positions that test most of the special cases.)Daniel Anulliero wrote:hi
thx for your reply ronald
But can you explain better why I can ignore the results for each type of moves ? My program have not the same number of captures too for example , it must be the same no ?
Captures can be counted in many ways:
- including or excluding en passant;
- including or excluding promotion captures;
- only in the leaves or including "internal" captures.
You can try to find out why the capture counts differ if it really bugs you, but it is not pointing to a bug unless you are certain that you count captures in the same way.