Quiescence Search and Checkmates

Code, algorithms, languages, construction...
Post Reply
CDaley11
Posts: 42
Joined: Thu Jan 10, 2013 6:23 am
Real Name: Christian Daley

Quiescence Search and Checkmates

Post by CDaley11 » Fri Jan 11, 2013 2:25 am

Hey guys, I have another question for you :). I have implemented quiescence search into my program. It seems to be working well in terms of helping it see tactics that require alot of look ahead. However, I set my program up with a simple mate in 2, and the quiescence search caused my program not to see it. Basically, in the normal search when the target depth is reached, instead of returning a "stand pat" evaluation it returns a quiescence search evaluation. If I just have the program return the stand pat evaluation then it finds the mate in 2. If I have it return the quiescence search evaluation then it does not find it, but the quiescence search does test for checkmate. Anyways, here's the really wired part. The checkmate I'm testing it with requires a search of only 3ply to find. Once my program finds a checkmate it stops evaluation completely. If I use the quiescence search, it does not find the checkmate even though it is searching to a depth of about 10. This really makes no sense. The checkmate can be seen on ply 3, and the quiescence search isn't even used until ply 10. Yet including the quiescence search causes my program to fail to find the checkmate. Thanks in advance for any help, this is a major project for my AP Computer Science class that I'm working on and I have just 2 weeks left to finish it :P.

Also, if it makes any difference, I am using iterative deepening.

Edit: I just ran a test, and the iterative deepening is combining with the quiescence search to throw it off. If I start the search with a target depth of 3 ply (as opposed to 1 ply and then going up from there) it does find the checkmate! So something is going wrong in the first 2 plys with the quiescence, I still don't know what...

CDaley11
Posts: 42
Joined: Thu Jan 10, 2013 6:23 am
Real Name: Christian Daley

Re: Quiescence Search and Checkmates

Post by CDaley11 » Fri Jan 11, 2013 2:50 am

Also, If I remove the aspiration windows, it works. Even though it checks if the returned value is outside the alpha-beta window and re-does the search if it is.

lucasart
Posts: 201
Joined: Mon Dec 17, 2012 1:09 pm
Contact:

Re: Quiescence Search and Checkmates

Post by lucasart » Fri Jan 11, 2013 4:26 am

CDaley11 wrote:Hey guys, I have another question for you :). I have implemented quiescence search into my program. It seems to be working well in terms of helping it see tactics that require alot of look ahead. However, I set my program up with a simple mate in 2, and the quiescence search caused my program not to see it. Basically, in the normal search when the target depth is reached, instead of returning a "stand pat" evaluation it returns a quiescence search evaluation. If I just have the program return the stand pat evaluation then it finds the mate in 2. If I have it return the quiescence search evaluation then it does not find it, but the quiescence search does test for checkmate. Anyways, here's the really wired part. The checkmate I'm testing it with requires a search of only 3ply to find. Once my program finds a checkmate it stops evaluation completely. If I use the quiescence search, it does not find the checkmate even though it is searching to a depth of about 10. This really makes no sense. The checkmate can be seen on ply 3, and the quiescence search isn't even used until ply 10. Yet including the quiescence search causes my program to fail to find the checkmate. Thanks in advance for any help, this is a major project for my AP Computer Science class that I'm working on and I have just 2 weeks left to finish it :P.

Also, if it makes any difference, I am using iterative deepening.

Edit: I just ran a test, and the iterative deepening is combining with the quiescence search to throw it off. If I start the search with a target depth of 3 ply (as opposed to 1 ply and then going up from there) it does find the checkmate! So something is going wrong in the first 2 plys with the quiescence, I still don't know what...
Make sure you only allow the qsearch() stand-pat option when you are not in check. IOW never let the qsearch stop when in check and return the current eval. I can't tell you where the bug is, without seeing your code, but that's the most obvious possible bug I can think of.
"Talk is cheap. Show me the code." -- Linus Torvalds.

Post Reply