Hoziron effect and extensions

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
User avatar
xr_a_y
Posts: 729
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

Hoziron effect and extensions

Post by xr_a_y » Mon Jun 25, 2018 8:29 am

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: 729
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

Re: Hoziron effect and extensions

Post by xr_a_y » Mon Jun 25, 2018 8:52 am

A very good source of information : http://talkchess.com/forum3/viewtopic.p ... ct#p730613

F. Bluemers
Posts: 860
Joined: Thu Mar 09, 2006 10:21 pm
Location: Nederland
Contact:

Re: Hoziron effect and extensions

Post by F. Bluemers » Mon Jun 25, 2018 5:39 pm

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: 806
Joined: Sun May 23, 2010 11:32 am
Contact:

Re: Hoziron effect and extensions

Post by elcabesa » Mon Jun 25, 2018 7:25 pm

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: 729
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

Re: Hoziron effect and extensions

Post by xr_a_y » Tue Jun 26, 2018 3:19 pm

F. Bluemers wrote:
Mon Jun 25, 2018 5:39 pm
Also ,if you did not already limit this,extend a move only once.
Ok let's try that, thanks

AlvaroBegue
Posts: 919
Joined: Tue Mar 09, 2010 2:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: Hoziron effect and extensions

Post by AlvaroBegue » Tue Jun 26, 2018 5: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;

User avatar
xr_a_y
Posts: 729
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

Re: Hoziron effect and extensions

Post by xr_a_y » Tue Jun 26, 2018 7:14 pm

xr_a_y wrote:
Tue Jun 26, 2018 3:19 pm
F. Bluemers wrote:
Mon Jun 25, 2018 5: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: 729
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

Re: Hoziron effect and extensions

Post by xr_a_y » Tue Jun 26, 2018 7:18 pm

AlvaroBegue wrote:
Tue Jun 26, 2018 5: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 3:44 pm
Location: London
Full name: Vincent
Contact:

Re: Hoziron effect and extensions

Post by konsolas » Fri Jun 29, 2018 10:11 pm

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: 729
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

Re: Hoziron effect and extensions

Post by xr_a_y » Sat Jun 30, 2018 8:05 am

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.

Post Reply