Giter VIP home page Giter VIP logo

amoeba's Introduction

amoeba

an UCI chess engine in D language

How to use it

Amoeba is a bare chess engine designed to communicate with a chess GUI (like xboard/winboard, arena, ...) via the UCI protocol. For example, xboard -fcp amoeba -fd installation directory -fUCI with:

  • amoeba the name of the executable
  • installation directory the directory where is the executable

About the program

When I wrote this chess engine, I tried to stay as close as possible to the published algorithms. I hope my code to be easy to read & understand.

  • algorithms used for move generation (board.d)

    • bitboard / mailbox board representation;
    • hyperbola quintessence;
    • stage move generation
  • algorithms used in search (search.d)

    • transposition table;
    • principal variation search;
    • quiescence search;
    • late move reduction (LMR);
    • in check extension;
    • null move;
    • frontier node pruning & razoring;
    • delta pruning in quiescence search;
    • internal iterative deepending (IID);
    • aspiration window;
    • iterative deepening;
    • static exchange evaluation (see) - iterative version;
    • singular move extension
    • probcut
  • algorithms used in evaluation

    • tuned weights with the "Nelder-Mead simplex method", aka amoeba (so the name of the program);
    • lazy evaluation using material + positional + tempo data;
    • full evaluation using various mobility scores & pawn structures in addition to the lazy evaluation; So, the chess knowledge is still very basic and could be improved significantly.
  • algorithm tried but discarded:

    • enhanced transposition cutoff (ETC);
    • ...

amoeba's People

Contributors

abulmo avatar dejlek 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amoeba's Issues

EXE files in release only

EXE files should not be in the repository with the source, usually we put it in "release" section.

Thank you.

ChessGui

From version 2.2, amoeba does not communicate with ChessGui under Windows, nor with Cutechess-cli under linux. It seems to work well with some GUI (Arena, xboard).

Crashes gdc, ldc2 needs -fPIC?

Hi, not much of a D guy here, but I can't build on Ubuntu 16.10 with the repo compilers, gdc simply segfaults (I was very impressed by that!), while ldc:

ldc2 -O3 -release -boundscheck=off -singleobj -w -dw amoeba.d util.d board.d eval.d kpk.d move.d search.d uci.d weight.d
/usr/bin/ld: amoeba.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Error: /usr/bin/gcc failed with status: 1
Makefile:79: recipe for target 'build' failed

I couldn't build even without the "fast" target, is there any obvious fix here?

Thanks!

Amoeba suddenly plays bad move

while testing in CuteChess, Amoeba v3.3.1 (which i compiled on Linux 64 bit) plays a strange move which lost a piece :

amoeba_strange_move

Rd1 after 6.3 seconds ?! What happened ? In 1 other game Amoeba had the same issue, suddenly giving a Rook ..

Windows

May you compile a Windows version too, please?

Thanx,
Alex

postmortem freezes when -H option is in use

First I want to say that postmortem is an amazing tool! Thanks!
I wanted to give it a larger hash size (between 16 and 24 G) as my workstation has plenty of RAM, but then it runs forever... Without the -H it works fine.

lastBit not being set correctly for GDC?

Just wondering if this bit of code in util.d is correct?

/* Get the first bit set */
version (LDC) int firstBit(ulong b) {return cast (int) llvm_cttz(b, true);}
else version (GDC) alias firstBit = __builtin_ctz;
else alias firstBit = bsf;

/* Get the last bit set */
version (GDC) alias firstBit = __builtin_clz;
else alias lastBit = bsr;

The second to last line resets firstBit and doesn't actually set lastBit for GDC. Seems off to me :)

May not affect much as it seems to only be used to resize tables, but it may affect accuracy, if used in the future I suppose.

compile error on Linux

i'm on Xubuntu 20.04.2 and i have this error :

$ make
ldc2 -singleobj -w -dw -mcpu=native -dip25 -preview=intpromote -O -release -boundscheck=off -flto=full --frame-pointer=none -d-version=withPopCount -mattr=+sse4.2,+popcnt amoeba.d board.d eval.d kpk.d move.d search.d tt.d uci.d util.d weight.d
Intrinsic name not mangled correctly for type arguments! Should be: llvm.prefetch.p0i8
void (i8*, i32, i32, i32)* @llvm.prefetch
in function _D4util8prefetchFPvZv
LLVM ERROR: Broken function found, compilation aborted!
make: *** [Makefile:89: amoeba] Error 1

When searching for Black moves amoeba gives positive evaluation when other engines report negative.

Not sure this is a bug or not, but I have noticed slight difference at how amoeba reports evaluation compared to Stockfish and Fire (Anscacs for an example behaves like Amoeba - it gives positive evaluations).

When you do MultiPV of say 4 and position startpos moves g2g4 for an example, amoeba gives positive evaluation of typically 70+ centipawns. However, the abovementioned engines will report -70+ centipawns.

Is this a potential bug or not?

Explain how to hook in to engine

Hi, I would like to use your engine to test different chess algorithm ideas I have.

Could you explain where are the key points to hook in to and what the algorithm needs to do?

The algorithm will most likely need to be ran before the built in algorithms and use it's own search space techniques.

I would like to replace the entire engine temporarily then eventually try to use it has a heuristic for my own algorithms. But I would like to use all the machinery you have developed(UCI, etc) to make it easier for me to develop. I would like to focus on the algorithm itself rather than learning the structure of the app(at this point).

e.g., how could I replace your engine with one that simply makes valid random moves? (or even invalid moves the valid move code in your engine cannot be used independently).

Thanks!

Compile errors on Raspberry Pi 3

I'm trying to compile Amoeba on Raspberry Pi 3 (running Raspbian Linux) using gdc. This is the command I'm using to compile:

amoeba-master/src $ gdc -o amoeba *.d

And this is the output -- only these three messages and no binary:

board.d:750: error: found '(' when expecting '.' following ulong
board.d:750: error: found ')' when expecting ';' following return statement
board.d:750: error: found '<<' instead of statement

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.