I know there was a long thread on this a while back, but I cannot find it...
I simply would like to know what the _conventional_ way is to count nodes searched. I know this isn't really that important, but for the purposes of comparing apples to apples, I would like to count nodes searched conventionally.
My engine counts calls to MakeMove() when called from AlphaBeta() and Quies(). It ignores calls to MakeNullMove()
As my engine uses a pseudo-legal move generator, the count is made even if the move is determined to be illegal (King was left/placed in check). Or is it conventional to only count legal nodes? It's trivial for me to change the count to legal nodes only...
definition of a node
Moderator: Ras
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: definition of a node
The simplest approach is to increment nodes_searched at the top of search, and at the top of quiesce, or whatever you call your functions. That is accurate enough unless you find yourself making/unmaking moves inside the search for other reasons...AndrewShort wrote:I know there was a long thread on this a while back, but I cannot find it...
I simply would like to know what the _conventional_ way is to count nodes searched. I know this isn't really that important, but for the purposes of comparing apples to apples, I would like to count nodes searched conventionally.
My engine counts calls to MakeMove() when called from AlphaBeta() and Quies(). It ignores calls to MakeNullMove()
As my engine uses a pseudo-legal move generator, the count is made even if the move is determined to be illegal (King was left/placed in check). Or is it conventional to only count legal nodes? It's trivial for me to change the count to legal nodes only...
-
- Posts: 1154
- Joined: Fri Jun 23, 2006 5:18 am
Re: definition of a node
I do what Bob said. Initially I only did it at the top of search, and wondered why I was so much slower than all others. Once I added Quiesc() I spend up significantlybob wrote:The simplest approach is to increment nodes_searched at the top of search, and at the top of quiesce, or whatever you call your functions. That is accurate enough unless you find yourself making/unmaking moves inside the search for other reasons...AndrewShort wrote:I know there was a long thread on this a while back, but I cannot find it...
I simply would like to know what the _conventional_ way is to count nodes searched. I know this isn't really that important, but for the purposes of comparing apples to apples, I would like to count nodes searched conventionally.
My engine counts calls to MakeMove() when called from AlphaBeta() and Quies(). It ignores calls to MakeNullMove()
As my engine uses a pseudo-legal move generator, the count is made even if the move is determined to be illegal (King was left/placed in check). Or is it conventional to only count legal nodes? It's trivial for me to change the count to legal nodes only...

-Sam
Re: definition of a node
Really? The very top of AlphaBeta() and Quies() - that means counting the node whether it will be a hash it or not, and whether or not it's a horizon node. TSCP counts nodes only if depth is not 0....bob wrote:The simplest approach is to increment nodes_searched at the top of search, and at the top of quiesce, or whatever you call your functions. That is accurate enough unless you find yourself making/unmaking moves inside the search for other reasons...AndrewShort wrote:I know there was a long thread on this a while back, but I cannot find it...
I simply would like to know what the _conventional_ way is to count nodes searched. I know this isn't really that important, but for the purposes of comparing apples to apples, I would like to count nodes searched conventionally.
My engine counts calls to MakeMove() when called from AlphaBeta() and Quies(). It ignores calls to MakeNullMove()
As my engine uses a pseudo-legal move generator, the count is made even if the move is determined to be illegal (King was left/placed in check). Or is it conventional to only count legal nodes? It's trivial for me to change the count to legal nodes only...
-
- Posts: 670
- Joined: Mon Dec 03, 2007 3:01 pm
- Location: Barcelona, Spain
Re: definition of a node
if you count before the if (depth == 0)
you would count leaf nodes twice. Once in AlphaBeta and the second time in QS
you would count leaf nodes twice. Once in AlphaBeta and the second time in QS
Re: definition of a node
that's right, which is why I find it hard to believe people count nodes at the very top of search. It means double counting....Codeman wrote:if you count before the if (depth == 0)
you would count leaf nodes twice. Once in AlphaBeta and the second time in QS
-
- Posts: 1922
- Joined: Thu Mar 09, 2006 12:51 am
- Location: Earth
Re: definition of a node
Not all people call search in the same way.AndrewShort wrote:that's right, which is why I find it hard to believe people count nodes at the very top of search. It means double counting....Codeman wrote:if you count before the if (depth == 0)
you would count leaf nodes twice. Once in AlphaBeta and the second time in QS

I, and Bob too IIRC, use:
Code: Select all
for(all moves)
{
make()
if (depth <= 0)
qsearch();
else
search();
unmake();
}
-
- Posts: 1154
- Joined: Fri Jun 23, 2006 5:18 am
Re: definition of a node
You better believe it buddy. I double countAndrewShort wrote:that's right, which is why I find it hard to believe people count nodes at the very top of search. It means double counting....Codeman wrote:if you count before the if (depth == 0)
you would count leaf nodes twice. Once in AlphaBeta and the second time in QS

-Sam
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: definition of a node
Think about it this way. At the previous ply you generated moves. Then you picked one, made it, and then you call search/quiesce recursively. That is the _definition_ of a new node. A node is a position. An arc from a node is equivalent to a move. Each time you make a move, you are producing a new position/node, and incurring the overhead needed to update your data structures.AndrewShort wrote:Really? The very top of AlphaBeta() and Quies() - that means counting the node whether it will be a hash it or not, and whether or not it's a horizon node. TSCP counts nodes only if depth is not 0....bob wrote:The simplest approach is to increment nodes_searched at the top of search, and at the top of quiesce, or whatever you call your functions. That is accurate enough unless you find yourself making/unmaking moves inside the search for other reasons...AndrewShort wrote:I know there was a long thread on this a while back, but I cannot find it...
I simply would like to know what the _conventional_ way is to count nodes searched. I know this isn't really that important, but for the purposes of comparing apples to apples, I would like to count nodes searched conventionally.
My engine counts calls to MakeMove() when called from AlphaBeta() and Quies(). It ignores calls to MakeNullMove()
As my engine uses a pseudo-legal move generator, the count is made even if the move is determined to be illegal (King was left/placed in check). Or is it conventional to only count legal nodes? It's trivial for me to change the count to legal nodes only...
If TSCP is counting nodes in that way, it is doing it wrong. A node is a node whether it is an interior node (remaining depth > 1), a frontier node (remaining depth == 1, the last place where you have any choice about playing captures or non-captures and can not stand pat) or a leaf node (remaining depth = 0 where you can search captures or stand pat.
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: definition of a node
How do you figure that? I count at the top of search, where I enter once for each move made at previous level in tree. I then call quiesce after making a move, which is a new position. So I don't see how you can possibly call that "double counting"...AndrewShort wrote:that's right, which is why I find it hard to believe people count nodes at the very top of search. It means double counting....Codeman wrote:if you count before the if (depth == 0)
you would count leaf nodes twice. Once in AlphaBeta and the second time in QS