Adam-Kulju / Patricia

Extremely aggressive chess engine, written in C++
MIT License
51 stars 6 forks source link

Segmentation fault when using "go" #13

Closed enfmarinho closed 4 months ago

enfmarinho commented 4 months ago
Screenshot 2024-04-20 at 14 12 30

Hello, i was trying to use your chess engine to have some inspiration for mine, when i have encounter that error. I am not able to run it, since it just segfaults, i don't know much, so maybe i'm just doing something dump, but for know i'm just not able to run it due to that error. For my little knowledge i think it is failing on the reset_nnue function inside the iterative_deepening. It only works when i'm in debug mode as you can see.

Adam-Kulju commented 4 months ago

Hi, if you want to search infinitely with Patricia, don't use "go", use "go infinite". Patricia doesn't know how to handle "go" by itself and honestly I didn't think that was valid UCI before today. Thanks for bringing it up to my attention.

enfmarinho commented 4 months ago
Screenshot 2024-04-20 at 21 03 04

Sorry to bother again, seems that go infinite also don't work as expected, it just works with the command "d" witch i assume to be debug mode. If the platform matters i am running it on macos

enfmarinho commented 4 months ago
Screenshot 2024-04-20 at 21 59 23

I have added some print statements to find out what is going on. I think its understandable what is happening from them. In the "add_to_all" function in the file "nnue.h" line 63 for some reason the for loop that is being performed go out of bounds, since the "offset" parameter is 755712 and the size of the "delta" array is 589824.

enfmarinho commented 4 months ago

I apologize for my dumb mistake, I forgot to use the "position startpos" command.