elihaber / sascha

Simple chess engine
0 stars 0 forks source link

Multiple cases where program returns invalid move or freezes #10

Open elihaber opened 3 years ago

elihaber commented 3 years ago

Describe the bug There are a whole bunch of different cases where the program did not respond properly to a move. I will enumerate some of them here, but there may be others in the future.

To Reproduce

  1. When the UI sent a position command with a fen instead of startpos, the program was not ready to handle it. Fixed.
  2. When searching for king moves, the program would return incorrect moves because it was checking that the wrong color was attacking the squares. Fixed.
  3. When checking the legality of different pawn promotions, the algebraic notation of the pawn move would become corrupted. Fixed.
  4. There is still at least one case where the engine died while in the process of searching for moves. I have not been able to reproduce it.

Expected behavior Things should work good.

elihaber commented 3 years ago

I think these have all been solved. They break up into a couple of categories.

  1. The engine sent an illegal move to the UI. The UI then ignores the move, while the engine does nothing because it feels it has completed its work. There were a number of bugs like these. There may be more, but I haven't found any in a while.
  2. Memory issues. This only happens with the debug build, so Tarrasch should always point to the release build. For some reason, the engine thread and recursion thread sometimes just die without any exception being thrown. This occurs less now that I have cleaned up some of the code, but it still does happen.