Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TT implementation. #28

Merged
merged 9 commits into from
Jun 17, 2024
Merged

Add TT implementation. #28

merged 9 commits into from
Jun 17, 2024

Conversation

DomiKoPL
Copy link
Collaborator

No description provided.

@DomiKoPL DomiKoPL marked this pull request as draft May 28, 2024 16:31
@DomiKoPL
Copy link
Collaborator Author

I have to add TT to Search. However search currently is just a simple function, so I would need to add it as a parameter. Weird. I have to think if I should do it correctly now or temporarily do it like that.

@Gustav2137
Copy link
Collaborator

TT should be either a global variable or we can wrap search into some class and put TT as a field there.

@DomiKoPL
Copy link
Collaborator Author

Yes, we should. There should be a class that implements Engine like MinMaxEngine or sth.

@Gustav2137
Copy link
Collaborator

Oh that's what the engine class is for. I can refactor code to fit this template then.

@Gustav2137
Copy link
Collaborator

Gustav2137 commented May 28, 2024

I have just committed changes we were discussing to #25. Feel free to review them.
Edit: *Feel free to review them as soon as I fix whatever I broke in the current code.

@Gustav2137
Copy link
Collaborator

Gustav2137 commented May 28, 2024

Ok done.

Implementation based on https://www.chessprogramming.org/Shared_Hash_Table\#Lockless.
TTData stores score, move, depth, age and type.
std::vector requires elements to be copy-constructible, which std::atomic doesn't allow. I guess we won't be resizing the TT after the creation, so simple dynamic array should be enough for now.
cpp_bestia/src/tt.cpp Outdated Show resolved Hide resolved
@Gustav2137
Copy link
Collaborator

lgtm, merging

@Gustav2137 Gustav2137 marked this pull request as ready for review June 17, 2024 12:33
@Gustav2137 Gustav2137 merged commit 2d1885f into master Jun 17, 2024
2 checks passed
@Gustav2137 Gustav2137 deleted the TT branch June 17, 2024 12:48
@Gustav2137 Gustav2137 restored the TT branch June 17, 2024 12:48
@Gustav2137 Gustav2137 linked an issue Jun 17, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Transposition Table
2 participants