Page 1 of 1
Hoziron effect and extensions
Posted: Mon Jun 25, 2018 10:29 am
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 ?
Re: Hoziron effect and extensions
Posted: Mon Jun 25, 2018 10:52 am
by xr_a_y
Re: Hoziron effect and extensions
Posted: Mon Jun 25, 2018 7:39 pm
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
Re: Hoziron effect and extensions
Posted: Mon Jun 25, 2018 9:25 pm
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.
Re: Hoziron effect and extensions
Posted: Tue Jun 26, 2018 5:19 pm
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
Re: Hoziron effect and extensions
Posted: Tue Jun 26, 2018 7:44 pm
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;
Re: Hoziron effect and extensions
Posted: Tue Jun 26, 2018 9:14 pm
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 ...
Re: Hoziron effect and extensions
Posted: Tue Jun 26, 2018 9:18 pm
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;
Re: Hoziron effect and extensions
Posted: Sat Jun 30, 2018 12:11 am
by konsolas
You could try restricted singular extensions, which is a more general technique that can get a lot of elo
Re: Hoziron effect and extensions
Posted: Sat Jun 30, 2018 10:05 am
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.