Upon cleaning those up...
I'll get the regular bench with the final PGO build, BUT during the profile-generate stage, I'll get a different bench.
Currently installing gcc7.2 from source on this machine so I can use -fsanitize=undefined...
gcc4.8 outperforming gcc5, gcc6, gcc7
Moderators: hgm, Rebel, chrisw
-
- Posts: 1759
- Joined: Tue Apr 19, 2016 6:08 am
- Location: U.S.A
- Full name: Andrew Grant
Re: gcc4.8 outperforming gcc5, gcc6, gcc7
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
-
- Posts: 5566
- Joined: Tue Feb 28, 2012 11:56 pm
Re: gcc4.8 outperforming gcc5, gcc6, gcc7
Compile with -fsanitize=undefined:AndrewGrant wrote:I tried doing a PGO build, and actually got a different bench... which really confuses me.
Code: Select all
search.c:386:47: runtime error: index -1 out of bounds for type 'int [9]'
Code: Select all
&& quiets > LateMovePruningCounts[depth]
-
- Posts: 1759
- Joined: Tue Apr 19, 2016 6:08 am
- Location: U.S.A
- Full name: Andrew Grant
Re: gcc4.8 outperforming gcc5, gcc6, gcc7
That would be because of the patch I pushed yesterday... to allow indexing that array when in check (which means depth could be < 0).
I'm surprised I don't get these errors when I run my program through valgrind / gdb
I'm surprised I don't get these errors when I run my program through valgrind / gdb
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
-
- Posts: 2488
- Joined: Tue Aug 30, 2016 8:19 pm
- Full name: Rasmus Althoff
Re: gcc4.8 outperforming gcc5, gcc6, gcc7
Valgrind isn't really useful with local or global variables. gdb doesn't report an error because that access is still within valid memory. I think the access returns 8 because right before that, there is LateMovePruningDepth.AndrewGrant wrote:I'm surprised I don't get these errors when I run my program through valgrind / gdb
And for O3, I have seen GCC blowing up the program and becoming slower because the bigger program exceeded some CPU caches.
-
- Posts: 1759
- Joined: Tue Apr 19, 2016 6:08 am
- Location: U.S.A
- Full name: Andrew Grant
Re: gcc4.8 outperforming gcc5, gcc6, gcc7
Testing the results of the fix for this mistake. The patch that introduced this bug was a good +10ELO
Seems like this bug was really holding the original patch back. I'll run a test with my normal TC 5+.05s and 20+.2s before I commit
depth_bug_fix
SPRT @ 2.0+0.02s with 1MB Hash
LLR: 2.96 (-2.94, 2.94) [0.00, 5.00]
Games: 5100 W: 1626 L: 1465 D: 2009
ELO: 10.97
This also has fixed my issue with PGO build differing from nonPGO.
Thank you for taking the time and tracking this down. I'll be sure to mention you when I commit the fix.
If you want actual contribution credits IE submit a PR, that can be done aswell
Seems like this bug was really holding the original patch back. I'll run a test with my normal TC 5+.05s and 20+.2s before I commit
depth_bug_fix
SPRT @ 2.0+0.02s with 1MB Hash
LLR: 2.96 (-2.94, 2.94) [0.00, 5.00]
Games: 5100 W: 1626 L: 1465 D: 2009
ELO: 10.97
This also has fixed my issue with PGO build differing from nonPGO.
Thank you for taking the time and tracking this down. I'll be sure to mention you when I commit the fix.
If you want actual contribution credits IE submit a PR, that can be done aswell
#WeAreAllDraude #JusticeForDraude #RememberDraude #LeptirBigUltra
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
"Those who can't do, clone instead" - Eduard ( A real life friend, not this forum's Eduard )
-
- Posts: 5566
- Joined: Tue Feb 28, 2012 11:56 pm
Re: gcc4.8 outperforming gcc5, gcc6, gcc7
If you mean me, please don't bother!AndrewGrant wrote:Thank you for taking the time and tracking this down. I'll be sure to mention you when I commit the fix.
If you want actual contribution credits IE submit a PR, that can be done aswell
You were going to try -fsantize=undefined anyway as you posted 4 minutes before my post. When I saw that I felt a bit bad that I had not let you discover it yourself! It is quite amazing to have such a tool that easily saves you many hours of debugging.
So the credits should go to the developers of -fsanitize.
-
- Posts: 12542
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: gcc4.8 outperforming gcc5, gcc6, gcc7
You can check array bounds manually:AndrewGrant wrote:That would be because of the patch I pushed yesterday... to allow indexing that array when in check (which means depth could be < 0).
I'm surprised I don't get these errors when I run my program through valgrind / gdb
Code: Select all
assert(index >= 0);
assert(index < 64);
piece[index] = aPiece;
color[index] = aColor;
Code: Select all
#include <assert.h>
#include <stdlib.h>
#define single_dim_check( a, x ) ( (assert( (x >= 0 ) && (sizeof a / sizeof a[0] > x ) ) )
int main(void)
{
int a[5];
size_t index = 6;
single_dim_check(a,index);
return 0;
}
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.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.