Skip to content

Commit

Permalink
Merge branch 'fairy-stockfish:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
RainRat authored Dec 28, 2024
2 parents d87956e + ed0933b commit 23c6942
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 16 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Keep GitHub Actions up to date with GitHub's Dependabot...
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
version: 2
updates:
- package-ecosystem: github-actions
directory: /
groups:
github-actions:
patterns:
- "*" # Group all Actions updates into a single larger pull request
schedule:
interval: weekly
2 changes: 1 addition & 1 deletion .github/workflows/fairy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run:
working-directory: src
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ffishjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ jobs:
node-version: [12.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup cache
id: cache-system-libraries
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{env.EM_CACHE_FOLDER}}
key: emsdk-${{env.EM_VERSION}}-${{ runner.os }}
- uses: mymindstorm/setup-emsdk@v7
- uses: mymindstorm/setup-emsdk@v14
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Build ffishjs
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
runs-on: windows-2022

steps:
- uses: al-cheb/configure-pagefile-action@v1.2
- uses: al-cheb/configure-pagefile-action@v1.4
with:
minimum-size: 16GB
maximum-size: 16GB
disk-root: "C:"

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: make
run: cd src && make clean && make -j build COMP=mingw ARCH=${{ matrix.arch }} EXE=fairy-stockfish_${{ matrix.arch }}.exe && strip fairy-stockfish_${{ matrix.arch }}.exe
Expand All @@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: make
run: cd src && make clean && make -j build COMP=gcc ARCH=${{ matrix.arch }} EXE=fairy-stockfish_${{ matrix.arch }} && strip fairy-stockfish_${{ matrix.arch }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stockfish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run:
working-directory: src
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-12]
os: [ubuntu-20.04, windows-2019, macos-13]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Used to host cibuildwheel
- uses: actions/setup-python@v3
Expand All @@ -43,15 +43,15 @@ jobs:
name: Build source distribution
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v3
with:
python-version: '3.8'

- name: Build sdist
run: python setup.py sdist

- uses: actions/upload-artifact@v3.0.0
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/*.tar.gz
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

CLASSIFIERS = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"License :: OSI Approved :: GNU General Public License v3 or later (GPL-3.0-or-later)",
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
Expand Down
4 changes: 2 additions & 2 deletions src/position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,14 +438,14 @@ Position& Position::set(const Variant* v, const string& fenStr, bool isChess960,
// 2)
// a) side to move have a pawn threatening epSquare
// b) there is an enemy pawn one or two (for triple steps) squares in front of epSquare
// c) there is no piece on epSquare or behind epSquare
// c) there is no (non-wall) piece on epSquare or behind epSquare
if ( (var->enPassantRegion & epSquare)
&& ( !var->fastAttacks
|| (var->enPassantTypes[sideToMove] & ~piece_set(PAWN))
|| ( pawn_attacks_bb(~sideToMove, epSquare) & pieces(sideToMove, PAWN)
&& ( (pieces(~sideToMove, PAWN) & (epSquare + pawn_push(~sideToMove)))
|| (pieces(~sideToMove, PAWN) & (epSquare + 2 * pawn_push(~sideToMove))))
&& !(pieces() & (epSquare | (epSquare + pawn_push(sideToMove)))))))
&& !((pieces(WHITE) | pieces(BLACK)) & (epSquare | (epSquare + pawn_push(sideToMove)))))))
st->epSquares |= epSquare;
}
}
Expand Down
5 changes: 5 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,11 @@ def test_get_fen(self):
result = sf.get_fen("pocketknight", "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR[Nn] w KQkq - 0 1", ["N@e4"])
self.assertEqual(result, "rnbqkbnr/pppppppp/8/8/4N3/8/PPPPPPPP/RNBQKBNR[n] b KQkq - 0 1")

# duck chess en passant
fen = "r1b1k3/pp3pb1/4p3/2p2p2/2PpP2q/1P1P1P2/P1K1*3/RN1Q2N1 b q e3 0 17"
result = sf.get_fen("duck", fen, [])
self.assertEqual(result, fen)

# SFEN
result = sf.get_fen("shogi", SHOGI, [], False, True)
self.assertEqual(result, SHOGI_SFEN)
Expand Down

0 comments on commit 23c6942

Please sign in to comment.