Skip to content

Commit

Permalink
Merge remote-tracking branch 'bookgen/master' into bookgen
Browse files Browse the repository at this point in the history
  • Loading branch information
ianfab committed Aug 27, 2023
2 parents 1391e65 + 5611138 commit 3b7d1a9
Show file tree
Hide file tree
Showing 59 changed files with 4,117 additions and 1,140 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# These are supported funding model platforms

github: ianfab
patreon: ianfab
custom: ['https://paypal.me/FairyStockfish']
16 changes: 15 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:
runs-on: windows-2022

steps:
- uses: al-cheb/[email protected]
with:
minimum-size: 16GB
maximum-size: 16GB
disk-root: "C:"

- uses: actions/checkout@v3

- name: make
Expand All @@ -22,6 +28,10 @@ jobs:
- name: make largeboards
run: cd src && make clean && make -j build COMP=mingw ARCH=${{ matrix.arch }} EXE=bookgen-largeboards_${{ matrix.arch }}.exe largeboards=yes && strip bookgen-largeboards_${{ matrix.arch }}.exe

- name: make all
if: ${{ matrix.arch == 'x86-64' }}
run: cd src && make clean && make -j build COMP=mingw ARCH=${{ matrix.arch }} EXE=fairy-stockfish-all_${{ matrix.arch }}.exe largeboards=yes all=yes && strip fairy-stockfish-all_${{ matrix.arch }}.exe

- uses: actions/upload-artifact@v3
with:
name: bookgen
Expand All @@ -42,7 +52,11 @@ jobs:
- name: make largeboards
run: cd src && make clean && make -j build COMP=gcc ARCH=${{ matrix.arch }} EXE=bookgen-largeboards_${{ matrix.arch }} largeboards=yes && strip bookgen-largeboards_${{ matrix.arch }}

- name: make all
if: ${{ matrix.arch == 'x86-64' }}
run: cd src && make clean && make -j build COMP=gcc ARCH=${{ matrix.arch }} EXE=fairy-stockfish-all_${{ matrix.arch }} largeboards=yes all=yes && strip fairy-stockfish-all_${{ matrix.arch }}

- uses: actions/upload-artifact@v3
with:
name: bookgen
path: src/bookgen*
path: src/bookgen*
4 changes: 2 additions & 2 deletions .github/workflows/stockfish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
matrix:
config:
- {
name: "Ubuntu 20.04 GCC",
os: ubuntu-20.04,
name: "Ubuntu 22.04 GCC",
os: ubuntu-22.04,
compiler: g++,
comp: gcc,
run_expensive_tests: true
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Wheels

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]

steps:
- uses: actions/checkout@v3

# Used to host cibuildwheel
- uses: actions/setup-python@v3

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.11.2

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
# to supply options, put them in 'env', like:
env:
MACOSX_DEPLOYMENT_TARGET: "10.14"
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_SKIP: "pp* *-win32 *-manylinux_i686 *-musllinux_* cp36-*"
CIBW_TEST_COMMAND: python {project}/test.py

- uses: actions/upload-artifact@v3
with:
name: dist
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.8'

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

- uses: actions/[email protected]
with:
name: dist
path: dist/*.tar.gz
10 changes: 10 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,23 @@ Fabian Fichter (ianfab)
# Contributors in alphabetical order
alwey
Belzedar94
cloudfish
CouchTomato87
Fulmene
gbtami
gnunicode
johndoknjas
kz04px
majormink
mtaktikos
QueensGambit
RainRat
rkb97
romstad
Snowmoondaphne
SriMethan
thearst3rd
TheYoBots
tttak
yoav-rozin
ydirson
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ The original `README.md` follows below.

Bookgen extends Fairy-Stockfish by the possibility of automatically generating opening books for all supported chess variants, including Chess, Xiangqi, Shogi, Crazyhouse, Antichess, Atomic, etc.

Several methods for generation and filtering of positions in FEN format are supported to adapt the book to specific requirements. The generation can be based on perft and multipv searches. The filtering supports a variety of options to define the criteria for evaluation of positions to be included. The output format is EPD. See the [Wiki](https://github.com/ianfab/bookgen/wiki) for documentation and usage examples.
Several methods for generation and filtering of positions in FEN format are supported to adapt the book to specific requirements. The generation can be based on perft and multipv searches. The filtering supports a variety of options to define the criteria for evaluation of positions to be included. The output format is EPD. See the [Wiki](https://github.com/fairy-stockfish/bookgen/wiki) for documentation and usage examples.

Built binaries for Windows and Linux can be downloaded from the [releases](https://github.com/ianfab/bookgen/releases). Development versions can be downloaded from the [release workflow](https://github.com/ianfab/bookgen/actions/workflows/release.yml) (requires logging in to github).
Built binaries for Windows and Linux can be downloaded from the [releases](https://github.com/fairy-stockfish/bookgen/releases). Development versions can be downloaded from the [release workflow](https://github.com/fairy-stockfish/bookgen/actions/workflows/release.yml) (requires logging in to github).

There are separate (older) versions based on specialized variant forks, such as [official Stockfish](https://github.com/ianfab/bookgen/tree/official-stockfish), [multi-variant Stockfish](https://github.com/ianfab/bookgen/tree/multivariant), [Seirawan-Stockfish](https://github.com/ianfab/bookgen/tree/seirawan), [Shatranj-Stockfish](https://github.com/ianfab/bookgen/tree/shatranj), and [Makruk-Stockfish](https://github.com/ianfab/bookgen/tree/makruk) that can be found on the respective branches, but the Fairy-Stockfish based version supports all of these variants as well.
Instead of downloading it, you can also use the [online book generator](https://bookgen-wasm.vercel.app) ([code](https://github.com/ianfab/bookgen-wasm)), which uses the [WebAssembly port](https://github.com/fairy-stockfish/fairy-stockfish.wasm/tree/bookgen).

Also see the [Fairy-Stockfish](https://github.com/ianfab/Fairy-Stockfish) repository for more info.
There are separate (older) versions based on specialized variant forks, such as [official Stockfish](https://github.com/fairy-stockfish/bookgen/tree/official-stockfish), [multi-variant Stockfish](https://github.com/fairy-stockfish/bookgen/tree/multivariant), [Seirawan-Stockfish](https://github.com/fairy-stockfish/bookgen/tree/seirawan), [Shatranj-Stockfish](https://github.com/fairy-stockfish/bookgen/tree/shatranj), and [Makruk-Stockfish](https://github.com/fairy-stockfish/bookgen/tree/makruk) that can be found on the respective branches, but the Fairy-Stockfish based version supports all of these variants as well.

Also see the [Fairy-Stockfish](https://github.com/fairy-stockfish/Fairy-Stockfish) repository for more info.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ before_build:
'add_compile_definitions(NNUE_EMBEDDING_OFF)',
'add_executable(stockfish ${source_files})'
# Write CMakeLists.txt withouth BOM
# Write CMakeLists.txt without BOM
$MyPath = (Get-Item -Path "." -Verbose).FullName + '\CMakeLists.txt'
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
[System.IO.File]::WriteAllLines($MyPath, $t, $Utf8NoBomEncoding)
Expand Down
52 changes: 0 additions & 52 deletions appveyor_python.yml

This file was deleted.

4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
else:
args = ["-std=c++17", "-flto", "-Wno-date-time"]

args.extend(["-DLARGEBOARDS", "-DPRECOMPUTED_MAGICS", "-DNNUE_EMBEDDING_OFF"])
args.extend(["-DLARGEBOARDS", "-DALLVARS", "-DPRECOMPUTED_MAGICS", "-DNNUE_EMBEDDING_OFF"])

if "64bit" in platform.architecture():
args.append("-DIS_64BIT")
Expand All @@ -39,7 +39,7 @@
sources=sources,
extra_compile_args=args)

setup(name="pyffish", version="0.0.71",
setup(name="pyffish", version="0.0.78",
description="Fairy-Stockfish Python wrapper",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ ifeq ($(nnue),no)
CXXFLAGS += -DNNUE_EMBEDDING_OFF
endif

# Enable all variants, even heavyweight ones like amazons
# Enable all variants, even heavyweight ones like duck and amazons
ifneq ($(all),no)
CXXFLAGS += -DALLVARS
endif
Expand Down Expand Up @@ -575,7 +575,7 @@ endif
ifeq ($(avx2),yes)
CXXFLAGS += -DUSE_AVX2
ifeq ($(comp),$(filter $(comp),gcc clang mingw))
CXXFLAGS += -mavx2
CXXFLAGS += -mavx2 -mbmi
endif
endif

Expand Down
8 changes: 7 additions & 1 deletion src/Makefile_js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ CXX=emcc
CXXFLAGS += --bind -DNNUE_EMBEDDING_OFF -DNO_THREADS -std=c++17 -Wall

largeboards = yes
all = yes
optimize = yes
debug = no

Expand All @@ -48,6 +49,11 @@ ifneq ($(largeboards),no)
CXXFLAGS += -DLARGEBOARDS -DPRECOMPUTED_MAGICS -s TOTAL_MEMORY=32MB -s ALLOW_MEMORY_GROWTH=1 -s WASM_MEM_MAX=1GB
endif

# Enable all variants, even heavyweight ones like duck and amazons
ifneq ($(all),no)
CXXFLAGS += -DALLVARS
endif

### Compile as ES6/ES2015 module
ifeq ($(es6),yes)
CXXFLAGS += -s ENVIRONMENT='web,worker' -s EXPORT_ES6=1 -s MODULARIZE=1 -s USE_ES6_IMPORT_META=0
Expand All @@ -72,7 +78,7 @@ help:
@echo ""

objclean:
@rm -f $(EXE) *.o ./syzygy/*.o ./nnue/*.o ./nnue/features/*.o
@rm -f $(EXE)

clean: objclean

Expand Down
Loading

0 comments on commit 3b7d1a9

Please sign in to comment.