So, back-tracking a bit on the last comment I made here. I actually did manage to get Atomics to work, with some reworking of the code.
I basically had to create a second 16-byte (local, not shared) buffer to work with individual entries that are being loaded or added. From that temp buffer I'd load the entry pieces, individually, and then get two 64-bit arrays and then store them into the main buffer. Because then I was just adding/loading 64-bits, I could use the Atomics operations. Complicated, but it worked and it didn't seem to have a negative performance impact.
And from there I was able to get threads working, mostly. I can do a search on a position and it works, and seems to have a small improvement in speed. But for some reason when I try to run tests through cutechess the engine will eventually start to return "unexpected" moves (a bunch of those warnings from cutechess) or simply stop responding to pings. And I can't reproduce those errors during debugging so it's hard to troubleshoot.
So I think I managed to get about 99% of the way to multithreading. But I think I'm going to stash this work and move onto something else for now.
Problems using a single "byte array" for the transposition table
Moderator: Ras
-
- Posts: 93
- Joined: Sun Aug 08, 2021 9:14 pm
- Full name: Kurt Peters