Titboards

From Chessprogramming wiki
Revision as of 05:06, 24 July 2024 by ShawnXu (talk | contribs) (add cpu info)
Jump to: navigation, search

Home * Board Representation * Bitboards * Sliding Piece Attacks * Titboards

Titboards,
a bitboard-based move generation technique invented by Zach Wegner [1]. Titboards are based on an extension of bitboards to ternary boards, hence the name ("bit" means binary digit, "tit" mean ternary digit). Titboards are only used for move generation, not for any other purposes that typical bitboard attack-getters will be used for.

The idea of titboards is to eliminate bitscans. Typical bitboard move generation techniques generate a bitboard, intersect it with the set of allowable squares (empty or enemy-occupied), and then serialize that into a list of moves. Titboards take a bitboard occupancy for each side for just one rank, file, or diagonal, and convert them to ternary representations and add them together. This index can determine which squares can actually be moved to, instead of just attacked. It is used in a lookup table of 3^7=2187 entries per direction per square.

Titboards are not typically used (there is no known engine that implements them). The reasons behind this are that they use a large amount of memory (more than Magic Bitboards), and they must keep another attack generation method beside them due to their inflexibility. Modern cpus also have built-in bitscan instructions, further obsoleting ternary boards.

Speed

Testing shows that titboards have no speed advantage over magic bitboards.

CPU: AMD Ryzen 9 5950X 16-Core Processor

Titboard perft group:
Run 1 completed with 18652876 nps.
Run 2 completed with 19684211 nps.
Run 3 completed with 36981116 nps.
Run 4 completed with 19180560 nps.
Run 5 completed with 19103484 nps.
Run 6 completed with 20140754 nps.
All tests completed with means nps: 22290500

Pext perft group:
Run 1 completed with 39392460 nps.
Run 2 completed with 40452566 nps.
Run 3 completed with 48139295 nps.
Run 4 completed with 38508901 nps.
Run 5 completed with 36894349 nps.
Run 6 completed with 40414558 nps.
All tests completed with means nps: 40633688

Magic Bitboard perft group:
Run 1 completed with 36586293 nps.
Run 2 completed with 37227627 nps.
Run 3 completed with 45869401 nps.
Run 4 completed with 35909201 nps.
Run 5 completed with 35063617 nps.
Run 6 completed with 37278392 nps.
All tests completed with means nps: 37989088

Forum Posts

Re: Yet another new bitboard move generation method by Harm Geert Muller, Winboard Forum, October 01, 2006 [2]

References

Up one level