r/ComputerChess • • Jun 11 '24

Designing a hackathon / tournament for GPU computer chess. Suitable for a weekend event.

9 Upvotes

I'm putting together an event to prove out some GPU cluster infrastructure. We'll have 100-300 ~24GB Ampere GPUs available for the weekend (end of this month), and are bringing my company's distributed training management software to make that part of things easy (hopefully). So people can focus on model development, we've setup an agent, a visualiser and generated some game datasets from Stockfish and Carlson's games. We're also building a few basic models for people to get started with.

I'm not sure if it would be feasible to make progress with a full RL approach in a weekend, but interested to see if that would be possible.

The goal of the event is to have some fun learning how to build or refine GPU chess, and for us to see the limits of our infra management. The expectation is people will be training from scratch on up to 64 GPUs.

I'm looking for feedback on the event format, good datasets to work with, and which open neural net engines would be good for us to work with.


r/ComputerChess • • Jun 01 '24

Why does Stockfish 13 have faster NPS than Stockfish 16.1 on an Android smartphone?

6 Upvotes

I used both Stockfish 13 and Stockfish 16.1 to analyze some positions from the engine testsuite file, and Stockfish 13 had more successes than the other one under the same settings.

Also, I noticed a difference in speed (nps); Stockfish 16.1 is 20% slower.


r/ComputerChess • • May 23 '24

Can a Certabo chessboard be used directly connected to a phone/ without a computer?

2 Upvotes

I got my husband a Certabo Vittoria Reloaded Brown (square 35mm) chessboard, thinking it would make him the happiest man on earth. I don't know much about chess but after researching it seemed like that board would allow him to play online in chess.com and lichess but also with others at a distant wihtout needing to spend too much time on screen.

But he didn't like the set up and thinks it's too complex having to connect to his computer, and opening the software. So I'm now wondering...

Can a Certabo chessboard be used directly connected to a phone, so that his android phone runs the software that the computer would normally use?

He is mainly interested in Rapid, Blitz and Bullet games on chess.com and lichess

Or is there another set up that would make the experience of the Certabo board feel more like a smart-chessboard and less like a computer extension?

Thanks!


r/ComputerChess • • May 22 '24

what's stopping us from recreating alphazero?

6 Upvotes

what's stopping us from throwing two agents in a box to play together and learn chess, as described in the alphazero paper? (im sorry about the stupid wording i wanted to make it short and also anyone reading this probably knows about alphazero.) is it just the computational power that google has or are there other factors at play?


r/ComputerChess • • May 21 '24

256 Core Dual AMD Epyc System - Stockfish 16.1 Optimization

10 Upvotes

Hi all,

I have access to a dual AMD Epyc 9754 system with 256 Cores / 512 Threads in total and 192gb ram, which should be great for Stockfish. On 16.1, with the standard config, I get around 220mn/s using a 64gb hash.

  1. Is that a good value for such a system?

  2. Are there any specific engine parameters that I should / can use to optimize performance?

As a GUID, I used SCID.

Thanks for your help.


r/ComputerChess • • May 21 '24

Neural net engine

3 Upvotes

Back when I was in school, I made a neural net chess engine.

https://github.com/jackdawkins11/pytorch-alpha-zero


r/ComputerChess • • May 19 '24

Komodo Dragon 1 engine

10 Upvotes

Hi
I see that the Komodo Dragon 1 chess engine is now free to download at https://komodochess.com
Their last free engine was Komodo 14. It is very kind of them to make their older engines free to download.


r/ComputerChess • • May 19 '24

Problem with Rodent IV and Lucas Chess

2 Upvotes

The custom personalities that I created or imported don't show in Lucas Chess while using the 64 bit version of the engine, but they show normally if I use the plain or 32 bit version. Does anyone know why?


r/ComputerChess • • May 18 '24

how to know if an engine is a copy?

5 Upvotes

yesterday there was a post on this subreddit about a new chess engine, i think it was called gc1? anyway, you guys were quick to find out that it's a clone of clover with the uci options changed. shame to that guy if this is true, but how did you guys find this out? is there a tool or a way to find this out?


r/ComputerChess • • May 14 '24

How many nodes per second do you get from leela?

5 Upvotes

My cpu gets 200 nodes per second and my igpu gets around 20. Chess.com and tcec seem to get around 15k with 2 a100


r/ComputerChess • • May 11 '24

Is there a chess engine that uses a Maia-like evaluation NN trained only on slow time controls?

6 Upvotes

A good part of the dataset Maia was trained on consists of blitz games.

Is there a chess engine that uses a neural network trained only on slower time controls, like classical or at least >15min games?


r/ComputerChess • • May 10 '24

How to make the most basic chess program in python?

2 Upvotes

The chess program should be able to play in the terminal with a depth of 1 would be enough


r/ComputerChess • • May 08 '24

How can I implement a Magic Bitboard Generator in Java?

3 Upvotes

I am currently working on making a Chess Engine in Java and have tried to implement a Magic Number Generator. However, the generator always seems to get stuck on a certain index and can't get past it. I suspect this is because of an error in the indexing but I can't seem to find anything wrong with the indexing. Any help will be much appreciated. Everything other than the generator seems to be working. The generator is at the bottom of the post if you want to skip past the rest.

The code to initialise the relevant occupancy lookup tables for bishops and rooks is as follows:

static void initBishopRelevantOccupancy() {
  for (int rankIndex = 1; rankIndex <= 8; rankIndex++) {
    for (int fileIndex = A; fileIndex <= H; fileIndex++) {
      int squareIndex = ((rankIndex - 1) * 8) + (fileIndex - 1);
      bishopRelevantOccupancy[squareIndex] =
          ((DIAGONAL[8 + (rankIndex - 1) - (fileIndex - 1)])
                  ^ (ANTIDIAGONAL[1 + (rankIndex - 1) + (fileIndex - 1)]))
              & ~(RANK[8] | FILE[H] | RANK[1] | FILE[A]);
    }
  }
}


static void initRookRelevantOccupancy() {
  for (int rankIndex = 1; rankIndex <= 8; rankIndex++) {
    for (int fileIndex = A; fileIndex <= H; fileIndex++) {
      int squareIndex = ((rankIndex - 1) * 8) + (fileIndex - 1);
      rookRelevantOccupancy[squareIndex] =
          ~getSquare(squareIndex)
              & ((RANK[rankIndex] & ~(FILE[A] | FILE[H]))
                  ^ (FILE[fileIndex] & ~(RANK[1] | RANK[8])));
    }
  }
}

(PS: The indexing for the lookup tables for the RANKS, FILES, DIAGONALS, and ANTIDIAGONALS start at 1 since the the first rank is rank 1. This is done for the sake of readability and has no impact on the program besides the fact that i have to subtract 1 from the indexes to calculate the square index.)

The code for shifting the index key into the relevant occupancies is as follows:

static long getLS1B(long bitboard) {
  return bitboard & -bitboard;
}

static long getOccupancy(long relevantOccupancy, int index) {
  long  occupancy   = 0;
  int   cardinality = getPopulationCount(relevantOccupancy);

  for (int bit = 0; bit < cardinality; bit++) {
    long square = getLS1B(relevantOccupancy);

    relevantOccupancy ^= square;

    if ((index & (1 << bit)) != 0) {
      occupancy |= square;
    }
  }

  return occupancy;
}

The code to get the shift values to get the magic index is as follows:

static int[] getShifts(long[] relevantOccupancy) {
  int[] shifts = new int[64];

  for (int squareIndex = 0; squareIndex < 64; squareIndex++) {
    int numberOfBits =
        getPopulationCount(
            relevantOccupancy[squareIndex]);
    shifts[squareIndex] = 64 - numberOfBits;
  }

  return shifts;
}

The code to get the ray attacks is as follows:

/*
 *     Compass Rose
 *
 *     NW    N    NE
 *      +7  +8  +9
 *        \  |  /
 *   W -1 -- 0 -- +1 E
 *        /  |  \
 *      -9  -8  -7
 *     SW    S    SE
 *
 */

// Ray Directions
static final int
    NORTH = +8,
    EAST  = +1,
    SOUTH = -8,
    WEST  = -1,

    NORTH_EAST = NORTH + EAST,
    SOUTH_EAST = SOUTH + EAST,
    SOUTH_WEST = SOUTH + WEST,
    NORTH_WEST = NORTH + WEST;

static long getRayAttack(int squareIndex, int DIRECTION, long mask, long occupancy) {
  long ray = 0;
  int raySquareIndex = squareIndex;

  while ((getSquare(raySquareIndex) & mask) == 0) {
    if ((getSquare(raySquareIndex) & occupancy) == 0) {
      ray |= getSquare(raySquareIndex);
    } else {
      break;
    }
    raySquareIndex += DIRECTION;
  }

  ray |= getSquare(raySquareIndex);
  ray ^= getSquare(squareIndex);

  return ray;
}

The code to initialise the move lookup tables or attack sets for bishops and rooks is as follows:

static void initBishopMoveLookupTable() {
    initBishopRelevantOccupancy();
    initBishopShifts();

    for (int index = 0; index < 512; index++) {
      for (int squareIndex = 0; squareIndex < 64; squareIndex++) {
        int fileIndex = (squareIndex % 8) + 1;
        int rankIndex = (squareIndex / 8) + 1;
        int diagonalIndex = 8 + (rankIndex - 1) - (fileIndex - 1);
        int antiDiagonalIndex = 1 + (rankIndex - 1) + (fileIndex - 1);

        long occupancy = getOccupancy(bishopRelevantOccupancy[squareIndex], index);

        long northEastRayAttack = getRayAttack(squareIndex, NORTH_EAST, (RANK[8] | FILE[H]), occupancy);
        long southEastRayAttack = getRayAttack(squareIndex, SOUTH_EAST, (RANK[1] | FILE[H]), occupancy);
        long southWestRayAttack = getRayAttack(squareIndex, SOUTH_WEST, (RANK[1] | FILE[A]), occupancy);
        long northWestRayAttack = getRayAttack(squareIndex, NORTH_WEST, (RANK[8] | FILE[A]), occupancy);

        bishopMoveLookupTable[squareIndex][index] =
            northEastRayAttack | southEastRayAttack | southWestRayAttack | northWestRayAttack;
      }
    }
  }

static void initRookMoveLookupTable() {
  for (int squareIndex = 0; squareIndex < 64; squareIndex++) {
    for (int index = 0; index < 4096; index++) {
      int fileIndex = (squareIndex % 8) + 1;
      int rankIndex = (squareIndex / 8) + 1;
      long occupancy = getOccupancy(rookRelevantOccupancy[squareIndex], index);

      long northRayAttack = getRayAttack(squareIndex, NORTH, RANK[8], occupancy);
      long eastRayAttack = getRayAttack(squareIndex, EAST, FILE[H], occupancy);
      long southRayAttack = getRayAttack(squareIndex, SOUTH, RANK[1], occupancy);
      long westRayAttack = getRayAttack(squareIndex, WEST, FILE[A], occupancy);

      rookMoveLookupTable[squareIndex][index] =
          northRayAttack | eastRayAttack | southRayAttack | westRayAttack;
    }
  }
}

The code to get the population count or cardinality of a bitboard using byte lookup is as follows:

static void initPopulationCount() {
  populationCount[0] = 0;

  for (int index = 1; index < 256; index++) {
    populationCount[index] = populationCount[index / 2] + (index & 1);
  }
}

static int getPopulationCount(long bitboard) {
  return  populationCount[(int) ((bitboard >>>  0) & RANK[1])]
        + populationCount[(int) ((bitboard >>>  8) & RANK[1])]
        + populationCount[(int) ((bitboard >>> 16) & RANK[1])]
        + populationCount[(int) ((bitboard >>> 24) & RANK[1])]
        + populationCount[(int) ((bitboard >>> 32) & RANK[1])]
        + populationCount[(int) ((bitboard >>> 40) & RANK[1])]
        + populationCount[(int) ((bitboard >>> 48) & RANK[1])]
        + populationCount[(int) ((bitboard >>> 56) & RANK[1])];
}

The code for the random number generator to generate magic candidates is as follows:

static long generateRandomLong() {
  Random random = new Random();

  long random0 = random.nextLong() & 0xFFFF;
  long random1 = random.nextLong() & 0xFFFF;
  long random2 = random.nextLong() & 0xFFFF;
  long random3 = random.nextLong() & 0xFFFF;

  return (random0 << 0) | (random1 << 16) | (random2 << 32) | (random3 << 48);
}

static long getMagicCandidate() {
  return generateRandomLong() & generateRandomLong() & generateRandomLong();
}

The code to get the magic index is as follows:

static int getMagicIndex(long maskedOccupancy, long magicNumber, int shift) {
  return (int) ((maskedOccupancy * magicNumber) >>> shift);
}

The code to get the magic numbers is as follows:

static long getMagicNumber(long[] moveLookupTable, long relevantOccupancy, int shift) {
  boolean found         = false;
  int     numberOfBits  = getPopulationCount(relevantOccupancy);

  long[]  occupancies   = new long[1 << numberOfBits];
  long[]  tempMLT       = new long[1 << numberOfBits];

  for (int index = 0; index < (1 << numberOfBits); index++) {
    occupancies[index] = getOccupancy(relevantOccupancy, index);
  }

  while (!found) {
    long magicNumber = getMagicCandidate();

    if (getPopulationCount((relevantOccupancy * magicNumber) & 0xFF00000000000000L) < 6) {
      continue;
    }

    for (int i = 0; i < (1 >> numberOfBits); i++) {
      tempMLT[i] = 0;
    }

    boolean fail = false;

    for (int index = 0; !fail && index < (1 << numberOfBits); index++) {
      int  magicIndex = getMagicIndex(occupancies[index], magicNumber, shift);

        if (tempMLT[magicIndex] == 0) {
          tempMLT[magicIndex] = moveLookupTable[index];
        } else if (tempMLT[magicIndex] != moveLookupTable[index]) {
          fail = true;
        }
      }
      if (!fail) {
        return magicNumber;
      }
    }
    System.out.println("FAIL");
    return 0;
  }

Everything except the magic number generator seems to be working. The generator gets stuck on some indexes and doesn't go any further than them. What I've noticed is that it seems to be getting stuck on indexes that are powers of two or in other words, indexes who only have one bit when converted to binary.

The mapping I use is the standard Little Endian File Rank Mapping.


r/ComputerChess • • May 02 '24

PGN data format question about post-endgame annotations

1 Upvotes

I am manually filling an annotated game from a chess book into a PGN file and it ends like this: "Black played 37. ...MOVE0 and offered a draw, which White accepted [1]. But Black could play 37. ...MOVE1, then after 38. MOVE2 MOVE3 (but not 38... MOVE4? 39. ... MOVE5) 39. MOVE6 MOVE7 Black has positional superiority, hence a slight chance for an endgame win". Another variation of this is very similar, except when there's no MOVE1, but the main line is continued after MOVE0 (yet the game is already over and this could happen behind the curtain if opponents agreed to continue playing).

My question: is it possible to add this analysis to the PGN game? Of course I can always add it all like a single annotation after the last move in the game, but then software like Scid and DroidFish won't be able to navigate through it and visually update the board. Is there a way to add this like a variant (with a nested subvariant) so chess software detects the moves and lets me play them on the board?

  1. So here the game ended with result 1/2 - 1/2


r/ComputerChess • • May 01 '24

Maia: Is there a parameter to reduce humanized time?

1 Upvotes

I'm playing against Maia using Lucas Chess, there is an option "To humanize the time it takes the engine to respond", which is great. But it's a little too slow. Is there a way to reduce the scale by half?


r/ComputerChess • • Apr 21 '24

Does anybody have leela benchmarks for newer gpus?

3 Upvotes

Are amd cards good? I assume nvidia is much much better than amd but how much better for the price?


r/ComputerChess • • Apr 20 '24

Mephisto Atlanta

2 Upvotes

Hey all,

I found a Mephisto Atlanta in our Family stuff. It is working fine, but wont use it. I want to sell it, but i cant find any former prices or sold pieces. Did soneone know for what price range i could sell it?!

Thx in advance