Thank you.The souce code is easy to understand.abulmo2 wrote: ↑Wed Nov 17, 2021 2:01 pm You may have a look at dumb, it is about 1200 lines of code and 2677 Elo at CCRL 40/4.
You can also give a look at OliThink which is very strong (2867 Elo for version 5.9.7 on CCRL 40/4) with a very compact source code (1033 lines of code for version 5.10.1).
How to write 2200+ elo chess engine within 500 to 1000 lines of code with pure evaluation(No NNUE or EGTB)?
Moderator: Ras
-
- Posts: 30
- Joined: Thu Sep 28, 2017 5:20 pm
Re: How to write 2200+ elo chess engine within 500 to 1000 lines of code with pure evaluation(No NNUE or EGTB)?
-
- Posts: 28353
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: How to write 2200+ elo chess engine within 500 to 1000 lines of code with pure evaluation(No NNUE or EGTB)?
Rotated bitboard was what people used before magic bitboard was invented.
-
- Posts: 30
- Joined: Thu Sep 28, 2017 5:20 pm
-
- Posts: 28353
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: How to write 2200+ elo chess engine within 500 to 1000 lines of code with pure evaluation(No NNUE or EGTB)?
Slower, I suppose. For one, you have to update 4 'occupied' boards in stead of 1, one for each orientation, during MakeMove/UnMake. Secondly, in magic bitboards you look up moves in 4 directions at once. The rotated bitboards are still of the variety where you have to generate the moves along each orientation separately, and OR them together. Advantage is that the involved tables are far smaller.
-
- Posts: 30
- Joined: Thu Sep 28, 2017 5:20 pm
Re: How to write 2200+ elo chess engine within 500 to 1000 lines of code with pure evaluation(No NNUE or EGTB)?
Thank you very much.hgm wrote: ↑Sat Nov 20, 2021 1:47 pm Slower, I suppose. For one, you have to update 4 'occupied' boards in stead of 1, one for each orientation, during MakeMove/UnMake. Secondly, in magic bitboards you look up moves in 4 directions at once. The rotated bitboards are still of the variety where you have to generate the moves along each orientation separately, and OR them together. Advantage is that the involved tables are far smaller.
-
- Posts: 1062
- Joined: Tue Apr 28, 2020 10:03 pm
- Full name: Daniel Infuehr
Re: How to write 2200+ elo chess engine within 500 to 1000 lines of code with pure evaluation(No NNUE or EGTB)?
You want to have the operations you need to do "each and every move" absolutely minimal.shahil4242 wrote: ↑Sat Nov 20, 2021 1:41 pmNow i got it.Just curious to know what are the disadvantages of rotated bitboard?
With rotated boards you have to maintain 4x the boards and there is no single x64 instruction to "rotate a 8x8 board inside this register"
BUT: You get the fastest sliding lookup possible because there are 2 or 3 bit algorithms that work extremely well - but only in lsb-msb direction.
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
Daniel Inführ - Software Developer
-
- Posts: 30
- Joined: Thu Sep 28, 2017 5:20 pm
Re: How to write 2200+ elo chess engine within 500 to 1000 lines of code with pure evaluation(No NNUE or EGTB)?
Is there fastest way other than magic bitboard to generate moves for sliding pieces?dangi12012 wrote: ↑Sat Nov 20, 2021 3:24 pmYou want to have the operations you need to do "each and every move" absolutely minimal.shahil4242 wrote: ↑Sat Nov 20, 2021 1:41 pmNow i got it.Just curious to know what are the disadvantages of rotated bitboard?
With rotated boards you have to maintain 4x the boards and there is no single x64 instruction to "rotate a 8x8 board inside this register"
BUT: You get the fastest sliding lookup possible because there are 2 or 3 bit algorithms that work extremely well - but only in lsb-msb direction.
-
- Posts: 1062
- Joined: Tue Apr 28, 2020 10:03 pm
- Full name: Daniel Infuehr
Re: How to write 2200+ elo chess engine within 500 to 1000 lines of code with pure evaluation(No NNUE or EGTB)?
Sure they are. L2 array lookups are not free you know.shahil4242 wrote: ↑Sat Nov 20, 2021 3:31 pmIs there fastest way other than magic bitboard to generate moves for sliding pieces?dangi12012 wrote: ↑Sat Nov 20, 2021 3:24 pmYou want to have the operations you need to do "each and every move" absolutely minimal.shahil4242 wrote: ↑Sat Nov 20, 2021 1:41 pmNow i got it.Just curious to know what are the disadvantages of rotated bitboard?
With rotated boards you have to maintain 4x the boards and there is no single x64 instruction to "rotate a 8x8 board inside this register"
BUT: You get the fastest sliding lookup possible because there are 2 or 3 bit algorithms that work extremely well - but only in lsb-msb direction.
Some under "By Calculation"
https://www.chessprogramming.org/Sliding_Piece_Attacks
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
Daniel Inführ - Software Developer
-
- Posts: 30
- Joined: Thu Sep 28, 2017 5:20 pm
Re: How to write 2200+ elo chess engine within 500 to 1000 lines of code with pure evaluation(No NNUE or EGTB)?
I had tried the classical approach before it worksdangi12012 wrote: ↑Sat Nov 20, 2021 3:47 pmSure they are. L2 array lookups are not free you know.shahil4242 wrote: ↑Sat Nov 20, 2021 3:31 pmIs there fastest way other than magic bitboard to generate moves for sliding pieces?dangi12012 wrote: ↑Sat Nov 20, 2021 3:24 pmYou want to have the operations you need to do "each and every move" absolutely minimal.shahil4242 wrote: ↑Sat Nov 20, 2021 1:41 pmNow i got it.Just curious to know what are the disadvantages of rotated bitboard?
With rotated boards you have to maintain 4x the boards and there is no single x64 instruction to "rotate a 8x8 board inside this register"
BUT: You get the fastest sliding lookup possible because there are 2 or 3 bit algorithms that work extremely well - but only in lsb-msb direction.
Some under "By Calculation"
https://www.chessprogramming.org/Sliding_Piece_Attacks
nicely.
In my experimental chess engine of bitboard i had used in between squares for movegen but it is much slower than mailbox approach which uses piece list.It is 80 times slower.
-
- Posts: 797
- Joined: Tue Dec 18, 2007 9:38 pm
- Location: Munich, Germany
- Full name: Dr. Oliver Brausch
Re: How to write 2200+ elo chess engine within 500 to 1000 lines of code with pure evaluation(No NNUE or EGTB)?
Yes. OliThink4 (https://github.com/olithink/olithink4)shahil4242 wrote: ↑Sat Nov 20, 2021 5:10 amI think one of the version of OliThink had uses rotated bitboard.What is the result of perft? Does it is faster than magic bitboard?is it is woth learning about rotated bitboard.OliverBr wrote: ↑Thu Nov 18, 2021 11:40 pmActually dumb is really intriguing. It's very compact and well written.abulmo2 wrote: ↑Wed Nov 17, 2021 2:01 pm You may have a look at dumb, it is about 1200 lines of code and 2677 Elo at CCRL 40/4.
You can also give a look at OliThink which is very strong (2867 Elo for version 5.9.7 on CCRL 40/4) with a very compact source code (1033 lines of code for version 5.10.1).
had rotated bitboards. And it had good results and caught the attention of many chess pioneers. One of them them is a Stockfish developer.
The Kindergarten bitboards of OliThink5 (https://github.com/olithink/OliThink)
was another independent development of my own without looking into other sources. I got the name many years after its creation.
The perft of OliThink5 (https://github.com/olithink/OliThink/tree/oliperft)
is better than OliThink4.
But this is still no decisive argument which to use, because the move generation is supposed to be compatable with the rest of the programm.