billforsternz / tarrasch-chess-gui

A portable, simple, desktop workbench for chess players and analysts
MIT License
95 stars 19 forks source link

logical condition always false #8

Closed maddin200 closed 6 years ago

maddin200 commented 7 years ago

\src\MemoryPositionSearch.cpp line 1743

if( 8<=src && src<6

should be probably: (src < 16)

billforsternz commented 7 years ago

Goodness me, you are completely correct of course. This is part of a line that is supposed to abort a game search if the position we are searching for has a home row black pawn (on squares a7 to h7) and during the game such a pawn moves (one square forward) - meaning that of course the game can never reach the target position. There are 8 lines of code like this - for each of black and white single pawn advance, double pawn advance, left capture and right capture. Only the black pawn, one square forward version has the bug.

The consequence of this is a small but significant performance penalty in the search. Fortunately the search results are unaffected.

Thank you very much for reporting this. In 2015 I made an effort to get to zero warnings (with MSVC compilers) and am surprised that this wasn't picked up by my compiler.

I will incorporate a fix into the next version.

billforsternz commented 6 years ago

Finally closing with pre-release V3.06a