UCI Chess Engine written in C
  • C 91.3%
  • Shell 6.3%
  • C++ 1.3%
  • Makefile 1.1%
Find a file
Jay Honnold 3262851505
fix(nn): recognise __ARM_NEON so NEON builds on Linux aarch64 (#597)
Bench: 2811728

No functional changes

The SIMD dispatch in accumulator.h and evaluate.c guards the NEON path on
__ARM_NEON__, with trailing underscores. Apple's clang defines that, but on
Linux aarch64 neither GCC nor Clang does -- both define __ARM_NEON. Measured
on Graviton, Ubuntu 24.04:

    gcc 13.3.0    __ARM_NEON: 1   __ARM_NEON__: 0
    clang 18.1.3  __ARM_NEON: 1   __ARM_NEON__: 0

So every Linux ARM build silently falls through to the scalar #else in
accumulator.h (UNROLL 16, plain acc_t) with no error and no warning. Nothing
in the makefile catches it either: ARM64 auto-detection tests `uname -m`
against arm64, but Linux reports aarch64, so ARCH stays native and
-march=native compiles the scalar path.

Both spellings are now accepted, so Apple Silicon is unaffected and Linux
aarch64 gets the NEON path it already had code for.

Measured, one hour on AWS spot, single-threaded bench:

                        scalar      NEON     speedup
    Graviton 2 m6g     372,463   666,918      1.79x
    Graviton 4 c8g     688,474 1,425,825      2.07x

bench reports 2,811,728 nodes on x86-64 AVX-512, ARM scalar and ARM NEON
alike. Bench is a fixed-depth search, so an identical node count means the
search tree and therefore every evaluation matched -- the NEON path is
numerically correct, not merely faster.

At AWS spot prices this moves a Graviton 4 host from 37% worse value than a
Zen 4 host to 14% better, measured as aggregate nodes/sec per dollar-hour
with every core busy.

Claude-Session: https://claude.ai/code/session_01ARJC6rsP7wt21NLnY7yixS
2026-09-06 22:48:14 -05:00
.github/workflows Disable flakey mate-in-1 github test 2023-10-31 18:56:36 -07:00
docs/plans feat: support genfens for openbench 2026-08-29 12:19:23 -07:00
resources perf: speedups via packed fancy magics and FindNNZ in CReLU (#594) 2026-08-22 21:30:05 -07:00
src fix(nn): recognise __ARM_NEON so NEON builds on Linux aarch64 (#597) 2026-09-06 22:48:14 -05:00
tests Serve Berserk networks via S3. Improve Makefile (#520) 2023-10-31 18:38:05 -07:00
.clang-format Depth 1 Protections + Formatting 2023-01-10 21:13:00 -07:00
.gitignore Slight makefile tweak 2024-02-16 08:00:11 -07:00
.gitmodules Serve Berserk networks via S3. Improve Makefile (#520) 2023-10-31 18:38:05 -07:00
LICENSE Update network to berserk-3095fe6f8ce5.nn 2024-01-01 20:48:50 -07:00
README.md Fix Broken CCRL Links (#561) 2025-06-22 12:27:09 -07:00

AUR version

Berserk Chess Engine

Berserk

A UCI chess engine written in C. Feel free to challenge me on Lichess!

Strength

Rating Lists + Elo

Many websites use an Elo rating system to present relative skill amongst engines. Below is a list of many chess engine lists throughout the web (variance in Elo is due to different conditions for each list)

Tournaments/Events with Berserk

Functional Details

Board Representation and Move Generation

Evaluation

Building

git clone https://github.com/jhonnold/berserk && \
cd berserk/src && \
make pgo CC=clang && \
./berserk

Credit

This engine could not be written without some influence and they are...

Engine Influences

Additional Resources