New J.A Compiles

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

Moderator: Ras

Frank Quisinsky
Posts: 7069
Joined: Wed Nov 18, 2009 7:16 pm
Location: Gutweiler, Germany
Full name: Frank Quisinsky

Re: New J.A Compiles

Post by Frank Quisinsky »

Thanks Jim for your time again!
Frank Quisinsky
Posts: 7069
Joined: Wed Nov 18, 2009 7:16 pm
Location: Gutweiler, Germany
Full name: Frank Quisinsky

Re: New J.A Compiles

Post by Frank Quisinsky »

... mistake by myself, sorry!
But what I can say is ... good morning to the readers and Jim!
User avatar
Jim Ablett
Posts: 2304
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: New J.A Compiles

Post by Jim Ablett »

Image
https://github.com/kevlu8/PZChessBot
PZChessBot 4.0 by Kevin Lu

PZChessBot 4.0 64 JA

Windows/Linux & Android profiled builds

Proton link:
https://drive.proton.me/urls/659P4G3J84#zoeFnpSBIUFV

Smash link:
https://fromsmash.com/PZChessBot4JA

Jim.
User avatar
flok
Posts: 604
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: New J.A Compiles

Post by flok »

Jim,

How do you determine the most optimal compiler flags for your builds?
Or do you use the ones suggested by the developer of the program you're compiling?
User avatar
Jim Ablett
Posts: 2304
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: New J.A Compiles

Post by Jim Ablett »

flok wrote: Fri Oct 03, 2025 1:02 pm Jim,

How do you determine the most optimal compiler flags for your builds?
Or do you use the ones suggested by the developer of the program you're compiling?
Hi Folkert,

Just by compiling and testing. I have a set of compiler switches for gcc & clang honed over many years of compiling which
I start with and then experiment by adding or removing different switches to see if I can improve the speed. I like to have an author's build
to test against if possible to measure improvements.

Jim.
User avatar
flok
Posts: 604
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: New J.A Compiles

Post by flok »

Jim Ablett wrote: Fri Oct 03, 2025 1:31 pm
flok wrote: Fri Oct 03, 2025 1:02 pm Jim,

How do you determine the most optimal compiler flags for your builds?
Or do you use the ones suggested by the developer of the program you're compiling?
Hi Folkert,

Just by compiling and testing. I have a set of compiler switches for gcc & clang honed over many years of compiling which
I start with and then experiment by adding or removing different switches to see if I can improve the speed. I like to have an author's build
to test against if possible to measure improvements.

Jim.
Which compiler do you use? GCC/CLANG? or also the microsoft compiler?
I would like to figure out how to compile Dog with the ms compiler to see if it gives any difference in speed.
User avatar
Jim Ablett
Posts: 2304
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: New J.A Compiles

Post by Jim Ablett »

flok wrote: Sun Oct 05, 2025 10:53 am
Jim Ablett wrote: Fri Oct 03, 2025 1:31 pm
flok wrote: Fri Oct 03, 2025 1:02 pm Jim,

How do you determine the most optimal compiler flags for your builds?
Or do you use the ones suggested by the developer of the program you're compiling?
Hi Folkert,

Just by compiling and testing. I have a set of compiler switches for gcc & clang honed over many years of compiling which
I start with and then experiment by adding or removing different switches to see if I can improve the speed. I like to have an author's build
to test against if possible to measure improvements.

Jim.
Which compiler do you use? GCC/CLANG? or also the microsoft compiler?
I would like to figure out how to compile Dog with the ms compiler to see if it gives any difference in speed.
I use them all. Most chess engine src code compiles fastest builds with Clang, some with GCC but it's the exception. I only use MSVC with code that is written for it and doesn't compile on the other two. Code written specifically for MSVC is usually non-portable. MVSC can use Clang as compiler also. On Windows I use Msys2 environment for Clang & GCC and Notepad++ as code editor.

Jim.
User avatar
Jim Ablett
Posts: 2304
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: New J.A Compiles

Post by Jim Ablett »

Jim Ablett wrote: Sun Oct 05, 2025 11:41 am
flok wrote: Sun Oct 05, 2025 10:53 am
Jim Ablett wrote: Fri Oct 03, 2025 1:31 pm
flok wrote: Fri Oct 03, 2025 1:02 pm Jim,

How do you determine the most optimal compiler flags for your builds?
Or do you use the ones suggested by the developer of the program you're compiling?
Hi Folkert,

Just by compiling and testing. I have a set of compiler switches for gcc & clang honed over many years of compiling which
I start with and then experiment by adding or removing different switches to see if I can improve the speed. I like to have an author's build
to test against if possible to measure improvements.

Jim.
Which compiler do you use? GCC/CLANG? or also the microsoft compiler?
I would like to figure out how to compile Dog with the ms compiler to see if it gives any difference in speed.
I use them all. Most chess engine src code compiles fastest builds with Clang, some with GCC but it's the exception. I only use MSVC with code that is written for it and doesn't compile on the other two. Code written specifically for MSVC is usually non-portable. MVSC can use Clang as compiler also. On Windows I use Msys2 environment for Clang & GCC and Notepad++ as code editor.

Jim.

I took a look at your latest src code. There are some issues in the code when compiling natively on windows. (I compile with custom makefile for easy testing/changes, not cmake)

1. Your compiler macros are wrong or inconsistant. 'linux' should be '__linux__'
You have correct macro '_WIN32' and in other places incorrect 'WIN32'

2. bit-field packing in the tt_entry 'tt.h' needs to be different for Windows.

3. added needed Windows specific code to 'tui.cpp'

Here is my modified src code and my custom makefile for compiling successfully on Windows - GCC mingw64 - GCC is faster than Clang with your src code.

https://drive.proton.me/urls/43G5G8K71R#f2KOU4NLMZ2z

Jim.
User avatar
flok
Posts: 604
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: New J.A Compiles

Post by flok »

Jim Ablett wrote: Sun Oct 05, 2025 1:32 pm I took a look at your latest src code. There are some issues in the code when compiling natively on windows. (I compile with custom makefile for easy testing/changes, not cmake)

1. Your compiler macros are wrong or inconsistant. 'linux' should be '__linux__'
You have correct macro '_WIN32' and in other places incorrect 'WIN32'

2. bit-field packing in the tt_entry 'tt.h' needs to be different for Windows.

3. added needed Windows specific code to 'tui.cpp'

Here is my modified src code and my custom makefile for compiling successfully on Windows - GCC mingw64 - GCC is faster than Clang with your src code.

https://drive.proton.me/urls/43G5G8K71R#f2KOU4NLMZ2z

Jim.
Thanks very much.
Let's see if I can integrate it.

Regarding clang: I noticed it as well. The difference was quite big last time I checked (38% iirc).
User avatar
Jim Ablett
Posts: 2304
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: New J.A Compiles

Post by Jim Ablett »

Image
https://github.com/billchow98/chess
Tuna 1.0.0 by Bill Chow

Tuna 1.0.0 64 JA

Windows & Linux profiled builds

Proton link:
https://drive.proton.me/urls/TW3HA9RPFC#P93vGzjRtyZG

Smash link:
https://fromsmash.com/Tuna100JA

Jim.