Giter Club home page Giter Club logo

smallbrain's Introduction

smallbrain's People

Contributors

disservin avatar joergoster avatar robertnurnberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

smallbrain's Issues

error: no matching function for call

timemanager.cpp:14:71: error: no matching function for call to 'clamp(int64_t&, long long int, int64_t)'
14 | time.optimum = std::clamp(time.optimum, 1LL, avaiableTime / 20);

NNUE File Size Is Too Low

Hi @Disservin , The size of Small-brain NN is about 1MB but size of Stockfish NN is about 70MB.

It is 70x bigger than your network , What is the difference between this 2 networks structure?

error: no matching function for call

search.cpp: In member function 'int Search::iterative_deepening(int, Time)':
search.cpp:379:51: error: no matching function for call to 'min(long long int, int64_t&)'
379 | searchTime = std::min(50LL, searchTime);

Changing in this way......

searchTime = std::min(50L, searchTime);

or

searchTime = std::min(long(50), searchTime);

board.cpp issue on ndk compiler

[arm64-v8a] Compile++ : Smallbrain <= benchmark.cpp
WARNING: linker: /data/data/com.termux/files/home/android-ndk-r24/toolchains/llvm/prebuilt/linux-aarch64/bin/clang-14: unsupported flags DT_FLAGS_1=0x8000001
[arm64-v8a] Compile++ : Smallbrain <= board.cpp
WARNING: linker: /data/data/com.termux/files/home/android-ndk-r24/toolchains/llvm/prebuilt/linux-aarch64/bin/clang-14: unsupported flags DT_FLAGS_1=0x8000001
/data/data/com.termux/files/home/Smallbrain/jni/../src/board.cpp:267:30: warning: unused parameter 'draw' [-Wunused-parameter]
bool Board::isRepetition(int draw) {

/data/data/com.termux/files/home/Smallbrain/jni/../src/board.cpp:486:12: fatal error: out-of-line definition of 'PawnPushSingle' does not match any declaration in 'Board'
U64 Board::PawnPushSingle(const Color& c, const Square& sq) {
^~~~~~~~~~~~~~
1 warning and 1 error generated.
make: *** [/data/data/com.termux/files/home/android-ndk-r24/build/core/build-binary.mk:424: /data/data/com.termux/files/home/Smallbrain/obj/local/arm64-v8a/objs/Smallbrain/__/src/board.o] Error 1

Makefile

Please add on Makefile armv8 to compile in android version.
Thanks.

ld.lld error

"Gui Termux on Android"

`ld.lld: error: unable to find library -lgcov

clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:167: pgo] Error 1
`

Stack Corruption

./Smallbrain bench

Position: 1/50 r3k2r/2pb1ppp/2pp1q2/p7/1nP1B3/1P2P3/P2N1PPP/R2QK2R w KQkq a6 0 14
info depth 1 seldepth 0 score cp -51 nodes 39 nps 39000 time 0 pv e1g1
info depth 2 seldepth 2 score cp 6 nodes 312 nps 78000 time 3 pv a2a3 d7g4
info depth 3 seldepth 4 score cp 35 nodes 740 nps 92000 time 7 pv a2a3 d7g4 f2f3
info depth 4 seldepth 5 score cp 10 nodes 1975 nps 109000 time 17 pv a2a3 b4a6 e1g1 a6c5
info depth 5 seldepth 6 score cp 47 nodes 3032 nps 112000 time 26 pv a2a3 b4a6 e1g1 a6c5 b3b4
info depth 6 seldepth 7 score cp 47 nodes 5300 nps 117000 time 44 pv a2a3 b4a6 e1g1 a6c5 b3b4 c5e4
info depth 7 seldepth 7 score cp 47 nodes 7984 nps 122000 time 64 pv a2a3 b4a6 e1g1 a6c5 b3b4 c5e4 d2e4
bestmove a2a3
stack corruption detected
Aborted

unreal perft speed

hi @Disservin

unfortunately the authors of stockfish block me & I could not to continue my idea

The maximum perft speed at single core is about 20 million NPS

But in now stockfish version you see 99 million NPS , do is 99 million speed real ?

We know does not exist 99 million perft speed !!!

Unreal Peft Speed

Perft 6 leaf nodes: 119060324

===========================
Total time (ms) : 1192
Nodes searched  : 119060324
Nodes/second    : 99882822

Real Peft Speed

Perft 6 leaf nodes: 119060324

===========================
Total time (ms) : 6670
Nodes searched  : 119060324
Nodes/second    : 17850123

Loosing on time for TC 60/0:15

Hi, nice new engine, congrats!
Thus I forked it and compiled it on Android for Android (with GCC on Termux). Works fine, however one issue I have found:
When playing with Droidfish an engine game SmallBrain (all versions) VS itself at TC 60/0:15 the game always ends with losing on time of one instance which continues to calculate ♾️. For other TCs I didn't find any problems. No idea if the issue also exists on other OS. If only on Android, just forget it.

Makefile Problem

Your "Makefile" for NATIVE the engine crashing after stop analysis.

..this Makefile is working

_THIS := $(realpath $(dir $(abspath $(lastword $(MAKEFILE_LIST)))))

_ROOT := $(_THIS)

_VALFILE = $(_ROOT)/default.net

CC := g++

TARGET := smallbrain

uname_S := $(shell uname -s)

NATIVE = -march=native

SRCS := $(wildcard *.cpp)

OBJS := $(patsubst %.cpp,%.o,$(SRCS))

all: $(TARGET)

$(TARGET): $(OBJS)

$(CC) -o $@ $^

%.o:` %.cpp

$(CC) -c $(NATIVE) -DEVALFILE="$(EVALFILE)" -DNDEBUG -flto -O3 -std=c++20 -Wall $<

clean:

rm -rf $(TARGET)

.PHONY: all clean

Full name

Hello Max,

Can we know your full name to include in our database?

Gabor Szots, CCRL testing group

NN for the "4 Knights Position" ?

Some time ago i stumbled upon this position :

8/p5pp/1pk5/5p2/P1nn4/2NN3P/5PPK/8 w - - 0 1

4-knights-pos-white-move

White to move

Black is a pawn ahead and he can try to win ..
White must not try to win the game and he can make a draw in many ways .. Black should keep 1 pawn alive and try to promote it, without a pawn Black cannot win, even with 2 knights .. i know not many engines seem to know this fact about the game of chess, but Smallbrain (v7.0 NNUE) does.

it's really a magical position .. many times i let engines play from this position to see how they act - for that i use longer time controls about 10m .. zugzwang often occurs, threats to promote, sacrifices of a knight for two pawns, and more "mechanisms".

you may test this position, and train an NN for it ?
one that always draws with White and can always win with Black ..!?!
it's still unclear to me .. as a chessplayer myself i'm fascinated.

here's a game with Fortuna, an obscure engine i once found, it has no version number - is it a Fruit clone ? See https://github.com/visanalexandru/Fortuna .. i guess its ELO is about 2600, it's not CCRL listed.

[Event "engine vs engine"]
[Site "Holland @ https://lichess.org/Y5PBmTSA "]
[Date "2023.01.29"]
[Round "?"]
[White "Smallbrain v7.0 NNUE"]
[Black "Fortuna"]
[Result "1/2-1/2"]
[FEN "8/p5pp/1pk5/5p2/P1nn4/2NN3P/5PPK/8 w - - 0 1"]
[GameDuration "00:15:14"]
[PlyCount "39"]
[SetUp "1"]
[TimeControl "600+10"]

1. g4 {-3.30/32 37s} Nd6 {+1.19/13 40s} 2. gxf5 {-3.39/33 22s} N6xf5 {+1.23/13 38s} 3. Kg2 {-3.45/32 40s} h5 {+1.32/13 37s} 4. Kg1 {-2.90/29 22s} g5 {+1.36/12 36s} 5. f4 {-2.36/31 25s} gxf4 {+1.37/13 34s} 6. Nxf4 {-2.05/30 8.5s} h4 {+1.41/13 33s} 7. Ne4 {-1.75/29 17s} b5 {+1.84/13 32s} 8. axb5+ {-1.65/27 11s} Kxb5 {+1.85/15 31s} 9. Kf2 {-1.58/27 21s} a5 {+1.90/14 30s} 10. Ke1 {-1.51/26 17s} a4 {+2.19/13 29s} 11. Nc3+ {-0.24/28 12s} Kb4 {+3.24/14 28s} 12. Nxa4 {-0.24/34 9.5s} Kxa4 {+3.67/14 27s} 13. Kd2 {-0.24/37 8.6s} Kb4 {+3.67/14 26s} 14. Kd3 {-0.24/38 13s} Kc5 {+3.62/16 25s} 15. Ng6 {-0.24/39 15s} Ne6 {+3.68/16 25s} 16. Ke4 {-0.24/42 8.4s} Nfd4 {+3.66/15 24s} 17. Ke5 {0.00/32 8.8s} Ng5 {+3.68/15 23s} 18. Nxh4 {0.00/39 41s} Nxh3 {+3.75/15 23s} 19. Nf5 {0.00/35 15s} Nxf5 {+4.05/15 22s} 20. Kxf5 {0.00/119 0.86s, Draw by insufficient mating material} 1/2-1/2

smallbrain-vs-fortuna

Naming

Hi Max,

The engine displays Smallbrain dev-20230129-f1192fb as its version, that might cause confusion. Version 6.0 had 6.0 in its name, maybe you could do that with version 7.0 as well?

Gabor Szots
CCRL testing group

Naming

I suggest giving a different name to different exe versions. It may create confusion if all are called smallbrain.exe.

Pgo for Clang

Can you please make a pgo for clang?
Pgo on makefile not working on clang.
Thanx for the advanced.

use NNUE file

hi, thanks for the new v7.0 NNUE .. the compilation on Linux went well and it runs fine in CuteChess .. i copied your NNUE file into the same folder, but i'm not sure if that's needed .. the README is unclear : your binary is about 3.2 Mb in size and i guess the data of the nnue file could easily be embedded, but the UCI options show the nnue file name, as if another nnue can also be used ? And if the value is left empty, will it play without NNUE ?

$ ./smallbrain_v7.0_compiled_HP 
uci
id name Smallbrain dev-20230129-f1192fb
id author Disservin

option name Hash type spin default 16 min 1 max 57344
option name EvalFile type string default nn-dfb6dafd17fab88-380.nnue
option name Threads type spin default 1 min 1 max 256
option name SyzygyPath type string default <empty>
option name UCI_Chess960 type check default false
uciok

Cannot Solved Puzzle

#Puzzle 1
8/1N6/3B4/8/8/1K2k3/8/8 w - - 0 1

#Puzzle 2
8/8/8/1B6/6p1/8/4KPpp/3N2kr w - - 0 1

#Puzzle 3
8/3P3k/n2K3p/2p3n1/1b4N1/2p1p1P1/8/3B4 w - - 0 1

Undeclared Identifier

/data/data/com.termux/files/home/Smallbrain/jni/../src/board.cpp:448:37: fatal error: use of undeclared identifier 'DEFAULT_CHECKMASK'
checkMask = newMask ? newMask : DEFAULT_CHECKMASK;
^
1 warning and 1 error generated.
make: *** [/data/data/com.termux/files/home/android-ndk-r24/build/core/build-binary.mk:424: /data/data/com.termux/files/home/Smallbrain/obj/local/arm64-v8a/objs/Smallbrain/__/src/board.o] Error 1

Supervised Learning

Can you add supervised learning that chess engine generate its own supervised learning on bin format same as chess-cli ? See -sample on (github.com/lucasart/c-chess-cli)

Self play

How to train chess engine using pgn instead of book?

NPS between 3.0 and 4.0 compilations [Question]

Hi Max,

Just a little question for verification I did not break something for my compilations.

For my old hardware nps from start pos (go depth 17 e.g.) between 3.0 and 4.0 compilations
went down from around 1Mns to 700Kns, ofc time to depth is much better now and much less
nodes are searched. So I guess this is expected from the changes?

id name Smallbrain Version 3.0
...
info depth 17 seldepth 24 score cp 46 nodes 25942018 nps 1018000 time 25481 pv e2e4 e7e5 g1f3 b8c6 f1b5 a7a6 b5c6 d7c6 b1c3 f7f6 d2d4 c8g4 d4e5 d8d1 c3d1 g4f3 g2f3 f6e5
bestmove e2e4

id name Smallbrain Version 4.0
...
info depth 17 seldepth 22 score cp 49 nodes 6763612 nps 701000 time 9646 pv e2e4 c7c5 c2c3 g8f6 e4e5 f6d5 g1f3 b8c6 f1b5 a7a6 b5c6 d7c6 e1g1 g7g6 f1e1 f8g7 d2d3
bestmove e2e4

Incredible the further nodes reduction to current dev ;-)

id name Smallbrain Version 4.2dev r230

info depth 17 seldepth 22 score cp 51 nodes 1061907 nps 670000 time 1583 pv e2e4 e7e6 g1f3 d7d5 e4d5 e6d5 d2d4 g8f6 f1d3 c7c5 e1g1 b8c6 f1e1 f8e7 d4c5 e8g8 c1e3 d5d4
bestmove e2e4

Guenther

Engine Analysis

Not showing chess engine thinking during search, and not run on analyze mode.

Smallbrain Rename

I thought about renaming my engine since the name has grown out of touch and I dont really like it anymore.
Opions, ideas?

I thought about Ancient or Noble
I am happy about suggestions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.