Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Worsening performance with bigger hash table

Author: Reinhard Scharnagl

Date: 00:13:30 12/10/05

Go up one level in this thread


On December 10, 2005 at 02:12:39, TEERAPONG TOVIRAT wrote:

>Hi,
>
>I asked my friend to run a few tests for me. Surprisingly, he told me that when
>he set bigger hash table size ,the performance decreased. How could this happen?
>Can it be his hardware problem? For mines, everything is alright.
>Any comment is appreciated.
>
>Regards,
>Teerapong

Some days ago I have posted the results of an experiment with a cached Perft
using an engine's transposition table, thus being independent from any randomly
differing search tree shaping. It has shown, that there is a relation of average
search time and optimal cache size for a given engine. Moreover I added an
explanation for this effect. But the reaction on that has been not that
impressive. So I repeat the posted contents here:

The result of my test is, that depending from the average thinking time for a
move the cache size should be selected in SMIRF before the game starts as:

Ply 6:  16 MB,   1.3 sec (Blitz)
Ply 7:  64 MB,  16.5 sec (Rapid)
Ply 8: 512 MB, 227.8 sec (Normal)

a) the chance to find data within the CPU internal cache size is greater, as
long as the chances to find an entry at all is high. So there are less slowing
down events as to fetch outside that internal cache.

b) depending on the replacement scheme outdated entries are earlier overwritten,
so SMIRF's 4-fold associative storing and retreiving will find entries after
less trials in average.

The size of (single processor) SMIRF's cache could be adjusted before a game.

Indeed the effect is related to the processor's built in cache size, but about
33% seems to be caused by the nature of the used replacement scheme. In SMIRF
there is no need to clear the transposition table during a game. The entries are
aging corresponding inverse to the invested efforts. The less time put into a TT
entry, the earlier it will be randomly replaced. Thus the table is always 100%
filled. So what should I write out to an UCI interface? May be the latest
average success rate of finding requested position entries.

This replacement scheme is also working within my TT enhanced Perft testings.
Thus the results have a meaning also for regular usage within a calculating
engine. That is, that for a given desired average calculating time per move
there exists an optimal cache size. Using more would rather do harm than
benefit. But that are of course only some few percent of performance.
Nevertheless it would be best to work out those ideal time to TT-size relations
for an engine.

There always is the question, why to use a cached Perft at all. I think, this is
a very effective idea to verify the correctness and efficiency of caching and
replacement scheme, when comparing such results to traditionally calculated
Perft results. Moreover Smirf's tests do a lot more than merely to count moves.
It is making a worthy statistic on costly calculated qualified move information.

Regards, Reinhard.

FEN: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

  +-*--b--c--d--*--f--g--*-+ MS Vis.Studio C++ Vers. 13.10
8 |[r][n][b][q][k][b][n][r]| (Compilation: Dec  4 2005)
7 |[p][p][p][p][p][p][p][p]|
6 |   :::   :::   :::   :::| Perft Testseries
5 |:::   :::   :::   :::   | (With TT Caching 4.0 MB / 4-fold)
4 |   :::   :::   :::   :::| TT Access Success 31.6%
3 |:::   :::   :::   :::   |
2 |<P><P><P><P><P><P><P><P>| Smirf Test No.: 00
1 |<R><N><B><Q><K><B><N><R>|
=>+-*--b--c--d--*--f--g--*-+ Break Time 25.0 Sec.

Ply      Nodes     all (x)   (e.p.)    all (+)      (#)  Prom.   Castl.   Sec.
------------------------------------------------------------------------------
1           20           0        0          0        0      0        0      0
2          400           0        0          0        0      0        0      0
3         8902          34        0         12        0      0        0      0
4       197281        1576        0        469        8      0        0      0
5      4865609       82719      258      27351      347      0        0    0.1
6    119060324     2812008     5248     809099    10828      0        0    1.5
7   3195901860   108329926   319617   33103848   435767      0   883453   29.8
------------------------------------------------------------------------------


FEN: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

  +-*--b--c--d--*--f--g--*-+ MS Vis.Studio C++ Vers. 13.10
8 |[r][n][b][q][k][b][n][r]| (Compilation: Dec  4 2005)
7 |[p][p][p][p][p][p][p][p]|
6 |   :::   :::   :::   :::| Perft Testseries
5 |:::   :::   :::   :::   | (With TT Caching 8.0 MB / 4-fold)
4 |   :::   :::   :::   :::| TT Access Success 35.7%
3 |:::   :::   :::   :::   |
2 |<P><P><P><P><P><P><P><P>| Smirf Test No.: 00
1 |<R><N><B><Q><K><B><N><R>|
=>+-*--b--c--d--*--f--g--*-+ Break Time 25.0 Sec.

Ply      Nodes     all (x)   (e.p.)    all (+)      (#)  Prom.   Castl.   Sec.
------------------------------------------------------------------------------
1           20           0        0          0        0      0        0      0
2          400           0        0          0        0      0        0      0
3         8902          34        0         12        0      0        0      0
4       197281        1576        0        469        8      0        0      0
5      4865609       82719      258      27351      347      0        0    0.1
6    119060324     2812008     5248     809099    10828      0        0    1.4
7   3195901860   108329926   319617   33103848   435767      0   883453   25.3
------------------------------------------------------------------------------


FEN: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

  +-*--b--c--d--*--f--g--*-+ MS Vis.Studio C++ Vers. 13.10
8 |[r][n][b][q][k][b][n][r]| (Compilation: Dec  4 2005)
7 |[p][p][p][p][p][p][p][p]|
6 |   :::   :::   :::   :::| Perft Testseries
5 |:::   :::   :::   :::   | (With TT Caching 16.0 MB / 4-fold)
4 |   :::   :::   :::   :::| TT Access Success 30.4%
3 |:::   :::   :::   :::   |
2 |<P><P><P><P><P><P><P><P>| Smirf Test No.: 00
1 |<R><N><B><Q><K><B><N><R>|
=>+-*--b--c--d--*--f--g--*-+ Break Time 25.0 Sec.

Ply      Nodes     all (x)   (e.p.)    all (+)      (#) Prom.    Castl.   Sec.
------------------------------------------------------------------------------
1           20           0        0          0        0     0         0      0
2          400           0        0          0        0     0         0      0
3         8902          34        0         12        0     0         0      0
4       197281        1576        0        469        8     0         0      0
5      4865609       82719      258      27351      347     0         0    0.1
6    119060324     2812008     5248     809099    10828     0         0    1.3
7   3195901860   108329926   319617   33103848   435767     0    883453   20.6
8  84998978956  3523740106  7187977  968981593  9852036     0  23605205  577.5
------------------------------------------------------------------------------


FEN: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

  +-*--b--c--d--*--f--g--*-+ MS Vis.Studio C++ Vers. 13.10
8 |[r][n][b][q][k][b][n][r]| (Compilation: Dec  4 2005)
7 |[p][p][p][p][p][p][p][p]|
6 |   :::   :::   :::   :::| Perft Testseries
5 |:::   :::   :::   :::   | (With TT Caching 32.0 MB / 4-fold)
4 |   :::   :::   :::   :::| TT Access Success 34.9%
3 |:::   :::   :::   :::   |
2 |<P><P><P><P><P><P><P><P>| Smirf Test No.: 00
1 |<R><N><B><Q><K><B><N><R>|
=>+-*--b--c--d--*--f--g--*-+ Break Time 25.0 Sec.

Ply      Nodes     all (x)   (e.p.)    all (+)      (#) Prom.    Castl.   Sec.
------------------------------------------------------------------------------
1           20           0        0          0        0     0         0      0
2          400           0        0          0        0     0         0      0
3         8902          34        0         12        0     0         0      0
4       197281        1576        0        469        8     0         0      0
5      4865609       82719      258      27351      347     0         0    0.1
6    119060324     2812008     5248     809099    10828     0         0    1.3
7   3195901860   108329926   319617   33103848   435767     0    883453   17.4
8  84998978956  3523740106  7187977  968981593  9852036     0  23605205  357.3
------------------------------------------------------------------------------


FEN: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

  +-*--b--c--d--*--f--g--*-+ MS Vis.Studio C++ Vers. 13.10
8 |[r][n][b][q][k][b][n][r]| (Compilation: Dec  4 2005)
7 |[p][p][p][p][p][p][p][p]|
6 |   :::   :::   :::   :::| Perft Testseries
5 |:::   :::   :::   :::   | (With TT Caching 64.0 MB / 4-fold)
4 |   :::   :::   :::   :::| TT Access Success 40.9%
3 |:::   :::   :::   :::   |
2 |<P><P><P><P><P><P><P><P>| Smirf Test No.: 00
1 |<R><N><B><Q><K><B><N><R>|
=>+-*--b--c--d--*--f--g--*-+ Break Time 25.0 Sec.

Ply      Nodes     all (x)   (e.p.)    all (+)      (#) Prom.    Castl.   Sec.
------------------------------------------------------------------------------
1           20           0        0          0        0     0         0      0
2          400           0        0          0        0     0         0      0
3         8902          34        0         12        0     0         0      0
4       197281        1576        0        469        8     0         0      0
5      4865609       82719      258      27351      347     0         0    0.1
6    119060324     2812008     5248     809099    10828     0         0    1.3
7   3195901860   108329926   319617   33103848   435767     0    883453   16.5
8  84998978956  3523740106  7187977  968981593  9852036     0  23605205  270.8
------------------------------------------------------------------------------


FEN: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

  +-*--b--c--d--*--f--g--*-+ MS Vis.Studio C++ Vers. 13.10
8 |[r][n][b][q][k][b][n][r]| (Compilation: Dec  4 2005)
7 |[p][p][p][p][p][p][p][p]|
6 |   :::   :::   :::   :::| Perft Testseries
5 |:::   :::   :::   :::   | (With TT Caching 128.0 MB / 4-fold)
4 |   :::   :::   :::   :::| TT Access Success 45.2%
3 |:::   :::   :::   :::   |
2 |<P><P><P><P><P><P><P><P>| Smirf Test No.: 00
1 |<R><N><B><Q><K><B><N><R>|
=>+-*--b--c--d--*--f--g--*-+ Break Time 25.0 Sec.

Ply      Nodes     all (x)   (e.p.)    all (+)      (#) Prom.    Castl.   Sec.
------------------------------------------------------------------------------
1           20           0        0          0        0     0         0      0
2          400           0        0          0        0     0         0      0
3         8902          34        0         12        0     0         0      0
4       197281        1576        0        469        8     0         0      0
5      4865609       82719      258      27351      347     0         0    0.1
6    119060324     2812008     5248     809099    10828     0         0    1.3
7   3195901860   108329926   319617   33103848   435767     0    883453   16.6
8  84998978956  3523740106  7187977  968981593  9852036     0  23605205  241.7
------------------------------------------------------------------------------


FEN: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

  +-*--b--c--d--*--f--g--*-+ MS Vis.Studio C++ Vers. 13.10
8 |[r][n][b][q][k][b][n][r]| (Compilation: Dec  4 2005)
7 |[p][p][p][p][p][p][p][p]|
6 |   :::   :::   :::   :::| Perft Testseries
5 |:::   :::   :::   :::   | (With TT Caching 256.0 MB / 4-fold)
4 |   :::   :::   :::   :::| TT Access Success 48.5%
3 |:::   :::   :::   :::   |
2 |<P><P><P><P><P><P><P><P>| Smirf Test No.: 00
1 |<R><N><B><Q><K><B><N><R>|
=>+-*--b--c--d--*--f--g--*-+ Break Time 25.0 Sec.

Ply      Nodes     all (x)   (e.p.)    all (+)      (#) Prom.    Castl.   Sec.
------------------------------------------------------------------------------
1           20           0        0          0        0     0         0      0
2          400           0        0          0        0     0         0      0
3         8902          34        0         12        0     0         0      0
4       197281        1576        0        469        8     0         0      0
5      4865609       82719      258      27351      347     0         0    0.1
6    119060324     2812008     5248     809099    10828     0         0    1.3
7   3195901860   108329926   319617   33103848   435767     0    883453   17.1
8  84998978956  3523740106  7187977  968981593  9852036     0  23605205  234.0
------------------------------------------------------------------------------


FEN: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

  +-*--b--c--d--*--f--g--*-+ MS Vis.Studio C++ Vers. 13.10
8 |[r][n][b][q][k][b][n][r]| (Compilation: Dec  4 2005)
7 |[p][p][p][p][p][p][p][p]|
6 |   :::   :::   :::   :::| Perft Testseries
5 |:::   :::   :::   :::   | (With TT Caching 512.0 MB / 4-fold)
4 |   :::   :::   :::   :::| TT Access Success 52.7%
3 |:::   :::   :::   :::   |
2 |<P><P><P><P><P><P><P><P>| Smirf Test No.: 00
1 |<R><N><B><Q><K><B><N><R>|
=>+-*--b--c--d--*--f--g--*-+ Break Time 25.0 Sec.

Ply      Nodes     all (x)   (e.p.)    all (+)      (#) Prom.    Castl.   Sec.
------------------------------------------------------------------------------
1           20           0        0          0        0     0         0      0
2          400           0        0          0        0     0         0      0
3         8902          34        0         12        0     0         0      0
4       197281        1576        0        469        8     0         0      0
5      4865609       82719      258      27351      347     0         0    0.1
6    119060324     2812008     5248     809099    10828     0         0    1.4
7   3195901860   108329926   319617   33103848   435767     0    883453   17.5
8  84998978956  3523740106  7187977  968981593  9852036     0  23605205  227.8
------------------------------------------------------------------------------


Reinhard.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.