Skip to content

Commit

Permalink
ShashChess 36
Browse files Browse the repository at this point in the history
Aligned with Stockfish 17.
Fixed mcts.
Fixed persisted learning and added the experience book option and an utility for reset (to be done for old experience files) and display content given a fen.
Extended livebook to LiChess in addition to ChessDB.
Removed opening variety and replaced with variety which is now a combo with three values:
-off the default
-standard without loss of elo
-psychological more risky because with elo loss, but not as significant, useful for inviting the engine to a game with psychological/human sacrifices, i.e., strictly speaking, incorrect, but almost impossible to refute.
  • Loading branch information
amchess committed Sep 19, 2024
1 parent ca34872 commit a7fa1d6
Show file tree
Hide file tree
Showing 160 changed files with 38,932 additions and 15,097 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ contact_links:
url: https://discord.gg/GWDRS3kU6R
about: Feel free to ask for support or have a chat with us on our Discord server!
- name: Discussions, Q&A, ideas, show us something...
url: https://github.com/official-stockfish/Stockfish/discussions/new
url: https://github.com/official-shashchess/ShashChess/discussions/new
about: Do you have an idea for ShashChess? Do you want to show something that you made? Please open a discussion about it!
1 change: 1 addition & 0 deletions .github/ci/libcxx17.imp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
{ include: [ "<__fwd/sstream.h>", private, "<iosfwd>", public ] },
{ include: [ "<__fwd/streambuf.h>", private, "<iosfwd>", public ] },
{ include: [ "<__fwd/string_view.h>", private, "<string_view>", public ] },
{ include: [ "<__system_error/errc.h>", private, "<system_error>", public ] },

# Mappings for includes between public headers
{ include: [ "<ios>", public, "<iostream>", public ] },
Expand Down
4 changes: 2 additions & 2 deletions .github/ci/matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"comp": "gcc",
"shell": "bash",
"archive_ext": "tar",
"sde": "/home/runner/work/Stockfish/Stockfish/.output/sde-temp-files/sde-external-9.27.0-2023-09-13-lin/sde -future --"
"sde": "/home/runner/work/ShashChess/ShashChess/.output/sde-temp-files/sde-external-9.27.0-2023-09-13-lin/sde -future --"
},
{
"name": "MacOS 13 Apple Clang",
Expand Down Expand Up @@ -38,7 +38,7 @@
"msys_env": "x86_64-gcc",
"shell": "msys2 {0}",
"ext": ".exe",
"sde": "/d/a/Stockfish/Stockfish/.output/sde-temp-files/sde-external-9.27.0-2023-09-13-win/sde.exe -future --",
"sde": "/d/a/ShashChess/ShashChess/.output/sde-temp-files/sde-external-9.27.0-2023-09-13-win/sde.exe -future --",
"archive_ext": "zip"
}
],
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/arm_compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: ${{ matrix.config.name }} ${{ matrix.binaries }}
runs-on: ${{ matrix.config.os }}
env:
COMPILER: ${{ matrix.config.compiler }}
COMPCXX: ${{ matrix.config.compiler }}
COMP: ${{ matrix.config.comp }}
EMU: ${{ matrix.config.emu }}
EXT: ${{ matrix.config.ext }}
Expand All @@ -26,6 +26,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Download required linux packages
if: runner.os == 'Linux'
Expand Down Expand Up @@ -62,7 +63,7 @@ jobs:
if [ $COMP == ndk ]; then
export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
fi
$COMPILER -v
$COMPCXX -v
- name: Test help target
run: make help
Expand All @@ -82,7 +83,7 @@ jobs:
make -j4 profile-build ARCH=$BINARY COMP=$COMP WINE_PATH=$EMU
make strip ARCH=$BINARY COMP=$COMP
WINE_PATH=$EMU ../tests/signature.sh $benchref
mv ./stockfish$EXT ../stockfish-android-$BINARY$EXT
mv ./shashchess$EXT ../shashchess-android-$BINARY$EXT
- name: Remove non src files
run: git clean -fx
Expand All @@ -91,4 +92,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.simple_name }} ${{ matrix.binaries }}
path: .
path: |
.
!.git
!.output
16 changes: 11 additions & 5 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
paths:
- "**.cpp"
- "**.h"

permissions:
pull-requests: write

jobs:
Clang-Format:
name: Clang-Format
Expand All @@ -25,27 +29,29 @@ jobs:
id: clang-format
continue-on-error: true
with:
clang-format-version: "17"
clang-format-version: "18"
exclude-regex: "incbin"

- name: Comment on PR
if: steps.clang-format.outcome == 'failure'
uses: thollander/actions-comment-pull-request@1d3973dc4b8e1399c0620d3f2b1aa5e795465308 # @v2.4.3
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # @v2.5.0
with:
message: |
clang-format 17 needs to be run on this PR.
clang-format 18 needs to be run on this PR.
If you do not have clang-format installed, the maintainer will run it when merging.
For the exact version please see https://packages.ubuntu.com/mantic/clang-format-17.
For the exact version please see https://packages.ubuntu.com/noble/clang-format-18.
_(execution **${{ github.run_id }}** / attempt **${{ github.run_attempt }}**)_
comment_tag: execution
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Comment on PR
if: steps.clang-format.outcome != 'failure'
uses: thollander/actions-comment-pull-request@1d3973dc4b8e1399c0620d3f2b1aa5e795465308 # @v2.4.3
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # @v2.5.0
with:
message: |
_(execution **${{ github.run_id }}** / attempt **${{ github.run_attempt }}**)_
create_if_not_exists: false
comment_tag: execution
mode: delete
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 4 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -48,6 +50,6 @@ jobs:
run: make -j build ARCH=x86-64-modern

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
15 changes: 10 additions & 5 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: ${{ matrix.config.name }} ${{ matrix.binaries }}
runs-on: ${{ matrix.config.os }}
env:
COMPILER: ${{ matrix.config.compiler }}
COMPCXX: ${{ matrix.config.compiler }}
COMP: ${{ matrix.config.comp }}
EXT: ${{ matrix.config.ext }}
NAME: ${{ matrix.config.simple_name }}
Expand All @@ -25,6 +25,8 @@ jobs:
shell: ${{ matrix.config.shell }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install fixed GCC on Linux
if: runner.os == 'Linux'
Expand All @@ -50,7 +52,7 @@ jobs:
run: make net

- name: Check compiler
run: $COMPILER -v
run: $COMPCXX -v

- name: Test help target
run: make help
Expand All @@ -59,7 +61,7 @@ jobs:
run: git --version

- name: Check compiler
run: $COMPILER -v
run: $COMPCXX -v

- name: Show g++ cpu info
if: runner.os != 'macOS'
Expand All @@ -77,7 +79,7 @@ jobs:
make -j4 profile-build ARCH=$BINARY COMP=$COMP WINE_PATH="$SDE"
make strip ARCH=$BINARY COMP=$COMP
WINE_PATH="$SDE" ../tests/signature.sh $benchref
mv ./stockfish$EXT ../stockfish-$NAME-$BINARY$EXT
mv ./shashchess$EXT ../shashchess-$NAME-$BINARY$EXT
- name: Remove non src files
run: git clean -fx
Expand All @@ -86,4 +88,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.simple_name }} ${{ matrix.binaries }}
path: .
path: |
.
!.git
!.output
43 changes: 43 additions & 0 deletions .github/workflows/games.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow will play games with a debug enabled SF using the PR

name: Games
on:
workflow_call:
jobs:
Matetrack:
name: Games
runs-on: ubuntu-22.04
steps:
- name: Checkout SF repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
path: ShashChess
persist-credentials: false

- name: build debug enabled version of SF
working-directory: ShashChess/src
run: make -j build debug=yes

- name: Checkout fast-chess repo
uses: actions/checkout@v4
with:
repository: Disservin/fast-chess
path: fast-chess
ref: d54af1910d5479c669dc731f1f54f9108a251951
persist-credentials: false

- name: fast-chess build
working-directory: fast-chess
run: make -j

- name: Run games
working-directory: fast-chess
run: |
./fast-chess -rounds 4 -games 2 -repeat -concurrency 4 -openings file=app/tests/data/openings.epd format=epd order=random -srand $RANDOM\
-engine name=sf1 cmd=/home/runner/work/ShashChess/ShashChess/ShashChess/src/shashchess\
-engine name=sf2 cmd=/home/runner/work/ShashChess/ShashChess/ShashChess/src/shashchess\
-ratinginterval 1 -report penta=true -each proto=uci tc=4+0.04 -log file=fast.log | tee fast.out
cat fast.log
! grep "Assertion" fast.log > /dev/null
! grep "disconnect" fast.out > /dev/null
10 changes: 6 additions & 4 deletions .github/workflows/iwyu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,22 @@ jobs:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: Stockfish/src
working-directory: ShashChess/src
shell: bash
steps:
- name: Checkout Stockfish
- name: Checkout ShashChess
uses: actions/checkout@v4
with:
path: Stockfish
path: ShashChess
persist-credentials: false

- name: Checkout include-what-you-use
uses: actions/checkout@v4
with:
repository: include-what-you-use/include-what-you-use
ref: f25caa280dc3277c4086ec345ad279a2463fea0f
path: include-what-you-use
persist-credentials: false

- name: Download required linux packages
run: |
Expand All @@ -44,4 +46,4 @@ jobs:
make analyze
COMP=clang
CXX=include-what-you-use
CXXFLAGS="-stdlib=libc++ -Xiwyu --comment_style=long -Xiwyu --mapping='${{ github.workspace }}/Stockfish/.github/ci/libcxx17.imp' -Xiwyu --error"
CXXFLAGS="-stdlib=libc++ -Xiwyu --comment_style=long -Xiwyu --mapping='${{ github.workspace }}/ShashChess/.github/ci/libcxx17.imp' -Xiwyu --error"
38 changes: 38 additions & 0 deletions .github/workflows/matetrack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will run matetrack on the PR

name: Matetrack
on:
workflow_call:
jobs:
Matetrack:
name: Matetrack
runs-on: ubuntu-22.04
steps:
- name: Checkout SF repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
path: ShashChess
persist-credentials: false

- name: build SF
working-directory: ShashChess/src
run: make -j profile-build

- name: Checkout matetrack repo
uses: actions/checkout@v4
with:
repository: vondele/matetrack
path: matetrack
ref: 20287a1a145f30a166b7ef251eddb611e4e44fbf
persist-credentials: false

- name: matetrack install deps
working-directory: matetrack
run: pip install -r requirements.txt

- name: Run matetrack
working-directory: matetrack
run: |
python matecheck.py --engine /home/runner/work/ShashChess/ShashChess/ShashChess/src/shashchess --epdFile mates2000.epd --nodes 100000 | tee matecheckout.out
! grep "issues were detected" matecheckout.out > /dev/null
17 changes: 15 additions & 2 deletions .github/workflows/sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
name: ${{ matrix.sanitizers.name }}
runs-on: ${{ matrix.config.os }}
env:
COMPILER: ${{ matrix.config.compiler }}
COMPCXX: ${{ matrix.config.compiler }}
COMP: ${{ matrix.config.comp }}
CXXFLAGS: "-Werror"
strategy:
Expand All @@ -31,12 +31,17 @@ jobs:
- name: Run under valgrind-thread
make_option: ""
instrumented_option: valgrind-thread
- name: Run non-instrumented
make_option: ""
instrumented_option: none
defaults:
run:
working-directory: src
shell: ${{ matrix.config.shell }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Download required linux packages
run: |
Expand All @@ -47,14 +52,22 @@ jobs:
run: make net

- name: Check compiler
run: $COMPILER -v
run: $COMPCXX -v

- name: Test help target
run: make help

- name: Check git
run: git --version

# Since Linux Kernel 6.5 we are getting false positives from the ci,
# lower the ALSR entropy to disable ALSR, which works as a temporary workaround.
# https://github.com/google/sanitizers/issues/1716
# https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2056762

- name: Lower ALSR entropy
run: sudo sysctl -w vm.mmap_rnd_bits=28

# Sanitizers

- name: ${{ matrix.sanitizers.name }}
Expand Down
Loading

0 comments on commit a7fa1d6

Please sign in to comment.