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).
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.
Just tried using -std=c11. Results are about the same.
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra "Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
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.)
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.
Yes, gcc sometimes produces bogus warnings (the most annoying being array out of bounds where no array is accessed out of bounds), but where it is right, the proper solution is to fix it and not to accept it as a "minor bug" and compile without optimisation hoping there is no harm
If there is a bug, a crash is the best thing that can happen since it ensures that the bug is detected. The problem with some of these bugs is that the crash (not the bug) goes away when compiling in debug mode. That makes it harder to locate them. But nowadays it is pretty easy to locate them using -fsanitize.
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra "Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra "Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
I definitely get best performance with gcc 7.2. It beats all my other compilers handily.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra "Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )