About move ordering and TT hitrate

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Gioviok
Posts: 5
Joined: Tue Aug 17, 2021 1:08 pm
Full name: Giovanni Maria Manduca

About move ordering and TT hitrate

Post by Gioviok »

Hello!
This is my first question on the forum, so I hope not to break any rule.
For the past 3 months, I have been binge-developing a chess engine in c++, following some tutorials and reading a lot from chessprogramming.org as well as from http://www.frayn.net/beowulf/ and this forum. Now I have implemented lot of stuff starting from the most basic stuff (pvs with alpha beta + null move + LMR + TT , move ordering with history/counter/killer moves heuristic, MVVLVA, IID and move from tt).
Now I've got to say that I am proud of the engine, but at the same time I felt like something was kinda "off" about the way the engine performed.
So I decided to write some code to profile two of the most vital parts of the engine: move ordering and transposition table.
As for the move ordering, what I did was:
  • I have a variable nodesWithMoves = 0, that gets increased each time a node with one or move legal moves is encountered in the search (it ignores the nodes that are cut with NMP, as the move generation only occours after NMP).
  • I have an array moveCorrectAt[128], that keeps track of the position of the best/cut move for each node analyzed, for example if the best move was the fifth to be generated, then moveCorrectAt[4] would be increased.
  • Finally, I would print for each depth division moveCorrectAt/nodesWithMoves, for each i from 0 to 128 (excluded).


As for the TT, i am using a simple (and probably very unoptimized) structure:

Code: Select all

struct tt {
	U64 key = 0; //the complete key
	char depth = 0; //the complete depth
	char flags = 0; //can be either hashALPHA, hashBETA, hashEXACT
	int score = 0; //the score assigned to the position
	int move = 0; //the best/cut move in the position (move has 40 bit ordering score and 24 bit move, and we don't need to store the move score, so we cut away the score int the writeHashEntry and store it as an int)
	inline void wipe(); //resets all members to 0
};
The replacement strategy is the following:

Code: Select all

inline void writeHashEntry(U64 key, int score, int depth, moveInt move, int hashFlag) {
	//...
	if (depth < hash_entry->depth || (depth == hash_entry->depth && hashFlag != hashEXACT && hash_entry->flags == hashEXACT )) return; //don't replace
	//...
};
And to profile it, I simply measured in this way the tableAccesses:

Code: Select all

inline int readHashEntry(U64 key, int alpha, int beta, int depth) {
	tableAccesses++;
	//...
	if (hashEntry->key == key)	{
		tableHits++;
		//...
	}
	//...
}

And then I print the division tableHits/tableAccesses

Now the results:
As for the move ordering, i tested startpos up to depth 24, which yielded these results (only displaying first 10 moves each 8 depths):

Code: Select all

Move guessRate @depth 8:
1  -->  Perc: 0.0924519
2  -->  Perc: 48.5415
3  -->  Perc: 12.1404
4  -->  Perc: 5.70164
5  -->  Perc: 3.09044
6  -->  Perc: 1.51303
7  -->  Perc: 0.878873
8  -->  Perc: 0.636583
9  -->  Perc: 0.507398
10  -->  Perc: 0.501499

Move guessRate @depth 16:
1  -->  Perc: 0.0954534
2  -->  Perc: 48.8485
3  -->  Perc: 12.2974
4  -->  Perc: 5.76588
5  -->  Perc: 3.10437
6  -->  Perc: 1.51738
7  -->  Perc: 0.880836
8  -->  Perc: 0.636266
9  -->  Perc: 0.506761
10  -->  Perc: 0.49833

Move guessRate @depth 24:
1  -->  Perc: 0.155728
2  -->  Perc: 62.7145
3  -->  Perc: 14.8752
4  -->  Perc: 6.29885
5  -->  Perc: 3.0888
6  -->  Perc: 1.44694
7  -->  Perc: 0.814006
8  -->  Perc: 0.575404
9  -->  Perc: 0.462268
10  -->  Perc: 0.420881
Now don't worry too much about move number 1, because the moveList structure leaves the first move empty to fill it with the tt move or IID move when no pv move is available, and is left otherwise to 0 (value immediately skipped by the makeMove function)

I was kinda happy with the results, because there definitely is an ascending trend in the accuracy, but at the same time I don't know what a good move ordering percentage should be, so I was hoping that some of you who also tested this stuff could give me some expected numbers.

But then on to the hit rate, using an hashtable of 16777216 (0x1000000) ttEntries.
It was...

Code: Select all

@depth 8 hitrate 4.02875%
@depth 9 hitrate 3.6063%
@depth 10 hitrate 3.6706%
@depth 11 hitrate 3.26097%
@depth 12 hitrate 3.39939%
@depth 13 hitrate 3.77532%
@depth 14 hitrate 3.68911%
@depth 15 hitrate 4.0221%
@depth 16 hitrate 4.11454%
@depth 17 hitrate 4.05831%
@depth 18 hitrate 3.59045%
@depth 19 hitrate 3.64886%
@depth 20 hitrate 3.42975%
@depth 21 hitrate 3.26378%
@depth 22 hitrate 3.03537%
@depth 23 hitrate 3.01364%
@depth 24 hitrate 2.80875%
...horrible... I think?
What numbers should I expect?
Is using the startpos to test a problem?
Is my method of measuring wrong?
Is my replacment strategy wrong?
Am I gonna find true love?

These are the questions of life... :D

I thank in advance everyone that took the time to read this mess, and to answer to it, maybe!
JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: About move ordering and TT hitrate

Post by JVMerlino »

Congratulations on your work so far! Looking forward to your release.

Although I certainly wouldn't use my engine's stats as a target goal, I can say that your numbers do look a bit low.

From the initial position, Myrddin gets about 9.2% tt hits after a one-minute search (which is just after it reports the first PV at depth 18). Just as important to determine is the percentage of tt cutoffs, which for Myrddin is about 4.3% during the same search.

The classic position for testing your tt implementation is Fine 70:
[d]8/k7/3p4/p2P1p2/P2P1P2/8/8/K7 w - - 0 1

Your engine should reach at least depth 30, and choose Kb1 with a winning (at least +3) score, very quickly - like within a second or two. For this position, Myrddin gets about 54.6% tt hits and 37.4% tt cutoffs in a one-minute search.

jm
User avatar
emadsen
Posts: 434
Joined: Thu Apr 26, 2012 1:51 am
Location: Oak Park, IL, USA
Full name: Erik Madsen

Re: About move ordering and TT hitrate

Post by emadsen »

Gioviok wrote: Fri Oct 22, 2021 12:22 pm But then on to the hit rate, using an hashtable of 16777216 (0x1000000) ttEntries.
It was... horrible... I think?
What numbers should I expect?

I thank in advance everyone that took the time to read this mess, and to answer to it, maybe!
Your TT hit rate seems low. Searching the starting position for 10 seconds, MadChess has a 21% TT hit rate. It uses an always-replace TT strategy.

Code: Select all

info depth 16 seldepth 25 time 5235 nodes 12305123 score cp 15 nps 2350446 pv c2c4 g8f6 b1c3 c7c5 g1f3 b8c6 e2e4 d7d6 d2d3 e7e5 a2a4 f6g4 c3d5 c8e6 a1a3 a8c8
...
info depth 17 seldepth 28 time 9949 nodes 24000000 nps 2412301
info hashfull 130 currmove g1f3 currmovenumber 2
info string Cache Hit = 21.35% Score Cutoff = 29.38% Best Move Hit = 23.19% Invalid Best Moves = 0
info string Null Move Cutoffs = 76.13% Beta Cutoff Move Number = 1.50 Beta Cutoff First Move = 79.59%
info string Evals = 6,260,618
info string Stopping search at 10000 milliseconds.
bestmove c2c4
Searching the position John provided for 10 seconds, MadChess gets an 81% hit rate.

Code: Select all

info depth 44 seldepth 48 time 8566 nodes 32100288 score cp 1380 nps 3747279 pv a1b1 a7b7 b1c1 b7c7 c1d1 c7d7 d1c2 d7c7 c2d3 c7b7 d3e3 b7c7 e3f3 c7d7 f3g3 d7e8 g3h4 e8f7 h4g5 f7g7 g5f5 g7f7 f5g5 f7g7 f4f5 g7f7 f5f6 f7f8 g5f4 f8e8 f4g4 e8f8 g4g5 f8g8 g5g6 g8h8 g6f5 h8h7 f5e6 h7g8 e6d6 g8f7 d6e5 f7f8
...
info depth 45 seldepth 47 time 9820 nodes 37000000 nps 3767791
info hashfull 139 currmove a1b1 currmovenumber 1
info string Cache Hit = 81.50% Score Cutoff = 55.51% Best Move Hit = 67.01% Invalid Best Moves = 0
info string Null Move Cutoffs = 96.85% Beta Cutoff Move Number = 1.08 Beta Cutoff First Move = 97.19%
info string Evals = 8,092,159
info string Stopping search at 10001 milliseconds.
bestmove a1b1
My C# chess engine: https://www.madchess.net
JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: About move ordering and TT hitrate

Post by JVMerlino »

Now that I think about it, we're not really comparing apples to apples because nobody reported the tt size they were using. :oops: Myrddin by default uses 512 MB, and a hash entry is 16 bytes. So, not very efficient, but functional.
yeni_sekme
Posts: 39
Joined: Mon Mar 01, 2021 7:51 pm
Location: İstanbul, Turkey
Full name: Ömer Faruk Tutkun

Re: About move ordering and TT hitrate

Post by yeni_sekme »

My hash table is not good for comparison but your hit rate really seems low. I am using the same replacement scheme and similar hash table structure as you but I get more hit rate although I probe in qs. The problem could be due to collisions, have you measured with different hash sizes?
Gioviok
Posts: 5
Joined: Tue Aug 17, 2021 1:08 pm
Full name: Giovanni Maria Manduca

Re: About move ordering and TT hitrate

Post by Gioviok »

Oh well... got completely stomped by fine 70 :( .
Hitrate reached max of 8%, with depth 30 reached only after 24 minutes + wrong move (Kb2 found). Welp, back to the drawing board, it is time for a refactor, since I can't find any reason for this behaviour... Yay, I think :cry:

(Plus it seems now the engine has problems when searching on odd depth (???))
federico
Posts: 32
Joined: Sun Oct 22, 2017 4:36 am
Location: Canada
Full name: Federico Rojo

Re: About move ordering and TT hitrate

Post by federico »

JVMerlino wrote: Fri Oct 22, 2021 7:09 pm Congratulations on your work so far! Looking forward to your release.

Although I certainly wouldn't use my engine's stats as a target goal, I can say that your numbers do look a bit low.

From the initial position, Myrddin gets about 9.2% tt hits after a one-minute search (which is just after it reports the first PV at depth 18). Just as important to determine is the percentage of tt cutoffs, which for Myrddin is about 4.3% during the same search.

The classic position for testing your tt implementation is Fine 70:
[d]8/k7/3p4/p2P1p2/P2P1P2/8/8/K7 w - - 0 1

Your engine should reach at least depth 30, and choose Kb1 with a winning (at least +3) score, very quickly - like within a second or two. For this position, Myrddin gets about 54.6% tt hits and 37.4% tt cutoffs in a one-minute search.

jm

Interesting! Didn't know about Fine 70. I had never used this position to validate TT hit rates.

Ok, here are the stats for Ceibo latest dev:
  • From startpos for 10secs reaches d19 with 15% hit rate and 62% cutoffs.

Code: Select all

...
info depth 18 seldepth 31 score cp 39 time 7184 nodes 19539518 fnodes 4663003 qnodes 1775156 nps 2719847 hashfull 111 pv e2e4 c7c5 g1f3 b8c6 c2c3 e7e6 d2d4 c5d4 c3d4 d7d5 e4e5 g8e7 b1c3 e7f5 f1e2 d8b6 c3b5 b6d8
info depth 19 seldepth 31 score cp 39 time 10004 nodes 27070744 fnodes 5423104 qnodes 2108122 nps 2705770 hashfull 155 pv e2e4
bestmove e2e4
  • From Fine 70 for 10 secs reaches d49 with 62% hit rate and 81% cutoffs!

Code: Select all

...
info depth 47 seldepth 50 score cp 691 time 2132 nodes 10154894 fnodes 675179 qnodes 25215 nps 4762549 hashfull 50 pv a1b1 a7b7 b1c1 b7c7 c1d1 c7d7 d1c2 d7c7 c2d3 c7b7 d3e3 b7c7 e3f3 c7d8 f3g3 d8e7 g3h4 e7f6 h4h5 f6f7 h5g5 f7g7 g5f5 g7f7 f5g5 f7g7 f4f5 g7f7 f5f6 f7f8 g5g4 f8g8 g4f4 g8f8 f4g5 f8f7 g5f5 f7f8 f5e6 f8e8 e6d6 e8f7 d6e5 f7e8 d5d6
info depth 48 seldepth 53 score cp 624 time 5268 nodes 24984071 fnodes 13841951 qnodes 987226 nps 4741743 hashfull 115 pv a1b1 a7b7 b1c1 b7c7 c1d1 c7d7 d1c2 d7c7 c2d3 c7b7 d3e3 b7c7 e3f3 c7d8 f3g3 d8e7 g3h4 e7f6 h4h5 f6f7 h5g5 f7g7 g5f5 g7f7 f5g5 f7g7 f4f5 g7f7 f5f6 f7f8 g5g4 f8g8 g4f4 g8f8 f4g5 f8f7 g5f5 f7f8 f5e6 f8e8 e6d6 e8f8 d6e5 f8f7 d5d6 f7e8 d4d5
info depth 49 seldepth 54 score cp 624 time 10004 nodes 45481124 fnodes 18546688 qnodes 1950365 nps 4545860 hashfull 276 pv a1b1
bestmove a1b1
Note: Ceibo does not probe during Qsearch.
User avatar
flok
Posts: 481
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: About move ordering and TT hitrate

Post by flok »

Hmmm, caffeinatedpawn finds a1b1 at the first ply.

Code: Select all

position fen 8/k7/3p4/p2P1p2/P2P1P2/8/8/K7 w - - 0 1
go movetime 60000
# think time: 60000
info depth 1 score cp 168 hashfull 0 time 36 nodes 7 nps 111 pv a1b1
info depth 2 score cp 159 hashfull 0 time 40 nodes 25 nps 375 pv a1b1 a7a8
info depth 3 score cp 159 hashfull 0 time 47 nodes 120 nps 1510 pv a1b1 a7a8 b1a1
info depth 4 score cp 159 hashfull 0 time 53 nodes 215 nps 2490 pv a1b1 a7a8 b1c1 a8b8
info depth 5 score cp 159 hashfull 0 time 62 nodes 436 nps 4387 pv a1b1 a7a8 b1c1 a8b8 c1b1
info depth 6 score cp 150 hashfull 0 time 72 nodes 948 nps 8444 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8
info depth 7 score cp 159 hashfull 0 time 76 nodes 1230 nps 10552 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1e1
info depth 8 score cp 159 hashfull 0 time 80 nodes 1532 nps 12787 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1e1 a8b8
info depth 9 score cp 159 hashfull 0 time 87 nodes 2066 nps 16264 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1c2 a8b8 c2b1
info depth 10 score cp 159 hashfull 0 time 94 nodes 2512 nps 18946 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1c2 a8b8 c2c1 b8a8
info depth 11 score cp 159 hashfull 0 time 103 nodes 3453 nps 24932 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1c2 a8b8 c2c1 b8a8 c1b1
info depth 12 score cp 159 hashfull 0 time 109 nodes 4359 nps 30715 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1c2 a8b8 c2c1 b8a8 c1b1 a8b8
info depth 13 score cp 184 hashfull 0 time 138 nodes 11490 nps 64420 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1e1 a8b8 e1f1 b8a8 f1f2 a8b8 f2g1
info depth 14 score cp 184 hashfull 0 time 147 nodes 14162 nps 75292 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1e1 a8b8 e1f1 b8a8 f1f2 a8b8 f2g1 b8a8
info depth 15 score cp 184 hashfull 0 time 154 nodes 16152 nps 83512 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1e1 a8b8 e1f1 b8a8 f1f2 a8b8 f2g2 b8a8 g2g1
info depth 16 score cp 184 hashfull 0 time 167 nodes 18933 nps 91185 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1e1 a8b8 e1f1 b8a8 f1f2 a8b8 f2g2 b8a8 g2g1 a8b8
info depth 17 score cp 184 hashfull 0 time 184 nodes 23533 nps 104418 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1e1 a8b8 e1f1 b8a8 f1f2 a8b8 f2g2 b8a8 g2f1 a8b8 f1g1
info depth 18 score cp 159 hashfull 0 time 306 nodes 62937 nps 161836 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8b7 d1e1 b7c7 e1f1 c7b7 f1f2
info depth 19 score cp 159 hashfull 0 time 420 nodes 108831 nps 194757 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8b7 d1e1 b7c7 e1f1 c7d7 f1f2 d7e7 f2g1 e7f8 g1f1 f8f7 f1f2
info depth 20 score cp 159 hashfull 0 time 792 nodes 161884 nps 157689 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8c7 d1c2 c7d7 c2c3 d7c7 c3d3 c7b7 d3d2 b7c7 d2d1 c7d7 d1e2 d7c7
info depth 21 score cp 159 hashfull 0 time 911 nodes 192346 nps 162787 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8c7 d1c2 c7b7 c2b2 b7a7 b2a1 a7a8 a1a2 a8b8 a2a3 b8a7 a3b2 a7b8 b2c1 b8a7 c1d1
info depth 22 score cp 159 hashfull 0 time 1102 nodes 239702 nps 170627 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8c7 d1c2 c7b7 c2b2 b7a7 b2a1 a7a8 a1a2 a8b8 a2a3 b8a7 a3b3 a7b7 b3c2 b7b8 c2c1 b8a8
info depth 23 score cp 159 hashfull 0 time 1844 nodes 526978 nps 214235 pv a1b1 a7a8 b1c1 a8b7 c1d1 b7c7 d1c2
info depth 24 score cp 159 hashfull 0 time 1971 nodes 568074 nps 218211 pv a1b1 a7b7 b1c2 b7b8 c2d1 b8c7 d1c2
info depth 25 score cp 159 hashfull 0 time 2526 nodes 772377 nps 225883 pv a1b1 a7b7 b1c2 b7b8 c2d1 b8c7 d1c1 c7b7 c1d1
info depth 26 score cp 159 hashfull 0 time 4683 nodes 2295149 nps 323814 pv a1b1 a7b7 b1c2 b7b8 c2d1 b8c7 d1c1 c7b7 c1b1 b7c7 b1b2 c7c8 b2a1 c8b8 a1a2 b8b7 a2b2
info depth 27 score cp 159 hashfull 0 time 6603 nodes 5004789 nps 526880 pv a1b1 a7b7 b1c2 b7b8 c2d1 b8c7 d1c1 c7b7 c1b1 b7c7 b1b2 c7c8 b2a1 c8b8 a1a2 b8b7 a2b2
info depth 28 score cp 159 hashfull 0 time 48791 nodes 65179109 nps 904987 pv a1b1 a7b7 b1c2 b7b8 c2d1 b8c7 d1c1 c7b7 c1b1 b7c7 b1b2 c7c8 b2a1 c8b8 a1a2 b8b7 a2b2
bestmove a1b1
# tt lookups: 27718083, hits: 99.98%
federico
Posts: 32
Joined: Sun Oct 22, 2017 4:36 am
Location: Canada
Full name: Federico Rojo

Re: About move ordering and TT hitrate

Post by federico »

flok wrote: Mon Oct 25, 2021 5:24 pm Hmmm, caffeinatedpawn finds a1b1 at the first ply.

Code: Select all

position fen 8/k7/3p4/p2P1p2/P2P1P2/8/8/K7 w - - 0 1
go movetime 60000
# think time: 60000
info depth 1 score cp 168 hashfull 0 time 36 nodes 7 nps 111 pv a1b1
info depth 2 score cp 159 hashfull 0 time 40 nodes 25 nps 375 pv a1b1 a7a8
info depth 3 score cp 159 hashfull 0 time 47 nodes 120 nps 1510 pv a1b1 a7a8 b1a1
info depth 4 score cp 159 hashfull 0 time 53 nodes 215 nps 2490 pv a1b1 a7a8 b1c1 a8b8
info depth 5 score cp 159 hashfull 0 time 62 nodes 436 nps 4387 pv a1b1 a7a8 b1c1 a8b8 c1b1
info depth 6 score cp 150 hashfull 0 time 72 nodes 948 nps 8444 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8
info depth 7 score cp 159 hashfull 0 time 76 nodes 1230 nps 10552 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1e1
info depth 8 score cp 159 hashfull 0 time 80 nodes 1532 nps 12787 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1e1 a8b8
info depth 9 score cp 159 hashfull 0 time 87 nodes 2066 nps 16264 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1c2 a8b8 c2b1
info depth 10 score cp 159 hashfull 0 time 94 nodes 2512 nps 18946 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1c2 a8b8 c2c1 b8a8
info depth 11 score cp 159 hashfull 0 time 103 nodes 3453 nps 24932 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1c2 a8b8 c2c1 b8a8 c1b1
info depth 12 score cp 159 hashfull 0 time 109 nodes 4359 nps 30715 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1c2 a8b8 c2c1 b8a8 c1b1 a8b8
info depth 13 score cp 184 hashfull 0 time 138 nodes 11490 nps 64420 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1e1 a8b8 e1f1 b8a8 f1f2 a8b8 f2g1
info depth 14 score cp 184 hashfull 0 time 147 nodes 14162 nps 75292 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1e1 a8b8 e1f1 b8a8 f1f2 a8b8 f2g1 b8a8
info depth 15 score cp 184 hashfull 0 time 154 nodes 16152 nps 83512 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1e1 a8b8 e1f1 b8a8 f1f2 a8b8 f2g2 b8a8 g2g1
info depth 16 score cp 184 hashfull 0 time 167 nodes 18933 nps 91185 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1e1 a8b8 e1f1 b8a8 f1f2 a8b8 f2g2 b8a8 g2g1 a8b8
info depth 17 score cp 184 hashfull 0 time 184 nodes 23533 nps 104418 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1e1 a8b8 e1f1 b8a8 f1f2 a8b8 f2g2 b8a8 g2f1 a8b8 f1g1
info depth 18 score cp 159 hashfull 0 time 306 nodes 62937 nps 161836 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8b7 d1e1 b7c7 e1f1 c7b7 f1f2
info depth 19 score cp 159 hashfull 0 time 420 nodes 108831 nps 194757 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8b7 d1e1 b7c7 e1f1 c7d7 f1f2 d7e7 f2g1 e7f8 g1f1 f8f7 f1f2
info depth 20 score cp 159 hashfull 0 time 792 nodes 161884 nps 157689 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8c7 d1c2 c7d7 c2c3 d7c7 c3d3 c7b7 d3d2 b7c7 d2d1 c7d7 d1e2 d7c7
info depth 21 score cp 159 hashfull 0 time 911 nodes 192346 nps 162787 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8c7 d1c2 c7b7 c2b2 b7a7 b2a1 a7a8 a1a2 a8b8 a2a3 b8a7 a3b2 a7b8 b2c1 b8a7 c1d1
info depth 22 score cp 159 hashfull 0 time 1102 nodes 239702 nps 170627 pv a1b1 a7a8 b1c1 a8b8 c1d1 b8c7 d1c2 c7b7 c2b2 b7a7 b2a1 a7a8 a1a2 a8b8 a2a3 b8a7 a3b3 a7b7 b3c2 b7b8 c2c1 b8a8
info depth 23 score cp 159 hashfull 0 time 1844 nodes 526978 nps 214235 pv a1b1 a7a8 b1c1 a8b7 c1d1 b7c7 d1c2
info depth 24 score cp 159 hashfull 0 time 1971 nodes 568074 nps 218211 pv a1b1 a7b7 b1c2 b7b8 c2d1 b8c7 d1c2
info depth 25 score cp 159 hashfull 0 time 2526 nodes 772377 nps 225883 pv a1b1 a7b7 b1c2 b7b8 c2d1 b8c7 d1c1 c7b7 c1d1
info depth 26 score cp 159 hashfull 0 time 4683 nodes 2295149 nps 323814 pv a1b1 a7b7 b1c2 b7b8 c2d1 b8c7 d1c1 c7b7 c1b1 b7c7 b1b2 c7c8 b2a1 c8b8 a1a2 b8b7 a2b2
info depth 27 score cp 159 hashfull 0 time 6603 nodes 5004789 nps 526880 pv a1b1 a7b7 b1c2 b7b8 c2d1 b8c7 d1c1 c7b7 c1b1 b7c7 b1b2 c7c8 b2a1 c8b8 a1a2 b8b7 a2b2
info depth 28 score cp 159 hashfull 0 time 48791 nodes 65179109 nps 904987 pv a1b1 a7b7 b1c2 b7b8 c2d1 b8c7 d1c1 c7b7 c1b1 b7c7 b1b2 c7c8 b2a1 c8b8 a1a2 b8b7 a2b2
bestmove a1b1
# tt lookups: 27718083, hits: 99.98%
99.98% TT hit rate?!! That is indeed impressive.

However, i do have some questions though.

Why does it take so long from d27 to d28 ? Having such high hit rate, I would imagine it should reach it instantly. Could it be that although hits are high, cutoffs are low? Notice you didn't report cutoff rate

Also, hashfull is reported as zero. Is it a reporting issue or what was the size of the TT?
User avatar
flok
Posts: 481
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: About move ordering and TT hitrate

Post by flok »

federico wrote: Mon Oct 25, 2021 5:59 pm
flok wrote: Mon Oct 25, 2021 5:24 pm Hmmm, caffeinatedpawn finds a1b1 at the first ply.

Code: Select all

position fen 8/k7/3p4/p2P1p2/P2P1P2/8/8/K7 w - - 0 1
go movetime 60000
# think time: 60000
info depth 1 score cp 168 hashfull 0 time 36 nodes 7 nps 111 pv a1b1
...
info depth 27 score cp 159 hashfull 0 time 6603 nodes 5004789 nps 526880 pv a1b1 a7b7 b1c2 b7b8 c2d1 b8c7 d1c1 c7b7 c1b1 b7c7 b1b2 c7c8 b2a1 c8b8 a1a2 b8b7 a2b2
info depth 28 score cp 159 hashfull 0 time 48791 nodes 65179109 nps 904987 pv a1b1 a7b7 b1c2 b7b8 c2d1 b8c7 d1c1 c7b7 c1b1 b7c7 b1b2 c7c8 b2a1 c8b8 a1a2 b8b7 a2b2
bestmove a1b1
# tt lookups: 27718083, hits: 99.98%
99.98% TT hit rate?!! That is indeed impressive.

However, i do have some questions though.

Why does it take so long from d27 to d28 ? Having such high hit rate, I would imagine it should reach it instantly. Could it be that although hits are high, cutoffs are low? Notice you didn't report cutoff rate
I don't know yet.

About the cutoff-rate: is that the beta cut-off index? With caf.pawn that is 1.35 (so mostly after the first move).
Also, hashfull is reported as zero. Is it a reporting issue or what was the size of the TT?
Might be an issue. I know not a lot about chess itself so I can't say anything about the pv it found, but I'm suspicious about that 99.98% tt rate as well. Combined with the used-almost-no-tt (hashfull of zero).

Well, thanks for point me at that! Caf.pawn is only a few weeks old so giant bugs are likely :-)

[...]

pv a1b1 a7a8 b1c1 a8b8 c1d1 b8a8 d1e1 a8b8 e1f1 b8a8 f1f2 a8b8 f2g2 b8a8 g2g1 a8b8

lots of back-and-forth jumpery