Chess programming Youtube channel: 1+ year summary

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: Chess programming Youtube channel: 1+ year summary

Post by dangi12012 »

g++-11 Gigantua.cpp Movegen.hpp Movemap.hpp Movelist.hpp -std=c++2a -march=native -O3 -fomit-frame-pointer -foptimize-sibling-calls -o giga_gcc

Clang is faster and produces faster code with more modern backend - just use clang :)
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
Krzysztof Grzelak
Posts: 1534
Joined: Tue Jul 15, 2014 12:47 pm

Re: Chess programming Youtube channel: 1+ year summary

Post by Krzysztof Grzelak »

If you are a good programmer, please program something like here on the website https://www.uwccpi2021.draughtsprograms.eu/live.html for chess.
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Chess programming Youtube channel: 1+ year summary

Post by maksimKorzh »

dangi12012 wrote: Sat Oct 09, 2021 11:52 am g++-11 Gigantua.cpp Movegen.hpp Movemap.hpp Movelist.hpp -std=c++2a -march=native -O3 -fomit-frame-pointer -foptimize-sibling-calls -o giga_gcc

Clang is faster and produces faster code with more modern backend - just use clang :)
Sorry but I'm getting tons of errors (I believe linking errors for it prints files are missing) using clang or g++.
g++-11 doesn't get installed via ubuntu repos and I just don't want to build it myself.

Could you please kindly add a "Stockfish Standard" like compilation equivalent for OLD 64-bit processors?
I'm only used to work with old plain gcc and all these new fancy variations of the compilers are a bit of rocket science to me)

EDIT: It's not my business but as a user I would like to have a makefile like in Stockfish so I could manually select the build scenario basing on the available hardware configurations because altering a world class code manually feels like a bit too much) And also it would be great if again like just like Stockfish it gets compiled using the good old plain g++. I understand that you want to provide the fastest build possible but for me personally only the relative improvement matters and I think you agree that it's better to have a slower but working version instead a faster one but with compilation issues.
Last edited by maksimKorzh on Sat Oct 09, 2021 6:23 pm, edited 3 times in total.
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Chess programming Youtube channel: 1+ year summary

Post by maksimKorzh »

Krzysztof Grzelak wrote: Sat Oct 09, 2021 2:31 pm If you are a good programmer, please program something like here on the website https://www.uwccpi2021.draughtsprograms.eu/live.html for chess.
I think what you're looking for already exists: https://tcec-chess.com/
dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: Chess programming Youtube channel: 1+ year summary

Post by dangi12012 »

maksimKorzh wrote: Sat Oct 09, 2021 6:15 pm
dangi12012 wrote: Sat Oct 09, 2021 11:52 am g++-11 Gigantua.cpp Movegen.hpp Movemap.hpp Movelist.hpp -std=c++2a -march=native -O3 -fomit-frame-pointer -foptimize-sibling-calls -o giga_gcc

Clang is faster and produces faster code with more modern backend - just use clang :)
Sorry but I'm getting tons of errors (I believe linking errors for it prints files are missing) using clang or g++.
g++-11 doesn't get installed via ubuntu repos and I just don't want to build it myself.

Could you please kindly add a "Stockfish Standard" like compilation equivalent for OLD 64-bit processors?
I'm only used to work with old plain gcc and all these new fancy variations of the compilers are a bit of rocket science to me)

EDIT: It's not my business but as a user I would like to have a makefile like in Stockfish so I could manually select the build scenario basing on the available hardware configurations because altering a world class code manually feels like a bit too much) And also it would be great if again like just like Stockfish it gets compiled using the good old plain g++. I understand that you want to provide the fastest build possible but for me personally only the relative improvement matters and I think you agree that it's better to have a slower but working version instead a faster one but with compilation issues.
Makefile is something for a bigger project - this is literally a single cpp file.
You get errors because clang-10 doesnt support C++20 fully. You get errors in gcc because the C++ runtime you are using is not compatible. My codebase is really not that big.
To install clang (Ubuntu) just do:

Code: Select all

sudo apt install clang-12 --install-suggests
Else I suggest you use visual studio. Since performance is comparable but msvc builds much faster.

Then just go into the source directory Gigantua\Gigantua and run:
clang-12 -march=native -std=c++20 -lstdc++ -O3 Gigantua.cpp -flto -o giga_clang
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Chess programming Youtube channel: 1+ year summary

Post by maksimKorzh »

dangi12012 wrote: Sat Oct 09, 2021 6:43 pm
maksimKorzh wrote: Sat Oct 09, 2021 6:15 pm
dangi12012 wrote: Sat Oct 09, 2021 11:52 am g++-11 Gigantua.cpp Movegen.hpp Movemap.hpp Movelist.hpp -std=c++2a -march=native -O3 -fomit-frame-pointer -foptimize-sibling-calls -o giga_gcc

Clang is faster and produces faster code with more modern backend - just use clang :)
Sorry but I'm getting tons of errors (I believe linking errors for it prints files are missing) using clang or g++.
g++-11 doesn't get installed via ubuntu repos and I just don't want to build it myself.

Could you please kindly add a "Stockfish Standard" like compilation equivalent for OLD 64-bit processors?
I'm only used to work with old plain gcc and all these new fancy variations of the compilers are a bit of rocket science to me)

EDIT: It's not my business but as a user I would like to have a makefile like in Stockfish so I could manually select the build scenario basing on the available hardware configurations because altering a world class code manually feels like a bit too much) And also it would be great if again like just like Stockfish it gets compiled using the good old plain g++. I understand that you want to provide the fastest build possible but for me personally only the relative improvement matters and I think you agree that it's better to have a slower but working version instead a faster one but with compilation issues.
Makefile is something for a bigger project - this is literally a single cpp file.
You get errors because clang-10 doesnt support C++20 fully. You get errors in gcc because the C++ runtime you are using is not compatible. My codebase is really not that big.
To install clang (Ubuntu) just do:

Code: Select all

sudo apt install clang-12 --install-suggests
Else I suggest you use visual studio. Since performance is comparable but msvc builds much faster.

Then just go into the source directory Gigantua\Gigantua and run:
clang-12 -march=native -std=c++20 -lstdc++ -O3 Gigantua.cpp -flto -o giga_clang
clang-12 is not available on my linux mint via the command you've provided, so I've downloaded the release and ran it locally:

Code: Select all

 ../../clang/bin/clang-12 -march=native -std=c++20 -lstdc++ -O3 Gigantua.cpp -flto -o giga_clang
In file included from Gigantua.cpp:6:
In file included from ./Movelist.hpp:2:
In file included from ./Chess_Base.hpp:6:
./Movemap.hpp:16041:16: error: no member named 'is_constant_evaluated' in namespace 'std'
                    if (std::is_constant_evaluated()) {
                        ~~~~~^
1 error generated.
But it still results in error.
PLEASE just add a binary executable for old processors.
dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: Chess programming Youtube channel: 1+ year summary

Post by dangi12012 »

maksimKorzh wrote: Sat Oct 09, 2021 8:25 pm
dangi12012 wrote: Sat Oct 09, 2021 6:43 pm
maksimKorzh wrote: Sat Oct 09, 2021 6:15 pm
dangi12012 wrote: Sat Oct 09, 2021 11:52 am g++-11 Gigantua.cpp Movegen.hpp Movemap.hpp Movelist.hpp -std=c++2a -march=native -O3 -fomit-frame-pointer -foptimize-sibling-calls -o giga_gcc

Clang is faster and produces faster code with more modern backend - just use clang :)
Sorry but I'm getting tons of errors (I believe linking errors for it prints files are missing) using clang or g++.
g++-11 doesn't get installed via ubuntu repos and I just don't want to build it myself.

Could you please kindly add a "Stockfish Standard" like compilation equivalent for OLD 64-bit processors?
I'm only used to work with old plain gcc and all these new fancy variations of the compilers are a bit of rocket science to me)

EDIT: It's not my business but as a user I would like to have a makefile like in Stockfish so I could manually select the build scenario basing on the available hardware configurations because altering a world class code manually feels like a bit too much) And also it would be great if again like just like Stockfish it gets compiled using the good old plain g++. I understand that you want to provide the fastest build possible but for me personally only the relative improvement matters and I think you agree that it's better to have a slower but working version instead a faster one but with compilation issues.
Makefile is something for a bigger project - this is literally a single cpp file.
You get errors because clang-10 doesnt support C++20 fully. You get errors in gcc because the C++ runtime you are using is not compatible. My codebase is really not that big.
To install clang (Ubuntu) just do:

Code: Select all

sudo apt install clang-12 --install-suggests
Else I suggest you use visual studio. Since performance is comparable but msvc builds much faster.

Then just go into the source directory Gigantua\Gigantua and run:
clang-12 -march=native -std=c++20 -lstdc++ -O3 Gigantua.cpp -flto -o giga_clang
clang-12 is not available on my linux mint via the command you've provided, so I've downloaded the release and ran it locally:

Code: Select all

 ../../clang/bin/clang-12 -march=native -std=c++20 -lstdc++ -O3 Gigantua.cpp -flto -o giga_clang
In file included from Gigantua.cpp:6:
In file included from ./Movelist.hpp:2:
In file included from ./Chess_Base.hpp:6:
./Movemap.hpp:16041:16: error: no member named 'is_constant_evaluated' in namespace 'std'
                    if (std::is_constant_evaluated()) {
                        ~~~~~^
1 error generated.
But it still results in error.
PLEASE just add a binary executable for old processors.
As i told you - you need to replace the body of that method on line 16038 with return AttackPtr[_pext_u64_emulated(blocker, Mask)];
Then you dont have constant evaluation.

You are almost there :)
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Chess programming Youtube channel: 1+ year summary

Post by maksimKorzh »

dangi12012 wrote: Sat Oct 09, 2021 11:00 pm
maksimKorzh wrote: Sat Oct 09, 2021 8:25 pm
dangi12012 wrote: Sat Oct 09, 2021 6:43 pm
maksimKorzh wrote: Sat Oct 09, 2021 6:15 pm
dangi12012 wrote: Sat Oct 09, 2021 11:52 am g++-11 Gigantua.cpp Movegen.hpp Movemap.hpp Movelist.hpp -std=c++2a -march=native -O3 -fomit-frame-pointer -foptimize-sibling-calls -o giga_gcc

Clang is faster and produces faster code with more modern backend - just use clang :)
Sorry but I'm getting tons of errors (I believe linking errors for it prints files are missing) using clang or g++.
g++-11 doesn't get installed via ubuntu repos and I just don't want to build it myself.

Could you please kindly add a "Stockfish Standard" like compilation equivalent for OLD 64-bit processors?
I'm only used to work with old plain gcc and all these new fancy variations of the compilers are a bit of rocket science to me)

EDIT: It's not my business but as a user I would like to have a makefile like in Stockfish so I could manually select the build scenario basing on the available hardware configurations because altering a world class code manually feels like a bit too much) And also it would be great if again like just like Stockfish it gets compiled using the good old plain g++. I understand that you want to provide the fastest build possible but for me personally only the relative improvement matters and I think you agree that it's better to have a slower but working version instead a faster one but with compilation issues.
Makefile is something for a bigger project - this is literally a single cpp file.
You get errors because clang-10 doesnt support C++20 fully. You get errors in gcc because the C++ runtime you are using is not compatible. My codebase is really not that big.
To install clang (Ubuntu) just do:

Code: Select all

sudo apt install clang-12 --install-suggests
Else I suggest you use visual studio. Since performance is comparable but msvc builds much faster.

Then just go into the source directory Gigantua\Gigantua and run:
clang-12 -march=native -std=c++20 -lstdc++ -O3 Gigantua.cpp -flto -o giga_clang
clang-12 is not available on my linux mint via the command you've provided, so I've downloaded the release and ran it locally:

Code: Select all

 ../../clang/bin/clang-12 -march=native -std=c++20 -lstdc++ -O3 Gigantua.cpp -flto -o giga_clang
In file included from Gigantua.cpp:6:
In file included from ./Movelist.hpp:2:
In file included from ./Chess_Base.hpp:6:
./Movemap.hpp:16041:16: error: no member named 'is_constant_evaluated' in namespace 'std'
                    if (std::is_constant_evaluated()) {
                        ~~~~~^
1 error generated.
But it still results in error.
PLEASE just add a binary executable for old processors.
As i told you - you need to replace the body of that method on line 16038 with return AttackPtr[_pext_u64_emulated(blocker, Mask)];
Then you dont have constant evaluation.

You are almost there :)
Ok, so I've replaced:

Code: Select all

_ForceInline constexpr uint64_t operator[](const uint64_t blocker) const
{
		if (std::is_constant_evaluated()) {
			return AttackPtr[_pext_u64_emulated(blocker, Mask)];
		}
		else {
			return AttackPtr[_pext_u64(blocker, Mask)];
		}
}
with:

Code: Select all

return AttackPtr[_pext_u64_emulated(blocker, Mask)];
But apart from pext I also don't have BMI support as well, hence
I'm getting these errors (which are expected because I don't have BMI):

Code: Select all

./Movelist.hpp:157:17: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function 'Refresh' that is compiled without support for 'bmi'
                Bitloop(atkHV) {
                ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
In file included from Gigantua.cpp:6:
./Movelist.hpp:163:17: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function 'Refresh' that is compiled without support for 'bmi'
                Bitloop(pinnersHV)
                ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
In file included from Gigantua.cpp:6:
./Movelist.hpp:170:17: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function 'Refresh' that is compiled without support for 'bmi'
                Bitloop(atkD12) {
                ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
In file included from Gigantua.cpp:6:
./Movelist.hpp:176:17: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function 'Refresh' that is compiled without support for 'bmi'
                Bitloop(pinnersD12)
                ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
In file included from Gigantua.cpp:6:
./Movelist.hpp:196:13: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function 'Refresh' that is compiled without support for 'bmi'
            Bitloop(knights) {
            ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
In file included from Gigantua.cpp:6:
./Movelist.hpp:213:13: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function 'Refresh' that is compiled without support for 'bmi'
            Bitloop(bishops) {
            ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
In file included from Gigantua.cpp:6:
./Movelist.hpp:223:13: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function 'Refresh' that is compiled without support for 'bmi'
            Bitloop(rooks) {
            ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
In file included from Gigantua.cpp:6:
./Movelist.hpp:460:13: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function '_enumerate' that is compiled without support for 'bmi'
            Bitloop(knights) {
            ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
In file included from Gigantua.cpp:6:
./Movelist.hpp:483:13: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function '_enumerate' that is compiled without support for 'bmi'
            Bitloop(bish_pinned) {
            ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
In file included from Gigantua.cpp:6:
./Movelist.hpp:494:13: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function '_enumerate' that is compiled without support for 'bmi'
            Bitloop(bish_nopin) {
            ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
In file included from Gigantua.cpp:6:
./Movelist.hpp:511:13: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function '_enumerate' that is compiled without support for 'bmi'
            Bitloop(rook_pinned) {
            ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
In file included from Gigantua.cpp:6:
./Movelist.hpp:522:13: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function '_enumerate' that is compiled without support for 'bmi'
            Bitloop(rook_nopin) {
            ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
In file included from Gigantua.cpp:6:
./Movelist.hpp:535:13: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function '_enumerate' that is compiled without support for 'bmi'
            Bitloop(queens) {
            ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
In file included from Gigantua.cpp:6:
./Movelist.hpp:460:13: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function '_enumerate' that is compiled without support for 'bmi'
            Bitloop(knights) {
            ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
In file included from Gigantua.cpp:6:
./Movelist.hpp:483:13: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function '_enumerate' that is compiled without support for 'bmi'
            Bitloop(bish_pinned) {
            ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
In file included from Gigantua.cpp:6:
./Movelist.hpp:494:13: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function '_enumerate' that is compiled without support for 'bmi'
            Bitloop(bish_nopin) {
            ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
In file included from Gigantua.cpp:6:
./Movelist.hpp:511:13: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function '_enumerate' that is compiled without support for 'bmi'
            Bitloop(rook_pinned) {
            ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
In file included from Gigantua.cpp:6:
./Movelist.hpp:522:13: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function '_enumerate' that is compiled without support for 'bmi'
            Bitloop(rook_nopin) {
            ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
In file included from Gigantua.cpp:6:
./Movelist.hpp:535:13: error: always_inline function '__blsr_u64' requires target feature 'bmi', but would be inlined into function '_enumerate' that is compiled without support for 'bmi'
            Bitloop(queens) {
            ^
./Chess_Base.hpp:30:32: note: expanded from macro 'Bitloop'
#define Bitloop(X) for(;X; X = _blsr_u64(X))
                               ^
/home/maksim/Downloads/clang/lib/clang/12.0.0/include/bmiintrin.h:278:28: note: expanded from macro '_blsr_u64'
#define _blsr_u64(a)      (__blsr_u64((a)))
                           ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Can it be compiled without BMI?
Is there a pure "software" implementation/replacement for BMI?
dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: Chess programming Youtube channel: 1+ year summary

Post by dangi12012 »

maksimKorzh wrote: Sat Oct 09, 2021 11:22 pm
Sure we are almost there replace the instances of / redefine:
_blsr_u64(X) => (X & (X-1))
_tzcnt_u64(X) => __builtin_ctz(X)
_blsi_u64(X) => (X & -X)

Then we have it finished. No more intrinsics needed.

Performance? I cant tell - should still be very very fast. Weak Intel with lower clocks and without intrinsics.
My gut feeling tells me maybe 30% of a Zen3 thread performance.

Greetings - Daniel
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Chess programming Youtube channel: 1+ year summary

Post by maksimKorzh »

dangi12012 wrote: Sun Oct 10, 2021 1:51 am
maksimKorzh wrote: Sat Oct 09, 2021 11:22 pm
Sure we are almost there replace the instances of / redefine:
_blsr_u64(X) => (X & (X-1))
_tzcnt_u64(X) => __builtin_ctz(X)
_blsi_u64(X) => (X & -X)

Then we have it finished. No more intrinsics needed.

Performance? I cant tell - should still be very very fast. Weak Intel with lower clocks and without intrinsics.
My gut feeling tells me maybe 30% of a Zen3 thread performance.

Greetings - Daniel
Ok, this worked, actually only redefining __blsr_u64(X) and __blsi_u64(X) was enough, than it was compiling for... more than 5 minutes for sure (why so long???) and then finally I got a linker error which is obviously not related to the movegen but maybe you can tell me what's wrong:

Code: Select all

../../clang/bin/clang-12 -march=native -std=c++20 -lstdc++ -O3 Gigantua.cpp -flto -o giga_clang
/usr/bin/ld: /home/maksim/Downloads/clang/bin/../lib/LLVMgold.so: error loading plugin: /home/maksim/Downloads/clang/bin/../lib/LLVMgold.so: cannot open shared object file: No such file or directory
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)