Pruning in today's top engines

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

gordonr
Posts: 194
Joined: Thu Aug 06, 2009 8:04 pm
Location: UK

Pruning in today's top engines

Post by gordonr »

If a top engine analyses for many hours and fails to find a best move, it may be because it still hasn't yet looked deep enough - in which case more time, if feasible, may help. Or could it be that some effect of pruning or evaluation has prevented the move from ever being found?

For many hours of analysis, does it make more sense to use a combination of engines, if pruning/evaluation issues are indeed significant? Or will the redundancy of much repeated search suggest that using one top engine for the whole period be more effective in general?

I suspect there's no simple answer. But I'd appreciate any thoughts - thanks.
Ralph Stoesser
Posts: 408
Joined: Sat Mar 06, 2010 9:28 am

Re: Pruning in today's top engines

Post by Ralph Stoesser »

Pruning should be not a reason to not be able to find the best moves, because pruning is done only for last few moves of the search lines, so with a ever increasing search depth every move should be detectable as the best move, enough search time given. In practice we have no unlimited time and it is a good idea to use multiple engines when in doubt about a specific position. The top engines differ in their selective algorithms and depending on the specific position one engine may find the best move in a reasonable time frame whilst the other would need unreasonable much time to find that move.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Pruning in today's top engines

Post by Don »

gordonr wrote:If a top engine analyses for many hours and fails to find a best move, it may be because it still hasn't yet looked deep enough - in which case more time, if feasible, may help. Or could it be that some effect of pruning or evaluation has prevented the move from ever being found?

For many hours of analysis, does it make more sense to use a combination of engines, if pruning/evaluation issues are indeed significant? Or will the redundancy of much repeated search suggest that using one top engine for the whole period be more effective in general?

I suspect there's no simple answer. But I'd appreciate any thoughts - thanks.
Yes, pruning can prevent the program from finding the right move right away but it will never prevent a move from ever being found - it will just delay it.

In general NOT pruning will cause the right move to take much longer to find - but it's always a trade-off. If you overdo pruning you can get a very weak program and the same with not doing enough of it.
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Pruning in today's top engines

Post by bob »

Don wrote:
gordonr wrote:If a top engine analyses for many hours and fails to find a best move, it may be because it still hasn't yet looked deep enough - in which case more time, if feasible, may help. Or could it be that some effect of pruning or evaluation has prevented the move from ever being found?

For many hours of analysis, does it make more sense to use a combination of engines, if pruning/evaluation issues are indeed significant? Or will the redundancy of much repeated search suggest that using one top engine for the whole period be more effective in general?

I suspect there's no simple answer. But I'd appreciate any thoughts - thanks.
Yes, pruning can prevent the program from finding the right move right away but it will never prevent a move from ever being found - it will just delay it.

In general NOT pruning will cause the right move to take much longer to find - but it's always a trade-off. If you overdo pruning you can get a very weak program and the same with not doing enough of it.
I don't agree with that. It depends on what you mean by pruning. If you toss a move at ply=3 every time, you will never see the consequences and change your mind. If you mean just pruning near the leaves, then yes, as you go deeper, the pruning keeps getting pushed farther out in the tree.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Pruning in today's top engines

Post by Don »

bob wrote:
Don wrote:
gordonr wrote:If a top engine analyses for many hours and fails to find a best move, it may be because it still hasn't yet looked deep enough - in which case more time, if feasible, may help. Or could it be that some effect of pruning or evaluation has prevented the move from ever being found?

For many hours of analysis, does it make more sense to use a combination of engines, if pruning/evaluation issues are indeed significant? Or will the redundancy of much repeated search suggest that using one top engine for the whole period be more effective in general?

I suspect there's no simple answer. But I'd appreciate any thoughts - thanks.
Yes, pruning can prevent the program from finding the right move right away but it will never prevent a move from ever being found - it will just delay it.

In general NOT pruning will cause the right move to take much longer to find - but it's always a trade-off. If you overdo pruning you can get a very weak program and the same with not doing enough of it.
I don't agree with that. It depends on what you mean by pruning. If you toss a move at ply=3 every time, you will never see the consequences and change your mind. If you mean just pruning near the leaves, then yes, as you go deeper, the pruning keeps getting pushed farther out in the tree.
Bob,

I assumed he was talking about the scalable pruning we all do. We do forward pruning but only on the last N ply of the search for example. I don't know of any program that does the kind of pruning that would forever prevent you from seeing a move - but it wouldn't surprise me if someone is doing it.

Don
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.
Uri Blass
Posts: 10302
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Pruning in today's top engines

Post by Uri Blass »

Don wrote:
bob wrote:
Don wrote:
gordonr wrote:If a top engine analyses for many hours and fails to find a best move, it may be because it still hasn't yet looked deep enough - in which case more time, if feasible, may help. Or could it be that some effect of pruning or evaluation has prevented the move from ever being found?

For many hours of analysis, does it make more sense to use a combination of engines, if pruning/evaluation issues are indeed significant? Or will the redundancy of much repeated search suggest that using one top engine for the whole period be more effective in general?

I suspect there's no simple answer. But I'd appreciate any thoughts - thanks.
Yes, pruning can prevent the program from finding the right move right away but it will never prevent a move from ever being found - it will just delay it.

In general NOT pruning will cause the right move to take much longer to find - but it's always a trade-off. If you overdo pruning you can get a very weak program and the same with not doing enough of it.
I don't agree with that. It depends on what you mean by pruning. If you toss a move at ply=3 every time, you will never see the consequences and change your mind. If you mean just pruning near the leaves, then yes, as you go deeper, the pruning keeps getting pushed farther out in the tree.
Bob,

I assumed he was talking about the scalable pruning we all do. We do forward pruning but only on the last N ply of the search for example. I don't know of any program that does the kind of pruning that would forever prevent you from seeing a move - but it wouldn't surprise me if someone is doing it.

Don
There are some programs that prune underpromotions forever
and I guess that pruning bishop underpromotions forever can even improve the elo of the program by 1 elo.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Pruning in today's top engines

Post by Don »

Uri Blass wrote:
Don wrote:
bob wrote:
Don wrote:
gordonr wrote:If a top engine analyses for many hours and fails to find a best move, it may be because it still hasn't yet looked deep enough - in which case more time, if feasible, may help. Or could it be that some effect of pruning or evaluation has prevented the move from ever being found?

For many hours of analysis, does it make more sense to use a combination of engines, if pruning/evaluation issues are indeed significant? Or will the redundancy of much repeated search suggest that using one top engine for the whole period be more effective in general?

I suspect there's no simple answer. But I'd appreciate any thoughts - thanks.
Yes, pruning can prevent the program from finding the right move right away but it will never prevent a move from ever being found - it will just delay it.

In general NOT pruning will cause the right move to take much longer to find - but it's always a trade-off. If you overdo pruning you can get a very weak program and the same with not doing enough of it.
I don't agree with that. It depends on what you mean by pruning. If you toss a move at ply=3 every time, you will never see the consequences and change your mind. If you mean just pruning near the leaves, then yes, as you go deeper, the pruning keeps getting pushed farther out in the tree.
Bob,

I assumed he was talking about the scalable pruning we all do. We do forward pruning but only on the last N ply of the search for example. I don't know of any program that does the kind of pruning that would forever prevent you from seeing a move - but it wouldn't surprise me if someone is doing it.

Don
There are some programs that prune underpromotions forever
and I guess that pruning bishop underpromotions forever can even improve the elo of the program by 1 elo.
Komodo does that - but I intend to handle that before the next release. I think I handle all promotions but only at the rook, and knight promotions up to some depth. It's not clear to me if it's worth enough to talk about - but it could matter a lot in positions with passed pawns all over the place - and that's really the only reason I do it - to prevent this potential explosion. But it's probably more superstition on my part than anything else.
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.
jdart
Posts: 4367
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Pruning in today's top engines

Post by jdart »

Yes, pruning can prevent the program from finding the right move right away but it will never prevent a move from ever being found - it will just delay it.
This is not true in endgames, where null move can cause permanent "blindness" in some cases.

--Jon
mar
Posts: 2559
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Pruning in today's top engines

Post by mar »

The only dangerous pruning IMHO is null move pruning. NM verification helps a bit in some positions but is not a remedy
The only remedy is to either not do nullmove at all or use NMR instead.
Both will of course hurt your program in terms of elo (the former a lot).
It may be beneficial however to try one of these in analysis mode where you don't want to miss/delay anything (where those delays can be many plies).
Each time I encountered a position that my program failed to solve within reasonable time (providing it was within its tactical capabilities), disabling nullmove always helped.
gordonr
Posts: 194
Joined: Thu Aug 06, 2009 8:04 pm
Location: UK

Re: Pruning in today's top engines

Post by gordonr »

Thanks everyone for your replies; this has helped. My understanding of pruning is limited and my initial question wasn't based on one specific example. It was a general curiousity.

But I'll now present one specific example from a common test case.

[D]4R3/P7/2bB2p1/r3pk2/2p2p1P/2P2P1K/6P1/8 w - - 0 54

Here, a latest Stockfish build after 10 hours at depth 53/89 proposes Re7 with an evaluation of 3.37. If I then show it Rxe5, it takes only 2 seconds and depth 31/49 to see that Rxe5 is much better. I'm guessing this endgame position is showing an effect of null pruning?!

But I did want to keep my question general since I've also seen middlegame positions where some top engines took over 10 hours to solve but yet other engines solved much quicker.

I've automated a "deep analysis" type process where 3 engines analyse a root position for, e.g., 1 hour each. Then, if the root moves differ, the engines very slowly play out their proposal against any other engine that disagreed. I watch the evaluation trends to see if any root move is significantly gaining or losing credibility. Of course, this is time consuming and often inconclusion - just an experiment to let me play around with various engines.

Watching this lead me to wonder how much they could compensate each other for any "over pruning" or evaluation weaknesses as opposed to increasing the analysis time per engine. Maybe my views are being skewed by experimenting with too many "test case" positions rather than typical play.