ChessUSA.com TalkChess.com
Hosted by Your Move Chess & Games
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Verification search
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions Flat
View previous topic :: View next topic  
Author Message
Eelco de Groot



Joined: 12 Mar 2006
Posts: 2591
Location: Groningen

PostPost subject: Very minor verification search modification.    Posted: Tue Jun 26, 2012 4:47 pm Reply to topic Reply with quote

Sometimes I think Houdini does not do Nullmove, so it never stops searching... Cool Recursive nullmove can shave off a lot of depth, no limit if it weren't for the reduction itself running out of enough plies to reduce.. After a reciprocal null move is done suddenly you have legal positions again. Very weird stuff, amazing that it works so well in general! I have no way of measuring it but I think, very uneducated guess, nullmove reduces very roughly about as much as Late Move Pruning and Futility Pruning (not counting LMR) in Rainbow Serpent, measured against non reduced moves. Just a gut feeling, could be very wrong. RS does LMP and Futility everywhere in the last 24 plies still, so compared to that Ivanhoe is like a knight with agoraphobia Smile 10 plies, pffft. There must be a way to strengthen the verification search though. I know Ryan Benitez has discovered a trick to improve nullmove in the source in less than 5 minutes for Fruit for an improvement by twenty elopoints, and on this forum only Chris Conkie was told how to do it. But we never found out what it was. It can't be in new Fruit's verification search though because Ryan abandoned doing that.

Didn't sleep too well because I wanted to do something like that, how hard could it be to find such a thing? But I don't think I am really on to it yet. I did think of a way to 'link' nullmove and the verification search a little bit like in Glaurung was done by Tord with the threatmove that links nullmove search with the full search. But because the nullmove will have failed high in case of verification, you do not have a 'real' threatmove, as the response move to nullmove (I call this the 'repair' move) does not cross alpha. But on the plusside, you have tried almost every illegal move possible after the nullmove, trying to find that cut-off. On the downside again there is no way to know the best move in an All-node and the deeper you search the worse the estimate of the real value is going to be, if you even store such a thing. But still, I think there is something you could do with the stored move, if you do actually do store the move that is still called the bestmove in Stockfish, even if it is very little. I call the result a 'weak threatmove' and because verification search does not do a nullmove in the first ply, you can replace a 'real' threatmove with this 'weakThreatmove' that I thought up in the half hour I gave myself to find Ryan's five minute change. It is likely I messed up the implementation, but this is what I got done after half an hour between sleepcycles:

Previous version:
Code:

    // Step 7. Static null move pruning (is omitted in PV nodes)
    // We're betting that the opponent doesn't have a move that will reduce
    // the score by more than futility_margin(depth) if we do a null move.
    if (   !PvNode
        && !ss->skipNullMove
        &&  depth < RazorDepth
        && !inCheck
        &&  refinedValue - futility_margin(depth, 0) >= beta
        &&  abs(beta) < VALUE_MATE_IN_MAX_PLY
        &&  pos.non_pawn_material(pos.side_to_move()))
        return refinedValue - futility_margin(depth, 0);

    // Step 8. Null move search with verification search (is omitted in PV nodes)


changed to:
Code:

    // Step 7. Static null move pruning (is omitted in PV nodes)
    // We're betting that the opponent doesn't have a move that will reduce
    // the score by more than futility_margin(depth) if we do a null move.
    if (   !PvNode
        && !ss->skipNullMove
        &&  depth < RazorDepth
        && !inCheck
        &&  refinedValue - futility_margin(depth, 0) >= beta
        &&  abs(beta) < VALUE_MATE_IN_MAX_PLY
        &&  pos.non_pawn_material(pos.side_to_move()))
        return refinedValue - futility_margin(depth, 0);
        else if (ss->skipNullMove
            &&  (ss-1)->currentMove != MOVE_NULL
            &&   ss->threatMove != MOVE_NONE
            &&   depth > ONE_PLY
            &&  !PvNode
            &&   ss->currentMove == MOVE_NULL) //[We are in verificationsearch]
            {
                 weakThreatmove = ss->threatMove;
                 ss->threatMove = MOVE_NONE;
            }


    // Step 8. Null move search with verification search (is omitted in PV nodes)


Previous version:
Code:

            // Do verification search at high depths
            ss->skipNullMove = true;
            verificationValue = search<NonPV>(pos, ss, alpha, beta, depth-R*ONE_PLY);
            ss->skipNullMove = false;

            if (verificationValue >= beta)
                return nullValue;


changed to:
Code:

            // Do verification search at high depths
            ss->skipNullMove = true;
            ss->threatMove = (ss+1)->currentMove;
            verificationValue = search<NonPV>(pos, ss, alpha, beta, depth-R*ONE_PLY);
            ss->threatMove = MOVE_NONE;
            ss->skipNullMove = false;


In Step 13:
Code:

&& (!threatMove || !connected_threat(pos, move, threatMove))


changed to:
Code:

&& (!threatMove || !connected_threat(pos, move, threatMove))
&& (!weakThreatmove || !connected_threat(pos, move, weakThreatmove))


Of course I have to declare weakThreatmove and make sure it gets evaluated in Splitnodes too so changes to thread.cpp and thread.h were necessary too, for me that is by far the most complex part to make changes and where most compilation errors are possible. But that is more obvious to the better programmers here, I will leave those changes out from this posting. So only very little changes had to be made in the (modified) Stockfish code, the effect of which are unknown though:

I have no idea if this is actually doing some good as it actually increases the possibility of a nullmove pruning, not more safe nullmove pruning, because the verification search does less futility pruning; there are slightly more moves searched there that can cause the verification search to fail high. It still may be more accurate though but I have no idea at the moment, only ran McMad's latest testposition and only with this new version so far.

Eelco
_________________
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
Back to top
View user's profile Send private message
Display posts from previous:   
Subject Author Date/Time
Verification search Lucas Braesch Thu Jun 14, 2012 1:07 pm
      Re: Verification search Robert Hyatt Thu Jun 14, 2012 1:19 pm
            Re: Verification search Pawel Koziol Thu Jun 14, 2012 2:54 pm
            Re: Verification search Lucas Braesch Fri Jun 15, 2012 4:00 am
                  Re: Verification search Eelco de Groot Fri Jun 15, 2012 12:54 pm
                  Re: Verification search Daniel Homan Fri Jun 15, 2012 3:00 pm
                  Re: Verification search Lucas Braesch Sat Jun 16, 2012 3:18 am
                        Re: Verification search Vincent Diepeveen Thu Jun 21, 2012 2:47 pm
                              Re: Verification search Larry Kaufman Sat Jun 23, 2012 5:06 am
                                    Re: Verification search Vincent Diepeveen Sun Jun 24, 2012 10:32 am
                                          Re: Verification search Larry Kaufman Sun Jun 24, 2012 2:40 pm
                                                Re: Verification search Vincent Diepeveen Tue Jun 26, 2012 10:40 am
                                                      Re: Verification search Don Dailey Tue Jun 26, 2012 11:09 am
                                                            Very minor verification search modification. Eelco de Groot Tue Jun 26, 2012 4:47 pm
                                                                  Re: Very minor verification search modification. Vincent Diepeveen Wed Jun 27, 2012 1:30 am
                  Re: Verification search Vincent Diepeveen Sat Jun 16, 2012 2:58 pm
      Re: Verification search Karlo Bala Jr. Fri Jun 15, 2012 7:30 am
            Re: Verification search Lucas Braesch Fri Jun 15, 2012 11:02 am
                  Re: Verification search Pawel Koziol Fri Jun 15, 2012 12:13 pm
                  Re: Verification search Karlo Bala Jr. Fri Jun 15, 2012 1:58 pm
      Re: Verification search J. Wesley Cleveland Sat Jun 16, 2012 12:12 am
      Re: Verification search Don Dailey Sat Jun 16, 2012 10:32 pm
            Re: Verification search Lucas Braesch Sun Jun 17, 2012 3:13 am
                  Re: Verification search Don Dailey Sun Jun 17, 2012 3:41 am
                  Re: Verification search Miguel A. Ballicora Sun Jun 17, 2012 4:21 am
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Powered by phpBB © 2001, 2005 phpBB Group
Enhanced with Moby Threads