Author: James Swafford
Date: 12:12:47 09/20/04
Go up one level in this thread
On September 20, 2004 at 13:11:38, Michael Henderson wrote:
>On September 20, 2004 at 10:17:01, James Swafford wrote:
>
>>On September 19, 2004 at 23:47:24, Michael Henderson wrote:
>>
>>>On September 19, 2004 at 23:30:43, James Swafford wrote:
>>>
>>>>Someone recently posted that they verify their SEE with a
>>>>search (generating only moves to the target square).
>>>>I did that,and seems I caught one. :)
>>>>
>>>>See position below... does your SEE see the promotion?
>>>>
>>>>
>>>>
>>>>Problem 1:
>>>>8/7p/5k2/5p2/p1p2P2/Pr1pPK2/1P1R3P/8 b - - b3b2;
>>>>
>>>>parsing: b3b2...done.
>>>>correct move(s): b3b2
>>>>gamestage: 3
>>>>search time=10000
>>>>FW Dpth Nd Cnt CSecs Score PV Line
>>>> 4& -> 1495 0 30 h7h5 h2h4 c4c3 b2c3 b3c3
>>>>*** val=-400 (currval=-400; sv=-800); see=400
>>>>
>>>>- - - - - - - -
>>>>- - - - - - - p
>>>>- - - - - k - - white to move
>>>>- - - - - p - - no ep
>>>>p - - - - P - - no castling rights
>>>>P - - - P K - P
>>>>- - p - - - - -
>>>>- - - q - - - R
>>>>
>>>>move h1d1
>>>>
>>>>--
>>>>James
>>>
>>>My SEE does not see promotions, so i get +400 SEE also. There are a large
>>>number of positions where SEE messes up...that you probably know. e.g Bxd5 isn't
>>>really +300, unless you detect pins to the king.
>>>
>>>[D]7k/2n3r1/8/3b4/8/5B2/6Q1/6K1 w - - 0 1
>>
>>
>>My SEE says +310, though I do (or thought I did) detect
>>pins. My search verification says 0, though, so at
>>least my debug code works. :-/
>>
>>--
>>James
>
>Would search verification really return a negative number because white will
>lose the queen soon? What makes up a verification search?
No, it wouldn't. I can't remember who orignally posted it-
but it's not my idea. I just thought it was a really nice
way to verify a SEE, and it seems to work nicely.
Basically, it's just a qsearch. stand_pat is just the material
imbalance, and you try to improve upon that by searching
captures ----to target_square----.
Here's some code. I won't swear it's bug free- I just
finished it last night and haven't used it much yet.
But you'll get the idea...
int SEE_Validate(Position *cp,int dest_sq,int ply)
{
BOOL made_move=false;
int score=cp->getMaterialImbalance();
if (cp->getPTM()==BLACK)
score=-score;
//
// What we want here is to gen moves to dest_sq. We're going to
// be lazy about it and gen all captures, then only play the
// appropriate ones. Hey-- this routine is only for testing,
// right?? :)
//
mptr_debug[ply+1]=movegen.GenCaps(mptr_debug[ply],cp,false);
for (mvs* mp=mptr_debug[ply];mp<mptr_debug[ply+1];mp++) {
if (mp->mv.cm.dest != dest_sq)
continue;
cp->makeMove(mp->mv.cm);
int s=((cp->getPTM())?cp->getBlackKing():cp->getWhiteKing());
if (attack.isAttacked(s,cp->getPTM(),cp)) {
cp->unmakeMove();
continue;
}
made_move=true;
mp->s=-SEE_Validate(cp,dest_sq,ply+1);
cp->unmakeMove();
if (mp->s > score) {
score=mp->s;
}
}
return score;
}
--
James
>
>Michael
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.