-
Notifications
You must be signed in to change notification settings - Fork 130
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 EGTB support to fishtest #545
Comments
Fishtest deletes the temporary folder after building stockfish, so it required a PR EDIT_000: there are two different ways.
|
The EGTB files should almost never change. Should i add them to the books repo and do a PR? |
I think that's a bit quick honestly. Things to consider:
|
In this SF branch the EGTB files were added with the message "No endgames stuff" and the size is very low: I thought that the EGTB were used to test some EG ideas. |
I agree with @vondele. The test was meant to demonstrate that we might drop all the endgame stuff and bundle Stockfish with the most basic EGTB files instead. This would also work for phones, tablets, etc. since the size of the egtbs folder is very small. Unfortunately, the way I tried to test this is not supported by fishtest. |
The set of files here was only 3MB. If that size alone is better than
engames.cpp, then isn't that a different scenario?
|
i don't think it will be hard at all to fix fishtest to support this test.
|
@protonspring dirty fix already running on DEV server. Please mind that a N cores worker will access N times the HD for the EGTB with a slowdown.. |
i would expect the drive would cache those little files. if you are very
worried about it, I might also just suggest to set up a ram disk and put
the EGTP files on that.
|
@ppigazzini Awesome! |
EDIT_001: data update with endgames.epd book
Workers started according to this wiki section using this repo/branch. Here the quick and dirty patch (not production ready):
|
@ppigazzini Thank you very much! A small elo loss was to be expected, of course! Getting rid of >1,200 lines of code at the cost of 2-6 elo seems definitely worth a consideration, imho. OTOH, it is fascinating to see that even this handcoded endgame knowledge, partially incomplete and even causing some eval discontinuities, is worth something! |
@joergoster first, I think these are useful experiments to do. However, my feeling is that there is value in the 'human coded' endgame knowledge. Not only Elo, but also some chess knowledge condensed. In fact I wish we could extend it more (e.g. the KRPvKBP or KRPsvKRPs). So replacing ~1000 lines of code with ~>1MB of data seem no win to me. That's in line with your last remark, that it is fascinating that such incomplete knowledge has value. Note that even the 150GB 6men TB (and about 1700 lines of code) seems only worth about 10-20Elo depending on TC (https://github.com/glinscott/fishtest/wiki/UsefulData#elo-gain-using-syzygy). I really don't think that 'most users' will analyze with 5/6men TB. The engine enthusiasts likely, but most users are elsewhere, downloading an app on the phone, or using the webasm version via lichess. |
as a PS, maybe this would be an interesting test to run against the endgames.epd book. |
i would be interested in adding only the necessary tables to replace some
specific endgames.
I have less experience than you folks, but KRPKR or KBPKR seem quite challenging. Perhaps just a few if the tough ones and consider them individually.
I am still in favor of adding this minimalist set (3 MB) without removing endgame code and changing fish test. This way we can do more testing on individual tables and add as needed or where a particular book proves to be helpful (without being too big).
|
At the very least, fix the directory issue so that a fishtest user could add an egtb to their code branch and test it on the framework. |
@protonspring the quick fix for a fast test was easy (view the update of my previous post), a production grade fix should require additional work.
By the way I lack SF know-how e.g. I don't know if SF at default behavior looks for the "egtbs" folder. |
By default SF doesn't look for EGTB files. |
OK, so this change (and how to implement) is in the @vondele hands :) |
I started a new fixed test using the endgames.epd book. To everybody: feel free to submit tests on DEV (use your credential or "user01/user01" to submit and "user00/user00" to approve), please mind that the DEV db is synchronized from time to time with the PROD db so the results don't last: copy the test result not the link. To join some workers: #!/bin/bash
dir_num=${1:-'00'}
usr_pwd=${2:-'user01'}
test_folder=${HOME}/_git/__test_folder${dir_num}
virtual_env=${test_folder}/fishtest/worker/env
fish_host=dfts-0.pigazzini.it
rm -rf ${test_folder}
mkdir -p ${test_folder}
cd ${test_folder}
git clone --single-branch --branch master https://github.com/glinscott/fishtest.git
cd ${test_folder}/fishtest
git config user.email "you@example.com"
git config user.name "your_name"
# add here the upstream branch to be tested
git remote add new-upstream https://github.com/ppigazzini/fishtest
git pull --no-edit new-upstream egtb_test
# add here the PRs to be tested
#git pull --no-edit origin pull/539/head
cd ${test_folder}/fishtest/worker
arch_cpu=x86-64
if [ "$(g++ -Q -march=native --help=target | grep mpopcnt | grep enabled)" ] ; then
arch_cpu=x86-64-modern
elif [ "$(g++ -Q -march=native --help=target | grep mbmi2 | grep enabled)" ] ; then
arch_cpu=x86-64-bmi2
fi
echo "CXXFLAGS='-march=native' make profile-build -j ARCH=${arch_cpu} COMP=gcc" > custom_make.txt
python3 -m venv ${virtual_env}
${virtual_env}/bin/pip install --upgrade pip setuptools wheel
${virtual_env}/bin/pip install requests
${virtual_env}/bin/python3 worker.py --host ${fish_host} ${usr_pwd} ${usr_pwd} --concurrency 3 |
@ppigazzini endgames.epd gives a much more sensitive result! |
This is the books repo, perhaps @vondele could be able to help with some info about the books |
Thanks. I wasn't aware of this special repo. |
If fishtest executed stockfish from the build directory, it would allow a developer to test whatever they wanted. What is the reasoning for changing the working directory? |
@vondele Going one step further and stripping off scale factor downscaling, too, reveals a big elo loss. However, in a quick local test, 5-man syzygy bases almost equalized the loss!
I'm now running the same test with 6-man files. |
Keep the fishtest code simple, have short path names, have a low hd space requirement for CPU contributors etc. etc. |
Sry for the dumb questions, But wouldn't it be much more simple to just run
the executable in the build directory?
|
The original implementation moved the binaries in the "testing" folder, so to run the binary in the building folder requires some refactoring (building, updating, binaries cache, cutechess-cli command etc.). Keep in mind that in the early day the windows workers were not able to build the binaries and simply downloaded the binaries form a binaries builder. |
@protonspring fishtest was coded in hurry to support Stockfish, can be surely improved. Feel free to join the fishtest developers community :) |
Two questions:
1. Are all workers building now?
2. Are the branches to compare ( master vs patch) built in different directories?
|
Also, is there a primer for developers on fishtest? How do i start
changing stuff without breaking the framework?
|
In this wiki page there are several info for a fishtest developer: server setup script (e.g. use a VM), server and worker script to test locally an idea etc. |
@vondele @joergoster #545 (comment) updated with the endgames.epd book |
I don't want to go down a rabbit hole. I glanced at some of the code and it seems like it wouldn't be difficult to do the following:
This way, I could add an EGTB to my repository and test it on the framework. Is this a worthwhile effort? I don't know python very well, but I'm happy to do it if it's going to be useful. |
@protonspring IMO the correct steps are:
At the moment I'm only supporting some tests on DEV to help the decision n. 1 |
@ppigazzini @vondele @protonspring Just some thoughts about adding EGTBs to fishtest.
|
I'm pretty reluctant as well. Indeed 5men is the minimum to have some effect. The HDD issue is not solved, and it adds a feature we don't quite know how much work it will be to support/maintain. It is interesting to know how much each TB file adds in Elo, but I think these are experiments that somehow need to be done outside of fishtest for the time being. |
@joergoster This is why i did this patch, but your way would not allow different versions to test different books. |
FWOW, @jhorthos has managed to collect data on the most important 7 piece endgame tablebases and which add the most coverage per bit. It may well be the case that you can cover 50% of fishtest endgames with only 10% of 5-man TBs, in which case HDDs shouldn’t be an issue. OS caching can easily fit a few dozen megabytes of disk into RAM. I will reach out to him and see if he has any data, or if he is able to share the tools he used. |
@gonzalezjo thanks! part of this info is available here as well official-stockfish/Stockfish#2288 (comment) |
If we add a directory with EGTB to the stockfish repository. When stockfish is executed, it can't find the EGTB files.
This seems most likely due to fishtest not executing the stockfish binary in the same folder where it was built.
The text was updated successfully, but these errors were encountered: