Skip to main content

Perft to find bugs in move generation

22 Jun 2022

after 2 am

  • almost completed legal move generation function
  • issue: sometimes switches black and white during random play
  • issue: handling castling rights and enpassant squares while undoing a move

23 Jun 2022

after 12 am

  • bugfix: san notation doesn't show promotion
  • added perft and divide function
  • now we can find corner cases easily!

    2 am

  • wasted 1 hour on why I'm getting 1 move less than expected reason: code generates kingside else queenside castling moves 🥲

    3 am

  • bugfix: now engine checks threatened squares during castling
  • improved perft function
  • still a lot of things to do (getting wrong perft results)

Comments

Popular posts from this blog

Move generation

1 Jun 2022 after 12 am ditching color output for now reading evening, night more reading modularizing, exceptions 2 Jun 2022 after 12 am started writing this blog lol ### started writing move generation function

Bugfixes in move generation

  27 Jun 2022 3 pm found one corner case: castling is still allowed after rook capture! 9 Jul 2022 afternoon fixed a corner case with promotion (earlier it always promoted to white pieces) 10 Jul 2022 after 12 am fixed a few corner cases with castling (pawns don't threaten blank squares) move count fixed planning to automate perft graphics??? afternoon another castling bug (capturing rook with king cleared only king's castling rights) reason:  else

Faster move generation, Mate in X tests

  24 Dec 2022 1:30 am better  uci  handling, using  istringstream  to parse commands better Mate Score output added Mate in 2, 3, and 4 tests (and they pass! but slow) inlined some functions (maybe faster now?) added Search Type:  Infinite ,  Fixed Depth ,  Time per Move ,  Time per Game ,  Ponder  and  Mate . Not all of them are working yet :') 3 am movelist.reserve(40) : doing this made move generation ~1.5x faster! Now reserving in all vectors. modularized move generation added  get_threats  function