1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00
Commit graph

62 commits

Author SHA1 Message Date
Joost VandeVondele
5514690f8e CI/CD: play games
this action plays games under fast-chess with a `debug=yes` compiled binary.

It checks for triggered asserts in the code, or generally for engine disconnects.

closes https://github.com/official-stockfish/Stockfish/pull/5403

No functional change
2024-06-23 11:35:50 +02:00
Joost VandeVondele
44cddbd962 Add matetrack to CI
verifies that all mate PVs printed for finished iterations (i.e. no lower or upper bounds),
are complete, i.e. of the expected length and ending in mate, and do not contain drawing
or illegal moves.

based on a set of 2000 positions and the code in https://github.com/vondele/matetrack

closes https://github.com/official-stockfish/Stockfish/pull/5390

No functional change
2024-06-15 12:06:45 +02:00
Disservin
fb18caae7a Update clang-format to version 18
clang-format-18 is available in ubuntu noble(24.04), if you are on
a version lower than that you can use the update script from llvm.
https://apt.llvm.org/

Windows users should be able to download and use clang-format from
their release builds https://github.com/llvm/llvm-project/releases
or get the latest from msys2
https://packages.msys2.org/package/mingw-w64-x86_64-clang.

macOS users can resort to "brew install clang-format".

closes https://github.com/official-stockfish/Stockfish/pull/5365

No functional change
2024-06-05 21:41:43 +02:00
Tomasz Sobczyk
a169c78b6d Improve performance on NUMA systems
Allow for NUMA memory replication for NNUE weights.  Bind threads to ensure execution on a specific NUMA node.

This patch introduces NUMA memory replication, currently only utilized for the NNUE weights. Along with it comes all machinery required to identify NUMA nodes and bind threads to specific processors/nodes. It also comes with small changes to Thread and ThreadPool to allow easier execution of custom functions on the designated thread. Old thread binding (WinProcGroup) machinery is removed because it's incompatible with this patch. Small changes to unrelated parts of the code were made to ensure correctness, like some classes being made unmovable, raw pointers replaced with unique_ptr. etc.

Windows 7 and Windows 10 is partially supported. Windows 11 is fully supported. Linux is fully supported, with explicit exclusion of Android. No additional dependencies.

-----------------

A new UCI option `NumaPolicy` is introduced. It can take the following values:
```
system - gathers NUMA node information from the system (lscpu or windows api), for each threads binds it to a single NUMA node
none - assumes there is 1 NUMA node, never binds threads
auto - this is the default value, depends on the number of set threads and NUMA nodes, will only enable binding on multinode systems and when the number of threads reaches a threshold (dependent on node size and count)
[[custom]] -
  // ':'-separated numa nodes
  // ','-separated cpu indices
  // supports "first-last" range syntax for cpu indices,
  for example '0-15,32-47:16-31,48-63'
```

Setting `NumaPolicy` forces recreation of the threads in the ThreadPool, which in turn forces the recreation of the TT.

The threads are distributed among NUMA nodes in a round-robin fashion based on fill percentage (i.e. it will strive to fill all NUMA nodes evenly). Threads are bound to NUMA nodes, not specific processors, because that's our only requirement and the OS can schedule them better.

Special care is made that maximum memory usage on systems that do not require memory replication stays as previously, that is, unnecessary copies are avoided.

On linux the process' processor affinity is respected. This means that if you for example use taskset to restrict Stockfish to a single NUMA node then the `system` and `auto` settings will only see a single NUMA node (more precisely, the processors included in the current affinity mask) and act accordingly.

-----------------

We can't ensure that a memory allocation takes place on a given NUMA node without using libnuma on linux, or using appropriate custom allocators on windows (https://learn.microsoft.com/en-us/windows/win32/memory/allocating-memory-from-a-numa-node), so to avoid complications the current implementation relies on first-touch policy. Due to this we also rely on the memory allocator to give us a new chunk of untouched memory from the system. This appears to work reliably on linux, but results may vary.

MacOS is not supported, because AFAIK it's not affected, and implementation would be problematic anyway.

Windows is supported since Windows 7 (https://learn.microsoft.com/en-us/windows/win32/api/processtopologyapi/nf-processtopologyapi-setthreadgroupaffinity). Until Windows 11/Server 2022 NUMA nodes are split such that they cannot span processor groups. This is because before Windows 11/Server 2022 it's not possible to set thread affinity spanning processor groups. The splitting is done manually in some cases (required after Windows 10 Build 20348). Since Windows 11/Server 2022 we can set affinites spanning processor group so this splitting is not done, so the behaviour is pretty much like on linux.

Linux is supported, **without** libnuma requirement. `lscpu` is expected.

-----------------

Passed 60+1 @ 256t 16000MB hash: https://tests.stockfishchess.org/tests/view/6654e443a86388d5e27db0d8
```
LLR: 2.95 (-2.94,2.94) <0.00,10.00>
Total: 278 W: 110 L: 29 D: 139
Ptnml(0-2): 0, 1, 56, 82, 0
```

Passed SMP STC: https://tests.stockfishchess.org/tests/view/6654fc74a86388d5e27db1cd
```
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 67152 W: 17354 L: 17177 D: 32621
Ptnml(0-2): 64, 7428, 18408, 7619, 57
```

Passed STC: https://tests.stockfishchess.org/tests/view/6654fb27a86388d5e27db15c
```
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 131648 W: 34155 L: 34045 D: 63448
Ptnml(0-2): 426, 13878, 37096, 14008, 416
```

fixes #5253
closes https://github.com/official-stockfish/Stockfish/pull/5285

No functional change
2024-05-28 18:34:15 +02:00
Disservin
56a9cc512e Move ALSR change to CI Workflow file
It makes more sense to not (potentially) change the developers alsr entropy setting to make the test run through. This should be an active choice even if the test then might fail locally for them.

closes https://github.com/official-stockfish/Stockfish/pull/5182

No functional change
2024-04-21 14:49:11 +02:00
Joost VandeVondele
1a8de45b8c Improve CI
the recent refactoring has shown some limitations of our testing, hence we add a couple of more tests including:
* expected mate score
* expected mated score
* expected in TB win score
* expected in TB loss score
* expected info line output
* expected info line output (wdl)

closes https://github.com/official-stockfish/Stockfish/pull/5181

No functional change
2024-04-21 14:46:01 +02:00
Disservin
de2244284b Remove COMPILER from Makefile
The same functionality is available by using COMPCXX and having another variable which does the same is just confusing.
There was only one mention on Stockfish Wiki about this which has been changed to COMPCXX.

closes https://github.com/official-stockfish/Stockfish/pull/5154

No functional change
2024-04-11 22:41:35 +02:00
Disservin
ec598b380d Improve prerelease creation workflow
In the last couple of months we sometimes saw duplicated prereleases uploaded to GitHub, possibly due to some racy behavior when concurrent jobs create a prerelease. This now creates an empty prerelease at the beginning of the CI and the binaries are later just attached to this one.

closes https://github.com/official-stockfish/Stockfish/pull/5144

No functional change
2024-03-29 13:13:07 +01:00
Disservin
0c22d5bb1a Update Actions to Node20
ensure our CI continues to run after Node16 is obsolote on github.

closes https://github.com/official-stockfish/Stockfish/pull/5074

No functional change
2024-03-03 15:09:46 +01:00
Disservin
c83c7f4e71 Make binaries executable again in CI
closes https://github.com/official-stockfish/Stockfish/pull/5072

No functional change
2024-03-03 15:07:32 +01:00
Disservin
21dff6c276 Update CI actions
- Update codeql to v3
- Switch from dev-drprasad to native github cli
- Update softprops/action-gh-release to node 20 commit

`thollander/actions-comment-pull-request` needs to
be bumped to node20 too, but the author hasnt done
so atm

closes https://github.com/official-stockfish/Stockfish/pull/5044

No functional change
2024-02-11 19:40:33 +01:00
Disservin
a20726eb0b Refactor the CI workflows
This refactors the CI workflows to group some
logic and makes sure that all (pre)release
binaries are actually tested.

The screenshot below shows the execution logic of
the reworked ci,
https://github.com/Disservin/Stockfish/actions/runs/7773581379.
You can also hover over the cards to see the
execution flow.

The `matrix.json` and `arm_matrix.json` define the
binaries which will be uploaded to GitHub.
Afterwards a matrix is created and each job
compiles a profile guided build for that arch and
uploads that as an artifact to GitHub. The
Binaries/ARM_Binaries workflow's are called when
the previous step has been completed, and uploads
all artifacts to the (pre)release.

This also fixes some indentations and renames the
workflows, see
https://github.com/official-stockfish/Stockfish/actions,
where every workflow is called `Stockfish` vs
https://github.com/Disservin/Stockfish/actions. It
also increases the parallel compilation used for
make from `-j2 to -j4`.

It now also prevents the prerelease action from
running on forks.

A test release can be viewed here
https://github.com/Disservin/Stockfish/releases.

closes https://github.com/official-stockfish/Stockfish/pull/5035

No functional change
2024-02-09 19:06:25 +01:00
Disservin
3cce4c4cf4 Add Apple Silicon Runners to CI
GitHub CI runners are available for macOS 14, these runners are using apple silicon chips (M1).
https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/

closes https://github.com/official-stockfish/Stockfish/pull/5025

No functional change
2024-02-03 16:55:10 +01:00
FauziAkram
833a2e2bc0 Cleanup comments
Tests used to derive some Elo worth comments:
https://tests.stockfishchess.org/tests/view/656a7f4e136acbc573555a31
https://tests.stockfishchess.org/tests/view/6585fb455457644dc984620f

closes https://github.com/official-stockfish/Stockfish/pull/4945

No functional change
2023-12-31 19:54:27 +01:00
Disservin
9fc064e872 Fix action deprecation warning for dev-drprasad
closes https://github.com/official-stockfish/Stockfish/pull/4914

No functional change
2023-12-14 18:43:02 +01:00
Disservin
dadff46986 Revert "Temporarily disable CI include checks"
This reverts commit 8f65953583.

closes https://github.com/official-stockfish/Stockfish/pull/4904

No functional change
2023-12-10 23:16:12 +01:00
ppigazzini
0ff2ea6549 Update GitHub workflows
- Use the latest version of the actions
- Use commit hash for actions from little providers
- Update Intel SDE to 9.27

closes https://github.com/official-stockfish/Stockfish/pull/4900

No functional change
2023-12-04 11:27:28 +01:00
Sebastian Buchwald
8f65953583 Temporarily disable CI include checks
The include checks currently fail because of broken LLVM nightly
packages: https://github.com/llvm/llvm-project/issues/73402.

closes https://github.com/official-stockfish/Stockfish/pull/4899

No functional change
2023-12-04 11:26:09 +01:00
Joost VandeVondele
d89217766b CI updates
- updates the SDE action to v2.2
- removes the linux x86-32 builds, which were almost unused,
  and the build process under SDE started failing recently,
  possibly related to glibc update (The futex facility returned an unexpected error code.)

closes https://github.com/official-stockfish/Stockfish/pull/4875

No functional change
2023-11-16 09:01:57 +01:00
Disservin
2d0237db3f add clang-format
This introduces clang-format to enforce a consistent code style for Stockfish.

Having a documented and consistent style across the code will make contributing easier
for new developers, and will make larger changes to the codebase easier to make.

To facilitate formatting, this PR includes a Makefile target (`make format`) to format the code,
this requires clang-format (version 17 currently) to be installed locally.

Installing clang-format is straightforward on most OS and distros
(e.g. with https://apt.llvm.org/, brew install clang-format, etc), as this is part of quite commonly
used suite of tools and compilers (llvm / clang).

Additionally, a CI action is present that will verify if the code requires formatting,
and comment on the PR as needed. Initially, correct formatting is not required, it will be
done by maintainers as part of the merge or in later commits, but obviously this is encouraged.

fixes https://github.com/official-stockfish/Stockfish/issues/3608
closes https://github.com/official-stockfish/Stockfish/pull/4790

Co-Authored-By: Joost VandeVondele <Joost.VandeVondele@gmail.com>
2023-10-22 16:06:27 +02:00
Sebastian Buchwald
952740b36c Let CI check C++ includes
The commit adds a CI workflow that uses the included-what-you-use (IWYU)
tool to check for missing or superfluous includes in .cpp files and
their corresponding .h files. This means that some .h files (especially
in the nnue folder) are not checked yet.

The CI setup looks like this:
- We build IWYU from source to include some yet unreleased fixes.
  This IWYU version targets LLVM 17. Thus, we get the latest release
  candidate of LLVM 17 from LLVM's nightly packages.
- The Makefile now has an analyze target that just build the object
  files (without linking)
- The CI uses the analyze target with the IWYU tool as compiler to
  analyze the compiled .cpp file and its corresponding .h file.
- If IWYU suggests a change the build fails (-Xiwyu --error).
- To avoid false positives we use LLVM's libc++ as standard library
- We have a custom mappings file that adds some mappings that are
  missing in IWYU's default mappings

We also had to add one IWYU pragma to prevent a false positive in
movegen.h.

https://github.com/official-stockfish/Stockfish/pull/4783

No functional change
2023-09-22 19:12:53 +02:00
Sebastian Buchwald
46a5cedc11 Cleanup git checkout actions
We now fetch only the current commit for jobs that don't need the git
history. For the Prerelease job, we don't checkout the code at all.

closes https://github.com/official-stockfish/Stockfish/pull/4779

No functional change
2023-09-11 22:15:22 +02:00
Disservin
4f7fe255c7 Simplify README
The UCI protocol is rather technical and has little value in our README. Instead
it should be explained in our wiki. "Contributing" is moved above "Compiling
Stockfish" to make it more prominent.

Also move the CONTRIBUTING.md into the root directory and include it in the
distributed artifacts/releases.

closes https://github.com/official-stockfish/Stockfish/pull/4766

No functional change
2023-09-03 08:40:08 +02:00
Joost VandeVondele
fe7353f702 Update links to fishtest
Fishtest has moved to https://github.com/official-stockfish/fishtest/

closes https://github.com/official-stockfish/Stockfish/pull/4758

No functional change
2023-08-22 10:53:49 +02:00
Disservin
a77a8448ff Add CONTRIBUTING.md
closes https://github.com/official-stockfish/Stockfish/pull/4741

No functional change
2023-08-16 21:24:54 +02:00
ppigazzini
796d9df643 Check compiler for docker builds in CI
closes https://github.com/official-stockfish/Stockfish/pull/4739

No functional change
2023-08-13 11:47:52 +02:00
Joost VandeVondele
4be94f41a6 Update sanitizer CI to ubuntu 22.04
might fix the tsan errors

closes https://github.com/official-stockfish/Stockfish/pull/4745

No functional change
2023-08-13 11:34:00 +02:00
ppigazzini
4c43e1e27c Add new CPU archs in CI Tests workflow
Add CPU archs: armv8-dotprod, riscv64 and ppc64le.
The last two archs are built using QEMU multiarch docker container.

References:
https://docs.docker.com/build/building/multi-platform/
https://github.com/docker/setup-buildx-action
https://github.com/docker/setup-qemu-action
https://github.com/tonistiigi/binfmt
https://stackoverflow.com/questions/72444103/what-does-running-the-multiarch-qemu-user-static-does-before-building-a-containe

closes https://github.com/official-stockfish/Stockfish/pull/4718

No functional change
2023-08-06 21:17:33 +02:00
Jorge
6abd0bd9fb Add CodeQL workflow
add CI tooling to detect security bugs.

closes https://github.com/official-stockfish/Stockfish/pull/4659

No functional change
2023-07-19 21:36:38 +02:00
Joost VandeVondele
34d0c1b527 Switch to macos 13 for CI
allows for building x86-64-avx2 and x86-64-bmi2 binaries for mac

install coreutils
show hardware capabilities as seen by the compilers
move some tests from sse41 to avx2 as platforms support it

closes https://github.com/official-stockfish/Stockfish/pull/4692

No functional change
2023-07-16 22:27:13 +02:00
Joost VandeVondele
d70a905ce3 Deprecate the x86-64-modern arch
Explicitly describe the architecture as deprecated,
it remains available as its current alias x86-64-sse41-popcnt

CPUs that support just this instruction set are now years old,
any few years old Intel or AMD CPU supports x86-64-avx2. However,
naming things 'modern' doesn't age well, so instead use explicit names.

Adjust CI accordingly. Wiki, fishtest, downloader done as well.

closes https://github.com/official-stockfish/Stockfish/pull/4691

No functional change.
2023-07-16 17:47:25 +02:00
Joost VandeVondele
e89469925d Remove some CI parts not yet working
downgrading compiler didn't work for windows build. Stick to gcc 13 for now.
Windows x86-32 not a 32bit binary, remove.

closes https://github.com/official-stockfish/Stockfish/pull/4685

No functional change
2023-07-16 15:13:24 +02:00
Joost VandeVondele
a3a91f3f9f Build and test more binaries in CI
use a fixed compiler on Linux and Windows (right now gcc 11).
build avxvnni on Windows (Linux needs updated core utils)
build x86-32 on Linux (Windows needs other mingw)
fix a Makefile issue where a failed PGOBENCH would not stop the build
reuse the WINE_PATH for SDE as we do for QEMU
use WINE_PATH variable also for the signature
verify the bench for each of the binaries
do not build x86-64-avx2 on macos

closes https://github.com/official-stockfish/Stockfish/pull/4682

No functional change
2023-07-15 09:15:16 +02:00
Joost VandeVondele
f5ab5832c6 Generate binaries for more advanced architectures
use intel's Software Development Emulator (SDE) in the actions that build the binaries.
This allows for building on Windows and Linux binaries for
- x86-64-avx512
- x86-64-vnni256
- x86-64-vnni512

(x86-64-avxvnni needs more recent gcc in the actions)

also build x86-64-avx2 on macos.

closes https://github.com/official-stockfish/Stockfish/pull/4679

No functional change
2023-07-13 08:21:17 +02:00
Joost VandeVondele
ee023d7fd7 Fix CI output
closes https://github.com/official-stockfish/Stockfish/pull/4669

No functional change
2023-07-11 22:53:15 +02:00
Joost VandeVondele
9ba24912c1 Add armv8-dotprod to CI binaries
also generate binaries for more recent Android hardware.

closes https://github.com/official-stockfish/Stockfish/pull/4663

No functional change
2023-07-06 23:03:16 +02:00
Joost VandeVondele
19e2a88504 Revise extract bench from git log in CI
order commits differently

closes https://github.com/official-stockfish/Stockfish/pull/4668

No functional change
2023-07-06 23:01:27 +02:00
ppigazzini
e87e103ca9 Remove leftover braces for if conditional in CI
closes https://github.com/official-stockfish/Stockfish/pull/4660

No functional change
2023-07-03 20:17:14 +02:00
ppigazzini
ca5d9a5ff0 Extract bench according to wiki instructions
- loop through the commits starting from the latest one
- read the bench value from the last match, if any, of the template
  in the commit body text

closes https://github.com/official-stockfish/Stockfish/pull/4627

No functional change
2023-07-03 19:07:06 +02:00
disservin
8634717c64 Add bmi2 to CI generated binaries
verify bench for avx2 and bmi2 as well

closes https://github.com/official-stockfish/Stockfish/pull/4658

No functional change
2023-07-03 18:17:20 +02:00
ppigazzini
9a2d50eccc Make posix and msys2 shells consistent in CI
In CI, it is typical for the process to halt immediately when an error
is encountered. However, with our `shell: bash {0}` configuration,
the process continues despite errors for posix shells.
This commit updates the behavior of posix and msys2 shells to ensure
consistency in terms of pipeline exit codes and stop conditions.
We adopt the most appropriate default behavior as recommended
by the GitHub documentation.

Update the code that searches for the bench value in the git log:
- to be compatible with the new shell settings
- to retry the value from the first line that contains
  only the template and spaces/tabs/newlines

see also

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
https://github.com/msys2/setup-msys2/blob/main/main.js

closes https://github.com/official-stockfish/Stockfish/pull/4653

No functional change
2023-07-02 10:32:36 +02:00
disservin
aec8fb3fde Fix failing CI of pull requests
adds a guard to prevent pull requests from trying to delete the previous pre-release

closing https://github.com/official-stockfish/Stockfish/pull/4631

No functional change.
2023-06-20 18:50:12 +02:00
disservin
a68a1c1154 create prereleases upon push to master
using github actions, create a prerelease for the latest commit to master.
As such a development version will be available on github, in addition to the latest release.

closes https://github.com/official-stockfish/Stockfish/pull/4622

No functional change
2023-06-20 08:55:54 +02:00
peregrineshahin
14bfec2a98 Consistent bench extraction with fishtest.
Consistent with recent fishtest commit c0d174396f

closes https://github.com/official-stockfish/Stockfish/pull/4619

No functional change
2023-06-14 18:34:57 +02:00
disservin
295f57829e Add binaries to releases with github actions
when a release is made with a tag matching sf_* the binaries will also be uploaded to the release as assets.

closes https://github.com/official-stockfish/Stockfish/pull/4596

No functional change.
2023-06-06 21:12:24 +02:00
disservin
5c589142ae Add wiki to artifacts
snapshot the wiki https://github.com/official-stockfish/stockfish/wiki as part of the artifacts generated.
This will allow future release to include the wiki pages as a form of documentation

closes https://github.com/official-stockfish/Stockfish/pull/4420

No functional change
2023-03-05 16:14:07 +01:00
ppigazzini
5fe1fa0210 GitHub Actions: install NDK once and clean up yaml
Use Ubuntu 22.04 as runner for NDK to avoid a qemu bug with `profile-build`

closes https://github.com/official-stockfish/Stockfish/pull/4280

No functional change
2022-12-12 08:17:52 +01:00
Joost VandeVondele
3a30b478d2 CI workflows, install git on windows
ensures the SF dev version is reported correctly

closes https://github.com/official-stockfish/Stockfish/pull/4272

No functional change
2022-12-09 22:58:22 +01:00
Joost VandeVondele
aedf0251e6 CI workflows, install git on windows
ensures the SF dev version is reported correctly

No functional change
2022-12-09 17:56:55 +01:00
ppigazzini
aa603cfeeb GitHub Action: upload ARM artifacts
And some clean up in other files.

closes https://github.com/official-stockfish/Stockfish/pull/4269

No functional change
2022-12-09 16:54:43 +01:00