True IID

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

MOBMAT
Posts: 385
Joined: Sat Feb 04, 2017 11:57 pm
Location: USA

True IID

Post by MOBMAT »

Harm,
Somewhere, I can't recall if it was on this forum or not, you had some posted some code that implemented what I had always thought was "true" Internal Iterative Deepening (IID). When I first heard about IID I understood the concept to be that inside a search node, the available moves are searched the same way they are from the root, iteratively (p1, p2, p3, etc) up to the maximum search depth for the node, kind of like a recursive Iterative search.

I've seen implementations of what is being called IID that just don't seem to do what IID was originally designed as. Most implementations are just simple lower depth searches to find a possible starting candidate for PV when one isn't available.

If that is the case, then what is being called IID should be called something else, IMHO.

Can you post your code or point to where it is? I would like to play with the idea but want to see an example of a correct implementation.
i7-6700K @ 4.00Ghz 32Gb, Win 10 Home, EGTBs on PCI SSD
Benchmark: Stockfish15.1 NNUE x64 bmi2 (nps): 1277K
Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: True IID

Post by Ras »

Rasmus Althoff
https://www.ct800.net
User avatar
flok
Posts: 481
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: True IID

Post by flok »

MOBMAT wrote: Thu Apr 23, 2020 7:04 pm Harm,
Somewhere, I can't recall if it was on this forum or not, you had some posted some code that implemented what I had always thought was "true" Internal Iterative Deepening (IID). When I first heard about IID I understood the concept to be that inside a search node, the available moves are searched the same way they are from the root, iteratively (p1, p2, p3, etc) up to the maximum search depth for the node, kind of like a recursive Iterative search.
With what purpose?
Why not just:
Most implementations are just simple lower depth searches to find a possible starting candidate for PV when one isn't available.
User avatar
flok
Posts: 481
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: True IID

Post by flok »

flok wrote: Thu Apr 23, 2020 8:03 pm
MOBMAT wrote: Thu Apr 23, 2020 7:04 pm Harm,
Somewhere, I can't recall if it was on this forum or not, you had some posted some code that implemented what I had always thought was "true" Internal Iterative Deepening (IID). When I first heard about IID I understood the concept to be that inside a search node, the available moves are searched the same way they are from the root, iteratively (p1, p2, p3, etc) up to the maximum search depth for the node, kind of like a recursive Iterative search.
With what purpose?
Why not just:
Most implementations are just simple lower depth searches to find a possible starting candidate for PV when one isn't available.
Never mind: the post by hgm explains it.
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: True IID

Post by hgm »

I think it is mainly an implementation question, whether the same thing is achieved iteratively or recursively. You can always rewrite an iterative process for(i=0; i<N; i++) F(i); by a recursive one void G(int n) { if(n) G(n-1); F(n); }. Could be a bit inefficient, though, if F(n) can be decomposed into { H(); F'(n); }, because then you could call H() before the loop, while it would be called in every instance of G(). You can think of F() as Search(), and H() as MoveGen().

Likewise the textbook description of LMR as score = -Search(d-lmr); if(score > alpha) score = -Search(d); should just be considered stupid pseudo-code; an efficient implementation would make sure the depth-independent part of Search() was never executed twice, by merging both calls to Search() into one, and let that one call do both the d-lmr and d search, the latter only when the former fails high.