   Weird PV problem :( Chess paranoia.
  Hi,my chess engine makes occasional blunders like taking pawn with knight for nothing. So I decided to turn off all improvements (TT, zero-window search) and check what's going on. This time engine took pawn with rook on d4 (Rxd4) for nothing. Horizon is set to 4 plus QS. I've looked up PV and I'm still amazed. Looks like every position that can be equalized is good for the engine no matter I can capture rook with pawn and immediately win material. Can this be explained somehow? I don't understand how can search work in most cases but sometimes it simply doesn't. I really have no idea where look for a bug.[Edited by - BitSet on April 8, 2010 7:35:44 AM]
  Did you implement quiescence search?   ;Quote:Original post by BitSet[..] plus QS.[..]Yes, but it works too slow if I don't use stop condition:Return static evaluation when SE is big enough to fail high, in other words:int64 score = eval();if (score >= beta)    return score;For me it looks like some kind of null-move heuristic and I'm not sure if this can cause problems or not. I saw this used in Crafty and TSCP.   ;  That condition is called "standing pat", and it's a basic element of how quiescence search works. It basically says that in a capture search, the side to move has the option to not capture and just take the current score. You can read about it here.I would implement it like this:int64 score = eval();if (score > alpha) {    alpha = score;    if (score >= beta)   return score;}As for your problem, debugging these things is hard. See if you can narrow down the problem to a call to QS that doesn't return the right thing. That should be easier to look at.;  Yes I have already read this and other articles. But I'm not sure if this "standing pat" condition is 100% safe in every position other than Zugzwang. Not capturing will of course lead to calm position but for me it isn't so obvious because I can easily imagine position in which not capturing will lead to immediate capture from opponent and loss of material. But maybe it's because I don't take some other factors into consideration.   ;Quote:Original post by BitSetYes I have already read this and other articles. But I'm not sure if this "standing pat" condition is 100% safe in every position other than Zugzwang. Not capturing will of course lead to calm position but for me it isn't so obvious because I can easily imagine position in which not capturing will lead to immediate capture from opponent and loss of material. But maybe it's because I don't take some other factors into consideration.Well, this is at the very end of the tree, so you can't expect to see everything. The situation you describe (where I can stand pat in QS but actually some of my own pieces are hanging) can indeed happen. You can have some penalties for having hanging pieces in the evaluation function (especially two of them), and that can improve tactics.Did you figure out the problem with your program?   ;Quote:Original post by alvaroDid you figure out the problem with your program?Well I've found several bugs, for example in my search I was expanding drawn states.I have huge problem with my QS. I have no idea how QS should handle mates. I expand checks but if side on move has no legal moves it doesn't mean side on move lost the game because I generate only captures, promotions and checks. I guess the simplest solution is to generate whole set of moves when it looks like side is lost and check if list of all moves is empty. QS in TSCP doesn't handle mates at all.BTW what playing strength should have new chess engine developed from scratch for a period of one month? I'm quite depressed because my engine cannot even defeat ChessMaster Xth personalities with rating about 1800 - It's very easy for human to beat them.   ;Quote:Original post by BitSetQuote:Original post by alvaroDid you figure out the problem with your program?Well I've found several bugs, for example in my search I was expanding drawn states.I have huge problem with my QS. I have no idea how QS should handle mates. I expand checks but if side on move has no legal moves it doesn't mean side on move lost the game because I generate only captures, promotions and checks. I guess the simplest solution is to generate whole set of moves when it looks like side is lost and check if list of all moves is empty. QS in TSCP doesn't handle mates at all.Most programs revert to a normal node (no stand-pat option and generate all moves) if the side to move is in check. Getting QS to work correctly is very tricky, especially with respect to finding mate.Perhaps you should use a different program to learn from. I once looked at Fruit's code and it seemed really well done.Quote:BTW what playing strength should have new chess engine developed from scratch for a period of one month? I'm quite depressed because my engine cannot even defeat ChessMaster Xth personalities with rating about 1800 - It's very easy for human to beat them.It's hard to tell, but don't get discouraged. Once you remove all the bugs in your basic search you'll probably see much faster progress. One of the "secrets" of writing a good engine is perseverance.