Discussion of chess software programming and technical issues.
Moderators: bob, hgm, Harvey Williamson
Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
-
AndrewGrant
- Posts: 494
- Joined: Tue Apr 19, 2016 4:08 am
- Location: U.S.A
- Full name: Andrew Grant
-
Contact:
Post
by AndrewGrant » Sun Nov 26, 2017 7:08 am
Make file found here:
https://github.com/AndyGrant/Ethereal/b ... c/makefile
Looking at running times for my engine on my Threadripper1950x machine. (Running Ubuntu17 for now)
Ethereal does not use popcount / PEXT / all that other stuff
Code: Select all
Version | Bench Depth | Nodes Per Second | Time to completion (ms)
GCC 4.8 16 3,593,517 19807
GCC 5.4 16 3,354,796 21217
GCC 6.4 16 3,290,804 21629
GCC 7.2 16 3,239,579 21971
CLANG 16 2,921,272 24365
So whats the deal here? Am I missing compile flags? I tried march=native, mtune=native and got the same results as well...
-
lucasart
- Posts: 3041
- Joined: Mon May 31, 2010 11:29 am
- Full name: lucasart
-
Contact:
Post
by lucasart » Sun Nov 26, 2017 7:32 am
I can confirm your results. GCC performance keeps getting worse with each release since 4.8.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
-
abulmo2
- Posts: 200
- Joined: Fri Dec 16, 2016 10:04 am
-
Contact:
Post
by abulmo2 » Sun Nov 26, 2017 8:52 am
Reading the release information about gcc 5 and above, optimization enhancement mostly concerns inter-procedural optimization and linker optimizations. You probably need to use the -flto flag and profile guided optimization to see some enhancements.
Also note that gcc changes it version numbering. The version 4.x were release about once a year with x incremented and now they increment the main version number once a year. So there are much more changes between say gcc 4.2 and gcc 4.8 than between gcc 5 and gcc 7.
Richard Delorme
-
Sven
- Posts: 3830
- Joined: Thu May 15, 2008 7:57 pm
- Location: Berlin, Germany
- Full name: Sven Schüle
-
Contact:
Post
by Sven » Sun Nov 26, 2017 10:13 am
AndrewGrant wrote:Make file found here:
https://github.com/AndyGrant/Ethereal/b ... c/makefile
Looking at running times for my engine on my Threadripper1950x machine. (Running Ubuntu17 for now)
Ethereal does not use popcount / PEXT / all that other stuff
Code: Select all
Version | Bench Depth | Nodes Per Second | Time to completion (ms)
GCC 4.8 16 3,593,517 19807
GCC 5.4 16 3,354,796 21217
GCC 6.4 16 3,290,804 21629
GCC 7.2 16 3,239,579 21971
CLANG 16 2,921,272 24365
So whats the deal here? Am I missing compile flags? I tried march=native, mtune=native and got the same results as well...
Have you tried g++ instead of gcc? Or at least "-std=c11" instead of "-std=c99"? It might require some code changes but I think the Gnu compiler might be able to create faster code when using the newer language standards.
-
mar
- Posts: 2007
- Joined: Fri Nov 26, 2010 1:00 pm
- Location: Czech Republic
- Full name: Martin Sedlak
Post
by mar » Sun Nov 26, 2017 12:27 pm
Sven wrote:I think the Gnu compiler might be able to create faster code when using the newer language standards.
I very much doubt that. New language features are related to syntactic sugar (therefore frontend).
-
Look
- Posts: 240
- Joined: Thu Jun 05, 2014 12:14 pm
- Location: Iran
- Full name: Mehdi Amini
-
Contact:
Post
by Look » Sun Nov 26, 2017 3:10 pm
[...]
AndrewGrant wrote:So whats the deal here? Am I missing compile flags? I tried march=native, mtune=native and got the same results as well...
Hi,
Which optimization flags did you use ?
With higher optimization, you can get a faster engine, but at times, a minor bug could cause your program, even to crash.
-
syzygy
- Posts: 4457
- Joined: Tue Feb 28, 2012 10:56 pm
Post
by syzygy » Sun Nov 26, 2017 3:19 pm
Look wrote:[...]
AndrewGrant wrote:So whats the deal here? Am I missing compile flags? I tried march=native, mtune=native and got the same results as well...
Hi,
Which optimization flags did you use ?
With higher optimization, you can get a faster engine, but at times, a minor bug could cause your program, even to crash.
He posted a link to the Makefile (he compiles with -O3).
That higher optimisation levels can turn "minor bugs" into crashes is not a reason not to use optimisation. Such "minor bugs" simply need to be fixed. If use of an uninitialised variable does not crash the program, it will likely make it produce incorrect results (which can be almost impossible to notice in a chess engine, except for a measurable decrease in playing strength).
-
D Sceviour
- Posts: 463
- Joined: Mon Jul 20, 2015 3:06 pm
-
Contact:
Post
by D Sceviour » Sun Nov 26, 2017 6:13 pm
syzygy wrote:That higher optimisation levels can turn "minor bugs" into crashes is not a reason not to use optimisation. Such "minor bugs" simply need to be fixed. If use of an uninitialised variable does not crash the program, it will likely make it produce incorrect results (which can be almost impossible to notice in a chess engine, except for a measurable decrease in playing strength).
The gcc <variable> "may be used uninitialized" gives unpredictable bogus results. I visually inspect each element and then ignore the warnings if there is nothing wrong. Of course, something else may be triggering the warning.
-
AndrewGrant
- Posts: 494
- Joined: Tue Apr 19, 2016 4:08 am
- Location: U.S.A
- Full name: Andrew Grant
-
Contact:
Post
by AndrewGrant » Sun Nov 26, 2017 6:28 pm
Just tried using -std=c11. Results are about the same.
-
syzygy
- Posts: 4457
- Joined: Tue Feb 28, 2012 10:56 pm
Post
by syzygy » Sun Nov 26, 2017 6:31 pm
AndrewGrant wrote:Just tried using -std=c11. Results are about the same.
What if you add -flto to CFLAGS?
(It does not do any miracles for me, and I just noticed that even regular Stockfish is faster on my PC if I disable link-time optimisation, but still it is worth a try.)