miguel-ambrona / D3-Chess

Chess Unwinnability Analyzer is an implementation of a decision procedure for checking whether there exists a sequence of legal moves that allows a certain player to checkmate their opponent in a given chess position.
https://chasolver.org
GNU General Public License v3.0
51 stars 8 forks source link

Add CI pipeline #1

Closed ddugovic closed 3 years ago

ddugovic commented 3 years ago

Free for open source projects, GitHub can automatically compile and test code with each commit: https://github.com/features/actions

ddugovic commented 3 years ago

Hi! Sorry, I can explain a bit better... I'm making a recommendation which can help if this code ever changes, or you want to measure performance over time.

Presently https://github.com/ddugovic/D3-Chess/actions shows 1 successful Linux-based build + test which completed in 42 seconds. The actual test completed in 2 seconds:

Run ./d3 test
Dead Draw Detector version 1.0
Unwinnable: Bb2kb2/bKp1p1p1/1pP1P1P1/1P6/p5P1/P7/8/8 b - - 0 1 white
Unwinnable: K1k5/P1Pp4/1p1P4/8/p7/P2P4/8/8 w - - 0 1 black
Unwinnable: 8/8/5pk1/p6p/P1p2p1P/2P2P2/4K3/8 w - - 7 44
Unwinnable: 1N5B/p5K1/P2p4/2pPk1p1/2P1p1P1/b3P1P1/2P5/8 b - - 0 1 black
Unwinnable: 8/1p6/pPp5/P1P5/8/4nkp1/6p1/6K1 b - - 1 71 QpptleSj
Unwinnable: 8/1k6/1p1pB3/pPpP4/P1Pp1p1p/3PbP1P/6K1/8 w - - 48 85 jnsJhG8T
Unwinnable: 2R5/8/1p6/kP6/p6p/P7/6KP/1R6 b - - 1 48 dZhy51vS

If you accept this pull request using the button below, then https://github.com/miguel-ambrona/D3-Chess/actions can indicate the same results, and each time you publish a code change, GitHub can compile & test and report back the results (which anyone can see).

miguel-ambrona commented 3 years ago

I have accepted it. Let me know if you need me to do anything else!

ddugovic commented 3 years ago

Excellent! I think that's fine; you're right that the test positions are not representative which is why ./d3 test took 2 seconds at https://github.com/miguel-ambrona/D3-Chess/actions

miguel-ambrona commented 3 years ago

Exactly, also note that 2 seconds is huge for 11 positions (because some are actually quite hard). How many game positions would you include? I was thinking of 10K.

ddugovic commented 3 years ago

Honestly, I have no idea what would be required to demonstrate to Lichess that this works and is worth integrating. I wish I had an idea because this project is interesting, but I do not know.

miguel-ambrona commented 3 years ago

I have added 30000 tests examples. It seems that your GitHub action is working correctly! Is there a way to avoid downloading Stockfish (in the action execution) every time I make a commit? Also, it would be nice that the action is only executed if I change the code, but not if I change the README.md or other parts.

ddugovic commented 3 years ago

Is there a way? Yes, although I do not yet understand it: https://docs.github.com/en/free-pro-team@latest/actions/guides/caching-dependencies-to-speed-up-workflows https://github.com/actions/cache