mcostalba / scoutfish

Chess Query Engine
GNU General Public License v3.0
156 stars 23 forks source link

Bug in streaks embedded in sequences #50

Open arnsholt opened 3 years ago

arnsholt commented 3 years ago

Unless I've misunderstood how streaks and sequences are supposed to work together, a streak that matches partially before failing backtracks too far in the list of conditions.

Consider the following database and query (txt extensions to placate GitHub's extension allowlist):

test.pgn.txt query.json.txt

Scoutfish will only match the first game, not the second, which I think is wrong. The cause is scout.cpp:168-169, which sets condIdx to zero instead of 1, which means that in addition to discarding the failed partial streak match it also discards the matched e4 move which should not be discarded.