Author: Tim Foden
Date: 01:47:54 12/07/00
Go up one level in this thread
On December 06, 2000 at 19:37:35, David Rasmussen wrote: >On December 06, 2000 at 19:01:14, Tim Foden wrote: > >>On December 06, 2000 at 15:38:18, David Rasmussen wrote: >> >>>I like determining the extensions in the beginning of Search(), because I think >>>it makes the function cleaner, with the central loop not cluttered with >>>extension code, and also, there is no need for extension code in the rootsearch >>>function if you have one. >> >>I used to do it this way. The only reason I changed to the way Crafty does it >>is that it means I always extend out of check before the q-search. It also >>means that the last level of normal search will detect checkmates, so you tend >>to see them 1 ply earlier. >> >>Cheers, Tim. > >I don't see what you mean, in either of your replies. >The way I do it is equivalent to what crafty does. The sequence is the same: > >makemove -> extend -> go to quiescence if depth<=0 I realise I may be wrong about this :-) It may depend on how you detect checks. Let's say depth is 1, and a move at this depth will cause a check and a checkmate. Let's also say that the move at the previous ply does not cause an extension. In crafty's case, the checking move will cause an extension, which will lead to Search() being called, which will cause the checkmate to be found. In your case, the checking move won't cause an extension, Quiesce() be called, checkmate missed until the next depth iteration. I don't think I'm very good at explaining this I'm afraid. >The only difference is where the extend code is: > >Crafty: > >makemove -> extend (search())-> go to quiescence if depth<=0 Search() 1. make move 2. loop through moves 3. extend if required 4. depth > 0 ? Search() : Quiese(); >My way: > >makemove ->(search()) extend -> go to quiescence if depth<=0 Search() 1. extend if required 2. loop through moves 3. make move 4. depth > 0 ? Search() : Quiesce() What if move would cause an extension (if you called Search() again), but you don't see it because you have called Quiesce()? So let's do a 1 ply search from this position: 1. e4 e5 2. Bc4 d6 3. Qf3 Nc6 [D]r1bqkbnr/ppp2ppp/2np4/4p3/2B1P3/5Q2/PPPP1PPP/RNB1K1NR w KQkq - 2 4 Eventually program will try move Qxf7#... but will it see the checkmate at 1 ply? SearchRoot() 1. extend if required (we don't extend, because we are at the root). 2. iterate through moves 3. make move Qxf7# 4. depth now 0, so go into Quiesce(). Quiesce() 5. Do you detect checkmates in Quiesce()?? It doesn't just work with checkmates, but with any extension at the lowest level of search. Is this any clearer at all? :-)) Cheers, Tim.
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.