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

Missing Shatranj draw adjudication of K vs K #833

Open
gbtami opened this issue Oct 27, 2024 · 1 comment
Open

Missing Shatranj draw adjudication of K vs K #833

gbtami opened this issue Oct 27, 2024 · 1 comment

Comments

@gbtami
Copy link
Member

gbtami commented Oct 27, 2024

https://i.imgur.com/ZZP2LNv.png
If I add this two cases to test_game_result(), the first will be OK but the second fails.
K vs K should be adjudicated as draw.

        # shatranj bare king win
        result = sf.game_result("shatranj", "1k6/2R5/8/8/8/8/5r2/6K1 w - - 0 1", ["g1f2", "b8a8"])
        self.assertEqual(result, sf.VALUE_MATE)

        # shatranj double bare king draw
        result = sf.game_result("shatranj", "1k6/2R5/8/8/8/8/5r2/6K1 w - - 0 1", ["g1f2", "b8c7"])
        self.assertEqual(result, sf.VALUE_DRAW)

Result

======================================================================
FAIL: test_game_result (__main__.TestPyffish.test_game_result)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tamas/Fairy-Stockfish/test.py", line 1038, in test_game_result
    self.assertEqual(result, sf.VALUE_DRAW)
AssertionError: -32000 != 0

----------------------------------------------------------------------
Ran 20 tests in 1.215s

FAILED (failures=1)
@yjf2002ghty
Copy link
Contributor

This is the wrong configuration in variants.cpp for shatranj. It also happens for all other variants that sets the following parameters:

        v->extinctionValue = -VALUE_MATE;
        v->extinctionClaim = true;
        v->extinctionPieceTypes = piece_set(ALL_PIECES);
        v->extinctionPieceCount = 1;
        v->extinctionOpponentPieceCount = 2;

For example, courier also has this problem.

image

This means that when it's a player to move and that player only has 1 piece on board while the opponent has 2 pieces on board, that player loses. This rule probably nullifies the K vs K draw adjudication.

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

No branches or pull requests

2 participants