Help with transposition table

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
eboatwright
Posts: 41
Joined: Tue Jan 09, 2024 8:38 pm
Full name: E Boatwright

Re: Help with transposition table

Post by eboatwright »

mvanthoor wrote: Tue Jan 23, 2024 11:48 pm Very good starting point :) Run a test: disable the transposition table (remove the calls to it, or make sure it never stores anything; I can do this by setting the size to 0 MB) and and run it against the same engine with the TT enabled. The Elo-difference should be somewhere between 130-160 Elo. If so, you could then implement buckets and aging.
Alright. thanks!
Creator of Maxwell
User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: Help with transposition table

Post by Desperado »

The Elo-difference should be somewhere between 130-160 Elo. If so, you could then implement buckets and aging.
That depends very much on the current level of the engine. You might want to break it down into the following chunks.

1. Move Ordering - retrieving the transposition table move and sorting the movelist but do not prune anything
2. TT pruning - if a transposition is found, pruning the tree
3. Using TT in quiescense search
4. Different search type (pvs, alpha-beta - the handlig might be different)

These are at least the large components that can (and should) be tested separately. If a component does not result in a significant increase in Elo, something is not working properly during sorting and/or pruning. In QS, for example, the benefit night not compensate for the effort.

I guess even for an engine in early stage of devlopment the components should sum up something bewtween 50-100 Elo.

Good Luck, enjoy.
User avatar
eboatwright
Posts: 41
Joined: Tue Jan 09, 2024 8:38 pm
Full name: E Boatwright

Re: Help with transposition table

Post by eboatwright »

Desperado wrote: Wed Jan 24, 2024 4:11 pm 3. Using TT in quiescense search
I actually haven't looked into using the TT during the quiescence search, I'll definitely try that out!
Creator of Maxwell
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Help with transposition table

Post by mvanthoor »

Desperado wrote: Wed Jan 24, 2024 4:11 pm
I guess even for an engine in early stage of devlopment the components should sum up something bewtween 50-100 Elo.
More, even in a super-basic engine. I actually tested it, in Rustic Alpha 2.

SPRT results

Move ordering on the TT-move adds about 102 elo:

Code: Select all

Score of Rustic Alpha 2 vs Rustic Alpha 1.5: 409 - 197 - 133  [0.643] 739
...      Rustic Alpha 2 playing White: 218 - 84 - 68  [0.681] 370
...      Rustic Alpha 2 playing Black: 191 - 113 - 65  [0.606] 369
...      White vs Black: 331 - 275 - 133  [0.538] 739
Elo difference: 102.5 +/- 23.5, LOS: 100.0 %, DrawRatio: 18.0 %
SPRT: llr 2.95 (100.1%), lbound -2.94, ubound 2.94 - H1 was accepted
TT-cuts (early return from alpha-beta if an evaluation value is found) adds 41 Elo

Code: Select all

Score of Rustic Alpha 1.5 vs Rustic Alpha 1.1: 869 - 646 - 357  [0.560] 1872
...      Rustic Alpha 1.5 playing White: 431 - 321 - 184  [0.559] 936
...      Rustic Alpha 1.5 playing Black: 438 - 325 - 173  [0.560] 936
...      White vs Black: 756 - 759 - 357  [0.499] 1872
Elo difference: 41.6 +/- 14.2, LOS: 100.0 %, DrawRatio: 19.1 %
SPRT: llr 2.95 (100.3%), lbound -2.94, ubound 2.94 - H1 was accepted
Principal Variation Search adds 54 Elo:

Code: Select all

Score of Rustic Alpha 2.2.100 vs Rustic Alpha 2.1.100: 591 - 388 - 318  [0.578] 1297
...      Rustic Alpha 2.2.100 playing White: 334 - 171 - 143  [0.626] 648
...      Rustic Alpha 2.2.100 playing Black: 257 - 217 - 175  [0.531] 649
...      White vs Black: 551 - 428 - 318  [0.547] 1297
Elo difference: 54.8 +/- 16.6, LOS: 100.0 %, DrawRatio: 24.5 %
SPRT: llr 2.95 (100.3%), lbound -2.94, ubound 2.94 - H1 was accepted
Total 197 Elo in self-play. Self-play is always somewhat exaggerated; in a gauntlet, these features add roughly 150 Elo, +/- 10.
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL