Hoziron effect and extensions

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Hoziron effect and extensions

Post by xr_a_y »

Seeing Weini fail quite often due to delaying moves or intermediate checks I thought it might be a good idea to add check and recapture extension to the search. I try to apply then separately, only inside PV or everywhere, only at root or inside the tree, nothing is good ... all small elo loss (at least for short TC : 20sec/40, I suspect it will be better for larger TC).

Question is : what are the best strategies against horizon effect for short TC ?
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: Hoziron effect and extensions

Post by xr_a_y »

A very good source of information : http://talkchess.com/forum3/viewtopic.p ... ct#p730613
F. Bluemers
Posts: 868
Joined: Thu Mar 09, 2006 11:21 pm
Location: Nederland

Re: Hoziron effect and extensions

Post by F. Bluemers »

Probably best is first to get pruning/reductions to work well or better.So there is more time to search deeper.
Extensions might make it even harder.
Also ,if you did not already limit this,extend a move only once.

Best
Fonz
elcabesa
Posts: 855
Joined: Sun May 23, 2010 1:32 pm

Re: Hoziron effect and extensions

Post by elcabesa »

In Vajolet i extend moves that gives check and have SEE >= 0 by half ply for non PV search, and moves that gives check or are passed pawn moves by one ply for PV search.

that said extension and reduction are used to search more deeply interesting path and reduce less promising ones. for my experience, reduction or pruning seems more easy since they don't have the risk of search explosion.
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: Hoziron effect and extensions

Post by xr_a_y »

F. Bluemers wrote: Mon Jun 25, 2018 7:39 pm Also ,if you did not already limit this,extend a move only once.
Ok let's try that, thanks
AlvaroBegue
Posts: 931
Joined: Tue Mar 09, 2010 3:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: Hoziron effect and extensions

Post by AlvaroBegue »

In my experience, it is important to be restrictive in the definition of recapture. My code currently does something like this:

Code: Select all

  bool extend = false;

  // Extend checks                                                                                                                           
  if (!extend && in_check)
    extend = true;

  // Extend recaptures                                                                                                                       
  if (!extend
      && last_two_moves_had_the_same_destination_square()
      && last_two_moves_captured_pieces_of_the_same_value()) {
    extend = true;
  }
  
  int next_depth = depth - !extend;
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: Hoziron effect and extensions

Post by xr_a_y »

xr_a_y wrote: Tue Jun 26, 2018 5:19 pm
F. Bluemers wrote: Mon Jun 25, 2018 7:39 pm Also ,if you did not already limit this,extend a move only once.
Ok let's try that, thanks
Seems not good at all in Weini to restrict to only +1 extension. This is weird because, during this test, only activated extensions were check, single_reply, and near_promotion which not cumulate very often (recapture and singular were off)... maybe something in end-game with checks and promotion ...
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: Hoziron effect and extensions

Post by xr_a_y »

AlvaroBegue wrote: Tue Jun 26, 2018 7:44 pm In my experience, it is important to be restrictive in the definition of recapture. My code currently does something like this:

Code: Select all

  bool extend = false;

  // Extend checks                                                                                                                           
  if (!extend && in_check)
    extend = true;

  // Extend recaptures                                                                                                                       
  if (!extend
      && last_two_moves_had_the_same_destination_square()
      && last_two_moves_captured_pieces_of_the_same_value()) {
    extend = true;
  }
  
  int next_depth = depth - !extend;
Same ! but only inside PV

Code: Select all

        if (Definitions::extensionConfig.do_ReCaptureExtensionAlphaBeta
            && isPV
            && Square::IsValid(lastCapture)
            && move.To() == lastCapture
            && Piece::ValueAbs(currentP.Info().lastCapture) - Piece::ValueAbs(lastCapturePiece) < 100) {
            ++depth;
konsolas
Posts: 182
Joined: Sun Jun 12, 2016 5:44 pm
Location: London
Full name: Vincent

Re: Hoziron effect and extensions

Post by konsolas »

You could try restricted singular extensions, which is a more general technique that can get a lot of elo
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: Hoziron effect and extensions

Post by xr_a_y »

I have already implemented something based on stockfish implementation :

Code: Select all

        if (Definitions::extensionConfig.do_SingularExtensionAlphaBeta
            && depth >= 8
            && ttt.depth >= depth - 3
            && ttt.t_type == Transposition::tt_alpha
            && isPV
            && bestMoveFound
            && ! extended) {
            ScoreType rBeta = std::max(ttt.score - 2 * depth, -Definitions::scores.checkMateScore);
            // To verify this we do a reduced search on all the other moves but the tt one and if the
            // result is lower than tt score minus a margin then we will extend the tt move ONLY.
            FastContainer<Move> moves2(moves);
            moves2.erase(moves2.begin());
            SearcherBase::SearchedMove swallowValue = searcher.SearchRoot(rBeta - 1, rBeta, moves2, previousP, depth / 2,
                                                                          NULL,  // never update pv here
                                                                          false, // forbid nullmove
                                                                          false, // no subject to time control
                                                                          true,  // forbid extension
                                                                          false, // given moves are NOT trusted
                                                                          false, // no display
                                                                          false);// no debug display
            if (SearcherBase::GetMove(swallowValue).IsValid() && SearcherBase::GetScore(swallowValue) < rBeta) {
                ++depth;
                extended = true;
                ++Stats::countSingularExtensionAlphaBeta;
                if (onlyOneExtension ) return true;
            }
        }
It indeed get some elo.