Crafty warning...

Discussion of chess software programming and technical issues.

Moderator: Ras

bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Crafty warning...

Post by bob »

I just ran into something that was a royal pain in the ass to find. Made some changes to Crafty, and in testing I discovered that the bishop + pawns on both wings score was simply useless. I removed it and made a few other cosmetic changes and Crafty became about 10 Elo weaker. I tested, re-tested, tested each change one by one, and discovered the only change that broke anything was when I removed the bishop + pawns on opposite wings scoring terms themselves. Removing their usage from Evaluate() didn't hurt, but removing them from data.c/data.h did.

Culprit was a rogue crafty.cpf file I had somehow saved at some point. If I remove something in data.c, I have to remove it from the data structure for the .cpf file definitions, and there was the problem. Now that old .cpf file was changing thing that were not intended to be changed, because the personality line numbers had changed by 1 beyond that bishop scoring term.

The moral: watch out for old .cpf files, they can wreck things. I am going to fix this by saving the version number of the program that saves the .cpf file, and comparing it to the current version of the program when it loads it (crafty.cpf is loaded automatically when you start crafty and such a file exists in the current directory).

Was beginning to doubt my sanity for a bit...
Cardoso
Posts: 363
Joined: Thu Mar 16, 2006 7:39 pm
Location: Portugal
Full name: Alvaro Cardoso

Re: Crafty warning...

Post by Cardoso »

bob wrote: ...Was beginning to doubt my sanity for a bit...
yes, I know the feeling :wink:
In my personal experience in hunting bugs, I ran into some that later I was astonished how I could find them, because they were so hidden.
Of course I don't say anything about the ones still lurking around.
Alvaro
Cardoso
Posts: 363
Joined: Thu Mar 16, 2006 7:39 pm
Location: Portugal
Full name: Alvaro Cardoso

Re: Crafty warning...

Post by Cardoso »

Cardoso wrote:
bob wrote: ...Was beginning to doubt my sanity for a bit...
yes, I know the feeling :wink:
In my personal experience in hunting bugs, I ran into some that later I was astonished how I could find them, because they were so hidden.
Of course I don't say anything about the ones still lurking around.
Alvaro
maybe we should start implementing self correcting features in our programming languages, after all, someone already did it:
https://www.youtube.com/watch?v=CBeCxKzYiIA
Alvaro