What's the trick ?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: What's the trick ?

Post by JVMerlino »

Indeed. Can you give us a position in which your engine is reaching depth 20 in 100 seconds?
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: What's the trick ?

Post by bob »

cdani wrote:
bob wrote: Heavy duty reductions.

Large R in null-move searches

Heavy duty forward pruning.
I have the idea that when you start pruning you lose strength. But if you continue pruning heavier, it arrives a moment when you start to win strength. Is like you cross some line.
Of course it's not that easy because the engine needs some equilibrium.
I believe there is (a) too little, (b) too much, and (c) quite a few choices for "just right".
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: What's the trick ?

Post by cdani »

bob wrote:I believe there is (a) too little, (b) too much, and (c) quite a few choices for "just right".
Sorry, I don't understand.

The idea I want to explain, more elaborated, is that you must win enough depth with the reductions / large R / forward pruning to win more strength that the one you lose because you see less moves wider.
Henk
Posts: 7220
Joined: Mon May 27, 2013 10:31 am

Re: What's the trick ?

Post by Henk »

JVMerlino wrote:Indeed. Can you give us a position in which your engine is reaching depth 20 in 100 seconds?
For instance the start position in Chess. But depth does not mean search path length. So even the PV does not get length 20 for I do null move reductions at PV nodes too.
Stan Arts
Posts: 179
Joined: Fri Feb 14, 2014 10:53 pm
Location: the Netherlands

Re: What's the trick ?

Post by Stan Arts »

Henk wrote: For instance the start position in Chess. But depth does not mean search path length. So even the PV does not get length 20 for I do null move reductions at PV nodes too.


Nullmove generally doesn't impact PV length as a node who's nullmove scored equal or greater to beta is not an exact/PV node and should not end up in the PV.

I too experience that you need to cross a certain threshold of inherent depth before agressive reductions and pruning starts to work. Easy to explain by that if you just have one simple form of reductions and/or pruning here and there the gain is often not enough to outweigh the gaps that you just created. For example a very basic form of LMR in many open tactical positions might barely get you two ply but you struck holes in your search many more plies than that. But once you combine it with other tricks, lots of speed and decent long searches, suddenly your searchdepth might be so great that you even pick up enough stuff from gaps even at half depth or worse and it might not hurt as much.
Anyway in my previous engine I could never get anywhere near that point. Way too slow (nps wise) and too many extentions and Q search tricks to get enough depth and any reductions I tried just made it blind.
Lately I am doing a new engine though that is inherently way faster (nps) and now from day one I have scaling in mind rather than tactical tricks. Extentions and reductions have huge potential so for comming years it will be a nice hobby to once in a while fiddle up some sort of sophisticated reduction system. Shannon type B all over again without the hard cuts.
Henk
Posts: 7220
Joined: Mon May 27, 2013 10:31 am

Re: What's the trick ?

Post by Henk »

Stan Arts wrote:
Henk wrote: For instance the start position in Chess. But depth does not mean search path length. So even the PV does not get length 20 for I do null move reductions at PV nodes too.


Nullmove generally doesn't impact PV length as a node who's nullmove scored equal or greater to beta is not an exact/PV node and should not end up in the PV.

I too experience that you need to cross a certain threshold of inherent depth before agressive reductions and pruning starts to work. Easy to explain by that if you just have one simple form of reductions and/or pruning here and there the gain is often not enough to outweigh the gaps that you just created. For example a very basic form of LMR in many open tactical positions might barely get you two ply but you struck holes in your search many more plies than that. But once you combine it with other tricks, lots of speed and decent long searches, suddenly your searchdepth might be so great that you even pick up enough stuff from gaps even at half depth or worse and it might not hurt as much.
Anyway in my previous engine I could never get anywhere near that point. Way too slow (nps wise) and too many extentions and Q search tricks to get enough depth and any reductions I tried just made it blind.
Lately I am doing a new engine though that is inherently way faster (nps) and now from day one I have scaling in mind rather than tactical tricks. Extentions and reductions have huge potential so for comming years it will be a nice hobby to once in a while fiddle up some sort of sophisticated reduction system. Shannon type B all over again without the hard cuts.
If it is true that you need to cross a certain threshold of inherent depth before aggressive reductions and pruning starts to work then you get a testing problem. For you can only test it using large time controls, which means it costs many days or weeks of computing time. I cannot afford that.
And if it is no improvement it's a total waste of time and money (electricity) and inconvenience for your computer is busy all the time.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: What's the trick ?

Post by lucasart »

Uri Blass wrote:I cannot get depth 20 with the top programs in the following pawn endgame in 100 seconds

[D]4K3/PPPPPPPP/8/8/8/8/pppppppp/4k3 w - - 1 1
In fact, if you don't take special measures to arbitrarly cut the quiescent from foraying into infinite branches, you would not even be able to complete depth 0 (qsearch). This is a perfect qsearch explosion position.

DiscoCheck reached depth=15 in 115 seconds, which, considering the nature of the position, is pretty good! The QS is blocked at depth -8, where Eval+SEE is used instead (on top of usual QS pruning technique, most notably SEE pruning).

Such positions have absolutely no incidend in practice, so one should never tune an engine on positions like that. But they are interesting to expose the edge case.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: What's the trick ?

Post by cdani »

Henk wrote:If it is true that you need to cross a certain threshold of inherent depth before aggressive reductions and pruning starts to work then you get a testing problem. For you can only test it using large time controls, which means it costs many days or weeks of computing time. I cannot afford that.
And if it is no improvement it's a total waste of time and money (electricity) and inconvenience for your computer is busy all the time.

I think is not that terrible. I tried some aggressive LMR approaches, of course seeing other modules open source ideas and my own ones, and I was able to reach some working ideas without much work. Then I improved and changed it many times.
Sure some ours of testing are necessary, but if you can afford some hundred games, you will see at least if is more or less working. It's not necessary days of testing. With less you see it.
Henk
Posts: 7220
Joined: Mon May 27, 2013 10:31 am

Re: What's the trick ?

Post by Henk »

cdani wrote:
Henk wrote:If it is true that you need to cross a certain threshold of inherent depth before aggressive reductions and pruning starts to work then you get a testing problem. For you can only test it using large time controls, which means it costs many days or weeks of computing time. I cannot afford that.
And if it is no improvement it's a total waste of time and money (electricity) and inconvenience for your computer is busy all the time.

I think is not that terrible. I tried some aggressive LMR approaches, of course seeing other modules open source ideas and my own ones, and I was able to reach some working ideas without much work. Then I improved and changed it many times.
Sure some ours of testing are necessary, but if you can afford some hundred games, you will see at least if is more or less working. It's not necessary days of testing. With less you see it.
I mean you cannot invent something new which you can only test with large time controls when there are too many combinations. Best is to use (steal?) ideas of others.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: What's the trick ?

Post by bob »

cdani wrote:
bob wrote:I believe there is (a) too little, (b) too much, and (c) quite a few choices for "just right".
Sorry, I don't understand.

The idea I want to explain, more elaborated, is that you must win enough depth with the reductions / large R / forward pruning to win more strength that the one you lose because you see less moves wider.
That was my point. You go too conservatively, you don't prune/reduce enough, and you waste time on garbage moves that reduce overall depth and Elo. You go to aggressively and you prune/reduce important things, which allows you to overlook tactics and although you are searching deeper, you are missing more of the important features. In the middle there is significant latitude. One setting lets you get to depth=30, another lets you get to depth=32, but when you match the two programs, they are equal in strength, because the depth=30 program doesn't prune some key things that the depth=32 program does prune, and it takes advantage of those. But, at the same time, on occasion the depth=32 program sees 2 plies deeper, which will expose something to it that the depth=30 program doesn't see. In the middle there is a fairly broad range of reductions, extensions and pruning ideas that can be used, and although the new idea(s) might reduce or increase average search depth, they don't influence playing skill significantly.