I’ve noticed in some engines, nodes are counted at the top of the alphabeta search, and also at the top of the quiescence search. Of course this means that when depth <= 0, a node is counted “twice,” once at the top of the alphabeta search, and then when the search detects depth <= 0, also at the top of the quiescence search.
Now, I can see both sides and don’t have a strong preference. Not “double counting” makes sense because you’re not actually doing any work in the main search when depth <= 0, but OTOH, you’re still visiting the node at least once in the main search, whether you actually do any work in it or not.
As I said, I have no strong preference, but which do other engine authors prefer?
Counting nodes
Moderator: Ras
-
lithander
- Posts: 915
- Joined: Sun Dec 27, 2020 2:40 am
- Location: Bremen, Germany
- Full name: Thomas Jahn
Re: Counting nodes
Double counting seems wrong to me. I also don't count a node when I found a TT hit for it.
The cheapest way to increase the node-counter in Leorik is when we can return from evaluating a node early in quiescence search due to standing pat. (Return beta if side to move is not in check and the static evaluation is already above beta)
...also this is in the wrong Sub-forum, right?
The cheapest way to increase the node-counter in Leorik is when we can return from evaluating a node early in quiescence search due to standing pat. (Return beta if side to move is not in check and the static evaluation is already above beta)
...also this is in the wrong Sub-forum, right?
-
algerbrex
- Posts: 608
- Joined: Sun May 30, 2021 5:03 am
- Location: United States
- Full name: Christian Dean
-
RubiChess
- Posts: 647
- Joined: Fri Mar 30, 2018 7:20 am
- Full name: Andreas Matthies
Re: Counting nodes
At some point I switched from increment nodes in search but not in qsearch to increment nodes when a move is played.
-
algerbrex
- Posts: 608
- Joined: Sun May 30, 2021 5:03 am
- Location: United States
- Full name: Christian Dean
Re: Counting nodes
That's also fair, I've seen that approach used as well, and it makes sense to me. You create a new node and visit a new position when a move is made - assuming the move has been confirmed to legal and isn't pruned away.
-
abulmo2
- Posts: 481
- Joined: Fri Dec 16, 2016 11:04 am
- Location: France
- Full name: Richard Delorme
Re: Counting nodes
In alphabeta derivates where a re-search is done again like PVS/negascout you may miss some nodes that way.
Richard Delorme
-
Mike Sherwin
- Posts: 965
- Joined: Fri Aug 21, 2020 1:25 am
- Location: Planet Earth, Sol system
- Full name: Michael J Sherwin
Re: Counting nodes
To be pristine only nodes visited in the actual upper most level of the alpha/beta search should be counted. For example if at every Search() I.D. is used as in 1 to depth - 1 to order the moves for the final depth none of the 1 to depth - 1 nodes should be counted. They are not part of the upper most level tree. Same for I.D. of depth - 2 if no hash move was found. In RomiChess I use a shallow search to order the moves and those nodes are counted but they should not have been. The question should be how many "official" nodes were visited in the search to reach the depth that was reached. IMNSHO.