Port to zig 0.14.1#39
Conversation
|
Theres also two small changes, i removed the arena allocator and instead use the c allocator directly in the UCI code so the lines are now properly freed. I also changed the stack size for the search thread to 256MB as the previous limit of 64MB was causing crashes when built with the latest compiler. |
|
Hey, thanks again for the effort. I tried compiling with your makefile using zig 0.14.1. I am seeing identical outputs as the old version (great!), but the new one is quite a lot slower. I'm not sure what I am doing wrong so I am attaching what I did. Is this what you used to compile? For comparison, the old binary outputs so the new binary seems 750x slower. Am I missing something? Thanks. |
|
thats very strange, ill investigate it |
|
yeah its a performance regression where some array copies are no longer elided, the workaround is to take a reference to arrays before accessing them, im applying the changes through the codebase |
|
im working on getting the speed back up now |
|
its unfortunately still not there, almost 2x slower still |
|
Thanks. I see, so the issue is that most of the functions use copy instead of pointers? That sounds plausible. I remember having everything pointers a long time ago but copies turned out to be faster... Perhaps the new compiler does things differently. I can trying making more params pointers some time. |
|
I can confirm that after your fixes the engine is now much much faster, only 2x slower than the old compiler as you mentioned. |
|
Yeah, the biggest issue was the entire rook and bishop attack arrays being copied for every single call to get the magics. |
|
in dev zig this copying issue seems to be fixed! |
Thanks a lot for letting me know! I will try it out when possible. |
let's go. I thought the project is almost dead. I am so glad to see the crew is still active. let's start working on the engine again with our beloved zig. Btw, are we going to see some android and other packages in the next release? |
|
maybe not exactly what youre looking for, but pawnocchio does have some android compatible builds (aarch64-linux) |
You might consider this project "dead" in the sense that I don't plan to improve its strength significantly in the near future. As it has been pointed out, you might want to check out pawnocchio, which is stronger and more active. |
Modernized the entire codebase including
build.zigandMakefile, engine is now a little faster due the more modern compiler.