Some bugs with interesting playing-style aspects

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Some bugs with interesting playing-style aspects

Post by Evert »

I recently introduced (and subsequently fixed) a number of bugs that had interesting side-effects in that they caused, occasionally, very peculiar and human-like blunders. Since I know some people here are interested in making an engine that has human-like weaknesses, I thought I'd share.

The first is very simple: after the search and obtaining a PV, I inject the recovered PV into the transposition table. A very easy thing to do, and pretty standard (obviously not if you extract the PV from the transposition table). However, I forgot to flip the sign of the score on odd plies - which leads to some very funny blunders and unstable scores.

The second is a bit more tricky. I have a pseudo-legal move generator, so I test whether a move leaves the king in check after making it. However, I messed up on the first move searched and tested instead whether it delivered check instead. If it did, the move was skipped. This leads to some very interesting blind-spots in the search where the engine will sometimes "overlook" a fork or mate, but not always (if the move wasn't sorted first).

Experimenting with intentionally injecting similar errors could be interesting for a "human-like blunders" difficulty setting in engines that implement something like that.