What is the reasonable NPS?

Code, algorithms, languages, construction...
Post Reply
macsmol
Posts: 1
Joined: Sun Feb 14, 2021 7:37 pm
Real Name: Maciek

What is the reasonable NPS?

Post by macsmol » Sun Feb 14, 2021 10:58 pm

Hi everyone!
It's my first post here. For some time now I've been writing my own UCI engine https://github.com/macsmol/machess.
I keep seeing other engines and and grow suspicion that my engine is way more slow that it should be.
Typically in logs I see it reporting around 220k-390k nodes per second evaluated (these are strictly legal nodes). Here are some logs when searching from the starting position. As you can see the iterative deepening for depths 1-6 takes almost 7 seconds.

Code: Select all

info nodes 20 time 0 depth 1 nps 65402 // low depth searches give low nps but don't take much time so can be ignored generally
info nodes 120 time 1 depth 2 nps 94243
info nodes 1455 time 5 depth 3 nps 283288
info nodes 10253 time 43 depth 4 nps 235876
info nodes 203318 time 519 depth 5 nps 391675
info nodes 1388128 time 6073 depth 6 nps 228552
bestmove e2e3
I've compared my engine to Roce0.0390 and while it seems to be reporting wrong numbers (time = 0 always) the best move for depth 6 is displayed on the screen pretty much instantly.
So here comes my question. How fast should I expect it to run?
I'm using 0x88 board and piece lists. I didn't implement any transposition table yet (Does Roce have transposition table?). My evaluation function is reeally basic (mobility + material). Everything runs in one thread. I've programmed it in Java and run it on Intel i7-4790 @3.60GHz (and the results that you see are after several warm-up runs so that the JVM could run the optimizations).

I've also noticed that after I added quiescence search the NPS got lower. Before I was typically hitting around 300k-500k. Not sure why it's slower. Both versions were counting a call to static evaluation as a node - quiescence search just evaluates more nodes - it shouldn't change the rate at which it does.

Thanks for any input on this topic!

BrianR
Posts: 17
Joined: Thu Jun 10, 2010 4:48 am

Re: What is the reasonable NPS?

Post by BrianR » Tue Feb 16, 2021 2:51 am

Your Java engine's speed seems pretty reasonable to me on one CPU.

There are various ways engines count nodes and report nps, and many ways to report depth also.
In the end, nps and depth are really only meaningful to you once you develop a sense of how your engine performs.

One way is to simply increment the node counter each time search and q-search is called.
You can count evaluations instead, but once you implement transposition tables many nodes will be processed without needing to be re-evaluated.

A C or C++ alpha/beta type engine would typically be between 1 and 2 million "typical" nps.
A typical neural net engine would be about a thousand times slower.
The very best of each type are competitive with each other.
Clearly, chess programs are a trade-off between knowledge and speed.
Experiment.

Actually, there are many Java engines. See:
http://talkchess.com/forum3/viewtopic.p ... hilit=java

The talkchess.com site is generally very active.
And, in case you are not aware of it, this is a treasure for chess programming:
https://www.chessprogramming.org/Main_Page

Post Reply