Hi all,
I'm having trouble with check extensions. I know it should be ridiculously simple to implement but it's causing a crash.
At each node, if we're in check I increment the depth by one. That's it.
But the engine crashes after a short time thinking.
Has anyone experienced this problem? If so, how did you fix it?
I'm sure I'm doing something really simple the wrong way......
David Cimbalista
Check Extensions
Moderators: hgm, Rebel, chrisw
-
- Posts: 433
- Joined: Fri Dec 16, 2016 11:04 am
- Location: France
- Full name: Richard Delorme
Re: Check Extensions
When a program crash I use a debugger to understand what happens. It is possible your last addition reveal an older bug that was silent.theturk1234 wrote:Hi all,
I'm having trouble with check extensions. I know it should be ridiculously simple to implement but it's causing a crash.
At each node, if we're in check I increment the depth by one. That's it.
But the engine crashes after a short time thinking.
Has anyone experienced this problem? If so, how did you fix it?
I'm sure I'm doing something really simple the wrong way......
Richard Delorme
-
- Posts: 52
- Joined: Tue Jul 12, 2016 5:28 am
Re: Check Extensions
Hm.....I can try that.
But I'm certainly not an expert at using gdb...
David
But I'm certainly not an expert at using gdb...
David
-
- Posts: 879
- Joined: Mon Dec 15, 2008 11:45 am
Re: Check Extensions
Hi,theturk1234 wrote:Hi all,
I'm having trouble with check extensions. I know it should be ridiculously simple to implement but it's causing a crash.
At each node, if we're in check I increment the depth by one. That's it.
But the engine crashes after a short time thinking.
Has anyone experienced this problem? If so, how did you fix it?
I'm sure I'm doing something really simple the wrong way......
David Cimbalista
well, there are simple things you can check immediately without a debugger.
First, your search code should include a check for maximum depth like
Code: Select all
int search(int depth,...)
{
if(depth == MAXDEPTH)
{
return evalScore()
}
// do usual stuff...
}
There are existing "long" checks like: Qa1+,Ke2,Qa2+,Ke1,Qa1+,Ke2
The first suggestion will help to avoid a crash. The second suggestion will avoid that the engine will hang-up because of a very deep tree but running into the mentioned pseudo code.
If these points are ok, you might check if the check extension is triggered as expected and if really produces the right value and the maths works well.
Good luck.
-
- Posts: 433
- Joined: Fri Jan 16, 2015 4:02 pm
Re: Check Extensions
Try AddressSanitizer to find your bug: https://gcc.gnu.org/onlinedocs/gcc/Inst ... tions.html
zurichess - http://www.zurichess.xyz
-
- Posts: 52
- Joined: Tue Jul 12, 2016 5:28 am
Re: Check Extensions
Thanks!
I think this might enable me to find the bug!
David Cimbalista
I think this might enable me to find the bug!
David Cimbalista