Introducing RuthChess 7.0 – Rust-Based Engine with New Ideas

Discussion of chess software programming and technical issues.

Moderator: Ras

ZirconiumX
Posts: 1359
Joined: Sun Jul 17, 2011 11:14 am
Full name: Hannah Ravensloft

Re: Introducing RuthChess 7.0 – Rust-Based Engine with New Ideas

Post by ZirconiumX »

EmreKalkan wrote: Thu Sep 11, 2025 7:02 pm
ZirconiumX wrote: Thu Sep 11, 2025 12:59 pm Ciekce and I decided to do some code auditing; I'll let him post his findings.

Here's one case I spotted immediately: you're using the PSTs from the Simplified Evaluation Function, which are listed in rank 8..1 order (as if from White's point of view on a chessboard), however you are using A1=0 indexing, so you are indexing the PSTs upside down.

I also could not find a perft function in your code, only a single test bench asserting that there are 20 generated moves in the start position. From that it's not obvious to me that your move generator is correct.
You re right about perfts. I dont have a test but I tested it manually many many times 6 months ago. I am still using same codes. I will add perfts too. I am alone at this project, Its awful. But I didnt understand very well PST problem. I checked my code everything looks fine. Can you explain more detaily.
Your PSTs look like this:

Code: Select all

const PAWN_MG: [i32; 64] = [
      0,   0,   0,   0,   0,   0,   0,   0,
     50,  50,  50,  50,  50,  50,  50,  50,
     10,  10,  20,  30,  30,  20,  10,  10,
      5,   5,  10,  25,  25,  10,   5,   5,
      0,   0,   0,  20,  20,   0,   0,   0,
      5,  -5, -10,   0,   0, -10,  -5,   5,
      5,  10,  10, -20, -20,  10,  10,   5,
      0,   0,   0,   0,   0,   0,   0,   0
];
This is as if you're looking at the chessboard from white's point of view, where A1 is at the bottom left of the array. But that mean the PST index for A1 is 56, not 0. To fix the index, you either xor by 56 for white, not black (as you currently do), or you change the PST to use A1=0 indexing, to look like this:

Code: Select all

const PAWN_MG: [i32; 64] = [
      0,   0,   0,   0,   0,   0,   0,   0,
      5,  10,  10, -20, -20,  10,  10,   5,
      5,  -5, -10,   0,   0, -10,  -5,   5,
      0,   0,   0,  20,  20,   0,   0,   0,
      5,   5,  10,  25,  25,  10,   5,   5,
     10,  10,  20,  30,  30,  20,  10,  10,
     50,  50,  50,  50,  50,  50,  50,  50,
      0,   0,   0,   0,   0,   0,   0,   0
];
tu ne cede malis, sed contra audentior ito
EmreKalkan
Posts: 7
Joined: Wed Sep 10, 2025 8:28 pm
Full name: M. Emre Kalkan

Re: Introducing RuthChess 7.0 – Rust-Based Engine with New Ideas

Post by EmreKalkan »

Sylwy wrote: Fri Sep 12, 2025 11:23 am
EmreKalkan wrote: Wed Sep 10, 2025 10:10 pm I have tested the engine using CuteChess, and I estimate its average ELO to be around 2480–2520.
The engine is innovative, but very weak. Under 2000 Elo points in blitz 4'+2".
Yes could be. I agree you. I am working on self learning now. This engine just enough for the play with himself I think.
EmreKalkan
Posts: 7
Joined: Wed Sep 10, 2025 8:28 pm
Full name: M. Emre Kalkan

Re: Introducing RuthChess 7.0 – Rust-Based Engine with New Ideas

Post by EmreKalkan »

ZirconiumX wrote: Fri Sep 12, 2025 11:32 am
EmreKalkan wrote: Thu Sep 11, 2025 7:02 pm
ZirconiumX wrote: Thu Sep 11, 2025 12:59 pm Ciekce and I decided to do some code auditing; I'll let him post his findings.

Here's one case I spotted immediately: you're using the PSTs from the Simplified Evaluation Function, which are listed in rank 8..1 order (as if from White's point of view on a chessboard), however you are using A1=0 indexing, so you are indexing the PSTs upside down.

I also could not find a perft function in your code, only a single test bench asserting that there are 20 generated moves in the start position. From that it's not obvious to me that your move generator is correct.
You re right about perfts. I dont have a test but I tested it manually many many times 6 months ago. I am still using same codes. I will add perfts too. I am alone at this project, Its awful. But I didnt understand very well PST problem. I checked my code everything looks fine. Can you explain more detaily.
Your PSTs look like this:

Code: Select all

const PAWN_MG: [i32; 64] = [
      0,   0,   0,   0,   0,   0,   0,   0,
     50,  50,  50,  50,  50,  50,  50,  50,
     10,  10,  20,  30,  30,  20,  10,  10,
      5,   5,  10,  25,  25,  10,   5,   5,
      0,   0,   0,  20,  20,   0,   0,   0,
      5,  -5, -10,   0,   0, -10,  -5,   5,
      5,  10,  10, -20, -20,  10,  10,   5,
      0,   0,   0,   0,   0,   0,   0,   0
];
This is as if you're looking at the chessboard from white's point of view, where A1 is at the bottom left of the array. But that mean the PST index for A1 is 56, not 0. To fix the index, you either xor by 56 for white, not black (as you currently do), or you change the PST to use A1=0 indexing, to look like this:

Code: Select all

const PAWN_MG: [i32; 64] = [
      0,   0,   0,   0,   0,   0,   0,   0,
      5,  10,  10, -20, -20,  10,  10,   5,
      5,  -5, -10,   0,   0, -10,  -5,   5,
      0,   0,   0,  20,  20,   0,   0,   0,
      5,   5,  10,  25,  25,  10,   5,   5,
     10,  10,  20,  30,  30,  20,  10,  10,
     50,  50,  50,  50,  50,  50,  50,  50,
      0,   0,   0,   0,   0,   0,   0,   0
];
Oh wow. Im a DUMB :D. White side need xor. Thank you man. Thanks so much.