Large search depths

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Large search depths

Post by Henk »

I don't understand how other chess programs can reach search depths > 15 Do they put R = 7 or so when null move pruning, or what kind of reductions do they use to reach these depths.

I use R= 2 or 3. If I use R > 3 my chess programs makes more blunders.

I also use:

If depth > 3
depth = depth - 3
else depth = depth - 2

to prevent null move pruning from going too early into quiescence search.
I still don't know if this is necessary, but it looks safer.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Large search depths

Post by lucasart »

Henk wrote:I don't understand how other chess programs can reach search depths > 15 Do they put R = 7 or so when null move pruning, or what kind of reductions do they use to reach these depths.

I use R= 2 or 3. If I use R > 3 my chess programs makes more blunders.

I also use:

If depth > 3
depth = depth - 3
else depth = depth - 2

to prevent null move pruning from going too early into quiescence search.
I still don't know if this is necessary, but it looks safer.
Razoring and Eval pruning will give you an extra 1-2 depth on average (depending on how aggressive you do it). But what gives the most is aggressive LMR.

Anyway, the depth is not important. The ELO only is important. It's trivial to reduce your effective branching factor in a brutal and uncunning way, and display high search depths. What is not trivial is to tune everything nicely so that you reduce the branching factor yet minimize the tctical cost.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Large search depths

Post by Henk »

lucasart wrote:
Henk wrote:I don't understand how other chess programs can reach search depths > 15 Do they put R = 7 or so when null move pruning, or what kind of reductions do they use to reach these depths.

I use R= 2 or 3. If I use R > 3 my chess programs makes more blunders.

I also use:

If depth > 3
depth = depth - 3
else depth = depth - 2

to prevent null move pruning from going too early into quiescence search.
I still don't know if this is necessary, but it looks safer.
Razoring and Eval pruning will give you an extra 1-2 depth on average (depending on how aggressive you do it). But what gives the most is aggressive LMR.

Anyway, the depth is not important. The ELO only is important. It's trivial to reduce your effective branching factor in a brutal and uncunning way, and display high search depths. What is not trivial is to tune everything nicely so that you reduce the branching factor yet minimize the tctical cost.
What does aggressive LMR mean ? Is it:

pruning after move one instead of after the killer moves, or is it
reducing with more than one ply or
the state of the mind of the programmer for he tried it twenty times or more and it never worked.
ZirconiumX
Posts: 1334
Joined: Sun Jul 17, 2011 11:14 am

Re: Large search depths

Post by ZirconiumX »

Henk wrote:
lucasart wrote:
Henk wrote:I don't understand how other chess programs can reach search depths > 15 Do they put R = 7 or so when null move pruning, or what kind of reductions do they use to reach these depths.

I use R= 2 or 3. If I use R > 3 my chess programs makes more blunders.

I also use:

If depth > 3
depth = depth - 3
else depth = depth - 2

to prevent null move pruning from going too early into quiescence search.
I still don't know if this is necessary, but it looks safer.
Razoring and Eval pruning will give you an extra 1-2 depth on average (depending on how aggressive you do it). But what gives the most is aggressive LMR.

Anyway, the depth is not important. The ELO only is important. It's trivial to reduce your effective branching factor in a brutal and uncunning way, and display high search depths. What is not trivial is to tune everything nicely so that you reduce the branching factor yet minimize the tctical cost.
What does aggressive LMR mean ? Is it:

pruning after move one instead of after the killer moves, or is it
reducing with more than one ply
Aggressiveness in computer chess is finding as little to not prune as possible.

*If* you can find the correct conditions to prune, then you can do both of those.

Generally speaking, it is safe to reduce moves more than 1 ply after move 20 on the list.

Reducing killer moves is probably best left until you are over 2500 Elo.
or
the state of the mind of the programmer for he tried it twenty times or more and it never worked.
:)

Matthew:out
Some believe in the almighty dollar.

I believe in the almighty printf statement.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Large search depths

Post by Henk »

ZirconiumX wrote: Reducing killer moves is probably best left until you are over 2500 Elo.

Matthew:out
Is there a LMR implementation for beginners ? Only a few conditions and guaranteed to work. And can you apply LMR within null move pruning for
they both are applied when not in PV. And if you use LMR in null move pruning what should be the value of R. And what to do about moves at the end that are reduced all the time and may become reduced too much.
ZirconiumX
Posts: 1334
Joined: Sun Jul 17, 2011 11:14 am

Re: Large search depths

Post by ZirconiumX »

Henk wrote:
ZirconiumX wrote: Reducing killer moves is probably best left until you are over 2500 Elo.

Matthew:out
Is there a LMR implementation for beginners ?
This was where I started.
Only a few conditions and guaranteed to work.
You won't know what said conditions are until you try them out, Henk.
And can you apply LMR within null move pruning
I think you are getting mixed up here. If you applied LMR at nullmove, then it wouldn't be LMR, because LMR (Late Move Reductions) is only LMR when the moves are later down the movelist. Reducing in the parent node does not satisfy this criteria.
for they both are applied when not in PV.
Top engines apply LMR in PV nodes, but they tend to reduce less, and more cautiously.
And if you use LMR in null move pruning what should be the value of R.
Since you can't use LMR in nullmove, just keep R as-is.
And what to do about moves at the end that are reduced all the time and may become reduced too much.
Henk, at that point, "too much" is non-existant. If we order by SEE and this move is a move which hangs a queen, is it really that important that it be searched?

Matthew:out
Some believe in the almighty dollar.

I believe in the almighty printf statement.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Large search depths

Post by Henk »

ZirconiumXI wrote: think you are getting mixed up here. If you applied LMR at nullmove, then it wouldn't be LMR, because LMR (Late Move Reductions) is only LMR when the moves are later down the movelist. Reducing in the parent node does not satisfy this criteria.
I don't understand. With applying LMR in null move:

if ( !isPV )
{
// null move cut
pos.ChangePlayer();
MoveBase mv2;


int nullMoveValue = -Search(depth > 600 ? depth - 400: depth - 300, -ub, -(ub - 1), out mv2, null, false);
pos.ChangePlayer();

if (nullMoveValue >= ub)
{

mvFound = null;
return nullMoveValue;

}

}

I mean applying LMR in the -Search .. .

And I you do that the effective R gets increased by 1 (or 100), so it might get too big.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Large search depths

Post by Henk »

ZirconiumX wrote:.
And what to do about moves at the end that are reduced all the time and may become reduced too much.
Henk, at that point, "too much" is non-existant. If we order by SEE and this move is a move which hangs a queen, is it really that important that it be searched?

Matthew:out
What about if there is a mate thread and only one of the last moves in the list is able to prevent that. When applying LMR that move would be heavily reduced and overlooked.
ZirconiumX
Posts: 1334
Joined: Sun Jul 17, 2011 11:14 am

Re: Large search depths

Post by ZirconiumX »

Henk wrote:
ZirconiumXI wrote: think you are getting mixed up here. If you applied LMR at nullmove, then it wouldn't be LMR, because LMR (Late Move Reductions) is only LMR when the moves are later down the movelist. Reducing in the parent node does not satisfy this criteria.
I don't understand. With applying LMR in null move:

if ( !isPV )
{
// null move cut
pos.ChangePlayer();
MoveBase mv2;


int nullMoveValue = -Search(depth > 600 ? depth - 400: depth - 300, -ub, -(ub - 1), out mv2, null, false);
pos.ChangePlayer();

if (nullMoveValue >= ub)
{

mvFound = null;
return nullMoveValue;

}

}

I mean applying LMR in the -Search .. .

And I you do that the effective R gets increased by 1 (or 100), so it might get too big.
Well, in that case, the effective R is increased in the places where it needs to be.
What about if there is a mate thread and only one of the last moves in the list is able to prevent that. When applying LMR that move would be heavily reduced and overlooked.
This is the tradeoff made by being aggressive, but usually it doesn't matter, since being aggressive in the correct places makes search faster, and means that it will search deeper in the same amount of time. Eventually even with the reductions there will be enough depth to see the mate, which will trigger a research with no reductions, which will cause a beta cutoff, and pass the mate score to the root node.

Matthew:out
Some believe in the almighty dollar.

I believe in the almighty printf statement.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Large search depths

Post by bob »

Henk wrote:I don't understand how other chess programs can reach search depths > 15 Do they put R = 7 or so when null move pruning, or what kind of reductions do they use to reach these depths.

I use R= 2 or 3. If I use R > 3 my chess programs makes more blunders.

I also use:

If depth > 3
depth = depth - 3
else depth = depth - 2

to prevent null move pruning from going too early into quiescence search.
I still don't know if this is necessary, but it looks safer.
If you do checking moves in the first ply of q-search, you don't have to do that. If you do not, then preventing the NM search from dropping directly into the q-search is important.