An alternative to IID

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: An alternative to IID

Post by hgm »

Good chance that this would makes them weaker. This looks a lot like "Unmotivated Reduction of Everything" (UROE), because hash moves can be lost by any number of reasons. If this is also done in all-nodes, virtually all all-nodes would be reduced, as these typically do not have a hash move in a stable search.

Reducing everything but the PV isn't necessarily bad. Even reducing everything including the PV would not be detrimental, it just means you lie more about your depth. If reducing everything but the PV gives an improvement, it means your normal reduction scheme wasn't tuned well. Under those conditions random extra reductions outside the PV can also give an improvement.
User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: An alternative to IID

Post by Rebel »

hgm wrote: Fri Aug 14, 2020 2:37 pm Good chance that this would makes them weaker. This looks a lot like "Unmotivated Reduction of Everything" (UROE), because hash moves can be lost by any number of reasons. If this is also done in all-nodes, virtually all all-nodes would be reduced, as these typically do not have a hash move in a stable search.

Reducing everything but the PV isn't necessarily bad. Even reducing everything including the PV would not be detrimental, it just means you lie more about your depth. If reducing everything but the PV gives an improvement, it means your normal reduction scheme wasn't tuned well. Under those conditions random extra reductions outside the PV can also give an improvement.
What if I tell you that at longer time control (CCRL Blitz) it gives even more elo, currently +35.

And it's not "Unmotivated", it's a another (but different) way (like IID) to handle large unsorted subtrees.
90% of coding is debugging, the other 10% is writing bugs.
User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: An alternative to IID

Post by Rebel »

silentshark wrote: Fri Aug 14, 2020 9:31 am
Rebel wrote: Fri Aug 14, 2020 9:17 am Internal Iterative Deepening (IID) becomes :

Internal Iterative Reductions (IIR)

or TTR

:D
Nice! IIR, I like it.

I wonder what it would do in one of the super strong, 3000 ELO+ engines?
That I worry too, see the OP.

For the moment I notice a considerable lower branch factor which automatically leads to 1 or 2 more iterations and formerly reduced nodes due to the lack of a hash move become alive because now that there is a hash move. The worry is that IIR may become counter productive when the TT is saturated, so depending on the size of the TT (or the % filled) there has to be a depth limit.
90% of coding is debugging, the other 10% is writing bugs.
RubiChess
Posts: 584
Joined: Fri Mar 30, 2018 7:20 am
Full name: Andreas Matthies

Re: An alternative to IID

Post by RubiChess »

I can confirm that replacing IID with this idea gives +12 Elo in my engine.
Credits will go to Ed in the merge and the ChangeLog :-)
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: An alternative to IID

Post by hgm »

Rebel wrote: Fri Aug 14, 2020 5:46 pmAnd it's not "Unmotivated", it's a another (but different) way (like IID) to handle large unsorted subtrees.
IID is motivated by the desire to reduce the search time of a deep tree by first obtaining some info to sort on in a comparatively cheap way. But eventually you would still search the intended tree, it doesn't change what you search in any way.

That a tree is unsorted, or merely had its hash move overwritten, doesn't seem to be a valid motivation for reducing its search depth. Unless you would consider it a valid motivation to do reductions based on the day of the week, or when the TickCount is odd...

Considering the positive test results I am sure absence of a hash move must strongly correlate with some more fundamental property of the node. Like I said, perhaps this means you are doing it in every all-node. But in that case it should even work better if you just did it in every all-node, and nowhere else, irrespective of whether there was a hash move or not.
RubiChess
Posts: 584
Joined: Fri Mar 30, 2018 7:20 am
Full name: Andreas Matthies

Re: An alternative to IID

Post by RubiChess »

RubiChess wrote: Fri Aug 14, 2020 7:00 pm I can confirm that replacing IID with this idea gives +12 Elo in my engine.
Credits will go to Ed in the merge and the ChangeLog :-)
Oh shit. Seems that I mixed two patches and now I need to find out which one is the Elo gainer...
Stay tuned.
RubiChess
Posts: 584
Joined: Fri Mar 30, 2018 7:20 am
Full name: Andreas Matthies

Re: An alternative to IID

Post by RubiChess »

RubiChess wrote: Fri Aug 14, 2020 7:31 pm
RubiChess wrote: Fri Aug 14, 2020 7:00 pm I can confirm that replacing IID with this idea gives +12 Elo in my engine.
Credits will go to Ed in the merge and the ChangeLog :-)
Oh shit. Seems that I mixed two patches and now I need to find out which one is the Elo gainer...
Stay tuned.
Sorry. Seems it was the other patch that won the Elo. Replacing IID with the "decrease depth" idea is < 1 Elo.
User avatar
silentshark
Posts: 327
Joined: Sat Mar 27, 2010 7:15 pm

Re: An alternative to IID

Post by silentshark »

silentshark wrote: Fri Aug 14, 2020 8:43 am
silentshark wrote: Thu Aug 13, 2020 9:38 pm
silentshark wrote: Thu Aug 13, 2020 6:05 pm
Rebel wrote: Thu Aug 13, 2020 8:46 am Took IID out (of my oldie) and replaced it with a full ply reduction without research and it gave me +17 elo after 5000 games.

Not sure if that works for modern searchers.
Interesting idea. I will give this a go, as I've never been happy with my IID implementation anyway. Will post back results after a few thousand games.
+13 ELO after 2.5K games for me.. looking interesting
+14 ELO after 7.5K games for me now..

This does spark other ideas. I might try the following - tweaking LMR reduction, e.g reduce more if there is not a hash move

Anyhow, Ed's idea seems to have promise on its own. Overall depth increases quite a lot (like 1 or 2 plies), and strength increases slightly.
Seems to be holding at about +14 ELO after 14K games for me. These games are 60 moves in 1 minute, vs earlier version of my engine, and vs some other sparring partners.
User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: An alternative to IID

Post by Rebel »

RubiChess wrote: Fri Aug 14, 2020 10:10 pm
RubiChess wrote: Fri Aug 14, 2020 7:31 pm
RubiChess wrote: Fri Aug 14, 2020 7:00 pm I can confirm that replacing IID with this idea gives +12 Elo in my engine.
Credits will go to Ed in the merge and the ChangeLog :-)
Oh shit. Seems that I mixed two patches and now I need to find out which one is the Elo gainer...
Stay tuned.
Sorry. Seems it was the other patch that won the Elo. Replacing IID with the "decrease depth" idea is < 1 Elo.
I am not surprised, engines like yours already search at incredible depths.

In the old days IID was a winner, I looked at SF and it says about IID ~1 elo.
90% of coding is debugging, the other 10% is writing bugs.
Terje
Posts: 347
Joined: Tue Nov 19, 2019 4:34 am
Location: https://github.com/TerjeKir/weiss
Full name: Terje Kirstihagen

Re: An alternative to IID

Post by Terje »

Replacing IID with this gains 3-8 elo in Weiss, lower with higher TC / threadcount.